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(community): Update Voyage embeddings parameters #7689

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

nicolas-geysse
Copy link
Contributor

Fixes # (issue)

Additionally, the class supports new parameters for further customization of the embedding process:
- **truncation**: Whether to truncate the input texts to the maximum length allowed by the model.
- **outputDimension**: The desired dimension of the output embeddings.
- **outputDtype**: The data type of the output embeddings. Can be `"float"` or `"int8"`.
- **encodingFormat**: The format of the output embeddings. Can be `"float"`, `"base64"`, or `"ubinary"`.
Additionally, the class supports new parameters for further customization of the embedding process:
- **truncation**: Whether to truncate the input texts to the maximum length allowed by the model.
- **outputDimension**: The desired dimension of the output embeddings.
- **outputDtype**: The data type of the output embeddings. Can be `"float"` or `"int8"`.
- **encodingFormat**: The format of the output embeddings. Can be `"float"`, `"base64"`, or `"ubinary"`.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 13, 2025
Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs 🛑 Canceled (Inspect) Feb 18, 2025 2:52am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Feb 18, 2025 2:52am

@dosubot dosubot bot added auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Feb 13, 2025
@nicolas-geysse
Copy link
Contributor Author

Hello,
Sorry, I'm very bad with this PR organization, I think the modification code is okay but the tests seems to fail.

Purpose

This PR adds support for new Voyage AI embedding parameters (truncation, output_dimension, output_dtype, encoding_format) to match their Python implementation and API documentation.

Observed CI Issues

  1. Broken Links Check
    Fails due to ES Module syntax in a CommonJS file (check_broken_links.cjs):

    SyntaxError: Cannot use import statement outside a module
    

    (Unrelated to this PR - appears to be a project configuration issue)

  2. Prettier Formatting
    Fails with:

    No parser and no file path given, couldn't infer a parser
    

    (Likely needs Prettier config adjustments in the repo)

  3. Integration Tests
    Google GenAI tests fail due to missing GOOGLE_API_KEY secret:

    "Please set an API key for Google GenerativeAI [...]"
    
    • Expected behavior for external contributor PRs (GitHub secrets aren't exposed to forks)
    • Confirmed unrelated to Voyage AI changes

Code Fixes Included

  • Fixed typo in error message: environmentbenvironment (embeddings.ts)
  • Corrected inverted test logic in chat_models.standard.int.test.ts:
    - if (!process.env.GOOGLE_API_KEY) {
    + if (process.env.GOOGLE_API_KEY) {

I guess it's the case for all tests.
Should I do something differently ?
Thanks !

@jacoblee93 jacoblee93 changed the title Update Voyage embeddings parameters feat(community): Update Voyage embeddings parameters Feb 18, 2025
Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

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

Thank you!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Feb 18, 2025
@jacoblee93
Copy link
Collaborator

I can run yarn format

@vercel vercel bot temporarily deployed to Preview – langchainjs-docs February 18, 2025 02:52 Inactive
@jacoblee93 jacoblee93 merged commit b2d6b74 into langchain-ai:main Feb 18, 2025
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs lgtm PRs that are ready to be merged as-is size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants