Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use custom llamaparse client to reduce bundle size #47

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

JacobLinCool
Copy link
Member

This pull request introduces several changes to the project, including adding new dependencies, refactoring the PDF parsing functionality, and adding tests for the new LlamaParse class. The most important changes are summarized below:

Dependencies and Configuration:

  • Added vitest as a new testing framework in package.json.
  • Added @sveltejs/adapter-vercel as a new adapter in package.json.
  • Removed llamaindex from dependencies in package.json.
  • Updated the Svelte adapter to use @sveltejs/adapter-vercel in svelte.config.js.

PDF Parsing Refactor:

  • Created a new LlamaParse class in src/lib/server/llamaparse.ts to handle file parsing, status checking, and result retrieval.
  • Refactored pdf2Text function in src/lib/server/pdf.ts to use the new LlamaParse class.

Testing:

  • Added a new test suite for LlamaParse in tests/llamaparse.test.ts, including tests for PDF file parsing.

@JacobLinCool JacobLinCool self-assigned this Dec 22, 2024
@Copilot Copilot bot review requested due to automatic review settings December 22, 2024 16:21

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/lib/server/llamaparse.ts:45

  • [nitpick] The error message could be more descriptive. Consider including additional context about the failure, such as the job ID.
throw new Error(`Parsing failed: ${status.error}`);
@JacobLinCool JacobLinCool merged commit cb3ec8a into main Dec 22, 2024
1 check passed
@JacobLinCool JacobLinCool deleted the custom-llamaparse-client branch December 22, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant