fix: use bedrock-2023-05-31 for AI Core Anthropic version
CI / test (pull_request) Successful in 15s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 38s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m11s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m52s
CI / test (pull_request) Successful in 15s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 38s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m11s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m52s
SAP AI Core's Anthropic endpoint uses AWS Bedrock API format, not native Anthropic API. Verified via integration testing: - 2023-06-01: Invalid API version - bedrock-2023-05-31: Works ✓
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ func (c *AICoreClient) CompleteAnthropic(ctx context.Context, model string, mess
|
|||||||
}
|
}
|
||||||
|
|
||||||
reqBody := anthropicRequest{
|
reqBody := anthropicRequest{
|
||||||
// AnthropicVersion omitted - SAP AI Core does not accept it in body
|
AnthropicVersion: "bedrock-2023-05-31", // SAP AI Core uses Bedrock format
|
||||||
// Model omitted - AI Core deployment already specifies model
|
// Model omitted - AI Core deployment already specifies model
|
||||||
MaxTokens: maxTokens,
|
MaxTokens: maxTokens,
|
||||||
System: system,
|
System: system,
|
||||||
|
|||||||
+2
-2
@@ -206,8 +206,8 @@ func TestAICoreClient_CompleteAnthropic(t *testing.T) {
|
|||||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||||
t.Fatalf("decode request: %v", err)
|
t.Fatalf("decode request: %v", err)
|
||||||
}
|
}
|
||||||
if req.MaxTokens == 0 {
|
if req.AnthropicVersion != "bedrock-2023-05-31" {
|
||||||
t.Errorf("expected max_tokens in request")
|
t.Errorf("expected bedrock anthropic_version in request")
|
||||||
}
|
}
|
||||||
if req.System != "You are helpful" {
|
if req.System != "You are helpful" {
|
||||||
t.Errorf("expected system prompt: %q", req.System)
|
t.Errorf("expected system prompt: %q", req.System)
|
||||||
|
|||||||
Reference in New Issue
Block a user