-
Notifications
You must be signed in to change notification settings - Fork 295
Add support of the anthropic model #233
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
base: main
Are you sure you want to change the base?
Conversation
259afe2 to
0c29587
Compare
0c29587 to
6ec94da
Compare
|
Hi @dpasiukevich @mazas-google, I have implemented the first version of supporting the anthropic model, and have the basic test on my side. Could you please have a look when you get time? I would like to confirm if the direction is correct from the maintainer's perspective, and happy to modify the PR according to your feedback. |
|
/gemini review |
|
I will try do a proper review tomorrow. Thank you for the contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds comprehensive support for Anthropic models via Vertex AI, introducing a new anthropic package to adapt the model.LLM interface. The implementation is well-structured, separating request building, response parsing, and the core client logic. It correctly handles both streaming and non-streaming generation and is accompanied by a solid set of tests, including good coverage for the streaming logic. I've identified one high-severity issue concerning the in-place modification of input data, which could lead to unexpected side effects. My detailed comment suggests a safer approach to ensure data immutability. Overall, this is a high-quality contribution.
dfa4215 to
802b98c
Compare
|
@dpasiukevich, could you please take a look at this PR when you get time? |
This commit integrates the changes from google#233, which adds comprehensive support for Anthropic's Claude models via the model.LLM interface. Key features: - Support for both streaming and non-streaming generation - Integration with Vertex AI, Anthropic API, and AWS Bedrock providers - Tool/function calling with proper schema conversion - Handles multiple content types (text, images, code execution) - Comprehensive test coverage Changes include: - New model/anthropic package with core implementation - Request/response builders for API translation - Provider selection (vertex_ai, anthropic, aws_bedrock) - Dependencies: anthropic-sdk-go v1.17.0 and tidwall utilities All code has been formatted with go fmt, passes go vet checks, and all tests pass successfully. Original PR: google#233 Author: git-hulk <[email protected]>
This document provides a detailed technical comparison of how the integrated PR google#233 code uses the Anthropic SDK versus how the Charm Fantasy library implements similar functionality. Key findings: - Both use the official anthropic-sdk-go correctly - Fantasy has more production features (caching, advanced streaming) - ADK-Go is simpler and well-suited for basic Vertex AI usage - Identifies potential improvements for future iterations This analysis helps understand the tradeoffs and implementation patterns for Anthropic SDK integration in Go.
This PR closes #225.