You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The Anthropic VertexAI needs the anthropic-version to be passed in the body (as anthropic_version) instead of the header, as is done with the Anthropic API.
(See documentation here: https://docs.anthropic.com/en/api/claude-on-vertex-ai) In Vertex, anthropic_version is passed in the request body (rather than as a header), and must be set to the value vertex-2023-10-16.
This is not done in the connector logic, it reuses the AnthropicRequest model which doesn't have the anthropic_version in the body.
When trying to use the AddAnthropicVertextAIChatCompletion out of the box it returns
Sadly this seems to be a hard blocker since I see no good way to add this into the body, but I would love if anyone had a workaround.
UPDATE: After trying a hacky workaround by intercepting the request and editing the json before sending it I noticed a new error. The 'model' property is not allowed, so that also needs to be removed from the body.
Additional context
Not sure if it's a bug or intented, but unlike the GeminiVertexAi connector, the AddAnthropicVertextAIChatCompletion (it also has a typo) isn't creating the full endpoint for you. So you need to create the full URL like so:
var endpoint = new Uri($"https://{location}-aiplatform.googleapis.com/v1/projects/{projectId}/locations/{location}/publishers/anthropic/models/{_modelId}:rawPredict");
builder.AddAnthropicVertextAIChatCompletion(_modelId, () => new ValueTask<string>(bearerKey), endpoint);
Which I think could be improved to be more intuitive, and be similar to the Gemini VertexAI connector.
The text was updated successfully, but these errors were encountered:
After trying a hacky workaround by intercepting the request and editing the json before sending it I noticed a new error. The 'model' property is not allowed, so that also needs to be removed from the body.
Describe the bug
The Anthropic VertexAI needs the anthropic-version to be passed in the body (as anthropic_version) instead of the header, as is done with the Anthropic API.
(See documentation here: https://docs.anthropic.com/en/api/claude-on-vertex-ai)
In Vertex, anthropic_version is passed in the request body (rather than as a header), and must be set to the value vertex-2023-10-16.
This is not done in the connector logic, it reuses the AnthropicRequest model which doesn't have the anthropic_version in the body.
When trying to use the AddAnthropicVertextAIChatCompletion out of the box it returns
Sadly this seems to be a hard blocker since I see no good way to add this into the body, but I would love if anyone had a workaround.
UPDATE: After trying a hacky workaround by intercepting the request and editing the json before sending it I noticed a new error. The 'model' property is not allowed, so that also needs to be removed from the body.
Additional context
Not sure if it's a bug or intented, but unlike the GeminiVertexAi connector, the AddAnthropicVertextAIChatCompletion (it also has a typo) isn't creating the full endpoint for you. So you need to create the full URL like so:
Which I think could be improved to be more intuitive, and be similar to the Gemini VertexAI connector.
The text was updated successfully, but these errors were encountered: