-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/openai plugins voyage #40
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add voyageai dependency - Upgrade various dependencies including: - anthropic to 0.28.0 - anyio to 4.4.0 - certifi to 2024.6.2 - coverage to 7.5.3 - google-api-python-client to 2.131.0 - google-cloud-aiplatform to 1.53.0 - huggingface-hub to 0.23.2 - jiter to 0.4.1 - openai to 1.30.5 - pkginfo to 1.11.0 - pydantic-core to 2.18.3 - pydantic to 2.7.2 - rapidfuzz to 3.9.3 - requests to 2.32.3 - sympy to 1.12.1 - transformers to 4.41.2 - typing-extensions to 4.12.1 - uvicorn to 0.30.1 - watchfiles to 0.22.0 - zipp to 3.19.1 - Add aiolimiter, tenacity dependencies
- Add new file `languru/openai_plugins/clients/voyage.py` - Implement `VoyageModels` class extending `OpenAIResources.Models` - Define supported Voyage models - Implement `retrieve` and `list` methods - Implement `VoyageEmbeddings` class extending `OpenAIResources.Embeddings` - Implement `create` method to generate embeddings using Voyage AI client - Implement `VoyageOpenAI` class extending `OpenAI` - Override `models` and `embeddings` properties with Voyage implementations - Initialize `voyageai.Client` in constructor
- Add new test file tests/openai_plugins/test_voyage.py - Test retrieving a specific model by name - Test listing available models - Test creating embeddings for single text and list of texts - Verify expected embedding results are returned
- Add VOYAGE_API_KEY to the list of environment variables passed to the pytest job
The `AnthropicChatCompletions` class has been updated to handle the new message stream events introduced in the anthropic library version 0.27: - Import the new event types: `RawContentBlockDeltaEvent`, `RawContentBlockStartEvent`, `RawContentBlockStopEvent`, `RawMessageDeltaEvent`, `RawMessageStartEvent`, `RawMessageStopEvent`, `RawMessageStreamEvent`, `TextDelta` - Update `generator_generate_content_chunks` method to process the new event types: - Handle `RawMessageStartEvent` to set chat completion ID and input token count - Handle `RawContentBlockDeltaEvent` with `TextDelta` to yield chat completion chunks - Handle `RawMessageDeltaEvent` to update output token count and determine finish reason - Log warnings for unhandled event types - Update poetry dependencies to require anthropic library version greater than 0.27
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40 +/- ##
==========================================
+ Coverage 79.52% 79.69% +0.17%
==========================================
Files 71 72 +1
Lines 3213 3290 +77
==========================================
+ Hits 2555 2622 +67
- Misses 658 668 +10 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.