-
Notifications
You must be signed in to change notification settings - Fork 813
AnthropicVertex in not in the vertex modul #140
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
Comments
Please format code in issues properly, this is unreadable. What (I think) you're asking for is not currently possible since we don't yet support Anthropic #63. Our |
@samuelcolvin can this be revisited with support for Anthropic coming in today? |
any update on supporting anthropic via vertex ai ? @samuelcolvin |
any updates? |
There's a new issue about this, and a PR. I'll check soon. I'm not providing references because I'm on my phone. I trust your search skills. 😎👍 |
#1392 for reference |
i have question: is my implementation is right or i need to do it other way? it's work 100% but sure it right way! ` class VertexAnthropicProvider(AnthropicProvider):
def get_anthropic_model(reasoner=False):
` |
trying to work with Claude from model garden of goole and revive error
ImportError: cannot import name 'AnthropicVertex' from 'pydantic_ai.models.vertexai' (/usr/local/lib/python3.10/dist-packages/pydantic_ai/models/vertexai.py)
the code I trying to use:
from pydantic_ai import Agent
from pydantic_ai.models.vertexai import VertexAIModel, AnthropicVertex
model =AnthropicVertex('claude-3-5-sonnet-v2@20241022',project_id="me-sb-dgcp-dpoc-pocyosh-pr",region="us-east5")
agent = Agent(model)
result = agent.run_sync('Tell me a joke.')
print(result.data)
by default I use code :
from anthropic import AnthropicVertex
LOCATION=os.getenv("GOOGLE_CLOUDE_LOCATION","us-east5")
PROJECT=os.getenv("GOOGLE_CLOUDE_PROJECT_ID","me-sb-dgcp-dpoc-pocyosh-pr")
MODEL=os.getenv("ANTHROPIC_LLM_MODEL_NAME","claude-3-5-haiku@20241022")
client = AnthropicVertex(region=location, project_id=project_id)
response = self.client.messages.create(
model=self.model,
max_tokens=max_tokens,
temperature=temperature,
messages=messages
)
print( response.content[0].text )
The text was updated successfully, but these errors were encountered: