Skip to content

Support Anthropic Models#1

Merged
nickchecan merged 10 commits intomainfrom
anthropic
Mar 19, 2026
Merged

Support Anthropic Models#1
nickchecan merged 10 commits intomainfrom
anthropic

Conversation

@nickchecan
Copy link
Copy Markdown
Owner

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:

  • Implemented the AnthropicAdapter in src/anthropic/anthropic-adapter.ts to support both streaming and one-shot generation using the Anthropic SDK, handling error cases and response formatting.
  • Updated the AdapterFactory (src/adapter-factory.ts) to instantiate AnthropicAdapter for models starting with claude-, enabling seamless model selection between OpenAI and Anthropic providers. [1] [2]

Dependency and Configuration Updates:

  • Added @anthropic-ai/sdk as a dependency in package.json.
  • Updated ESLint configuration to ignore the dist/ directory.

Testing Enhancements:

Unit Tests:

  • Added and extended unit tests for the AnthropicAdapter to verify correct API calls, error handling, and response formatting (test/unit/anthropic/anthropic-adapter.spec.ts).
  • Updated adapter-factory.spec.ts to 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:

  • Introduced integration tests for Anthropic models (test/integration/anthropic/anthropic.it.spec.ts), validating both one-shot and streaming interactions with multiple Claude models.

@nickchecan nickchecan changed the title Anthropic Support Anthropic Models Mar 18, 2026
@nickchecan nickchecan merged commit d7f4833 into main Mar 19, 2026
3 checks passed
@nickchecan nickchecan deleted the anthropic branch March 19, 2026 14:36
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant