Merged
Conversation
|
🎉 This PR is included in version 1.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or 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
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.
This pull request adds full support for Anthropic's Claude models by implementing an
AnthropicAdapter, updating the adapter factory, and introducing comprehensive tests. It also adds the Anthropic SDK as a dependency and ensures the new functionality is covered by both unit and integration tests.Anthropic Adapter Implementation and Integration:
AnthropicAdapterinsrc/anthropic/anthropic-adapter.tsto support both streaming and one-shot generation using the Anthropic SDK, handling error cases and response formatting.AdapterFactory(src/adapter-factory.ts) to instantiateAnthropicAdapterfor models starting withclaude-, enabling seamless model selection between OpenAI and Anthropic providers. [1] [2]Dependency and Configuration Updates:
@anthropic-ai/sdkas a dependency inpackage.json.dist/directory.Testing Enhancements:
Unit Tests:
AnthropicAdapterto verify correct API calls, error handling, and response formatting (test/unit/anthropic/anthropic-adapter.spec.ts).adapter-factory.spec.tsto include tests for Anthropic model detection and instantiation, ensuring the factory creates the correct adapter and passes parameters properly. [1] [2] [3] [4] [5] [6]Integration Tests:
test/integration/anthropic/anthropic.it.spec.ts), validating both one-shot and streaming interactions with multiple Claude models.