Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/endpointspec/endpointspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ func (MessagesEndpointSpec) GetTranslator(schema filterapi.VersionedAPISchema, m
return translator.NewAnthropicToAnthropicTranslator(schema.Version, modelNameOverride), nil
case filterapi.APISchemaOpenAI:
return translator.NewAnthropicToChatCompletionOpenAITranslator(schema.OpenAIPrefix(), modelNameOverride), nil
case filterapi.APISchemaAWSBedrock:
return translator.NewAnthropicToAWSBedrockTranslator(modelNameOverride), nil
default:
return nil, fmt.Errorf("/v1/messages endpoint only supports backends that return native Anthropic format (Anthropic, GCPAnthropic, AWSAnthropic). OpenAI translation is also supported. Backend %s uses different model format", schema.Name)
return nil, fmt.Errorf("/v1/messages endpoint only supports backends that return native Anthropic format (Anthropic, GCPAnthropic, AWSAnthropic). OpenAI and AWSBedrock translation is also supported. Backend %s uses different model format", schema.Name)
}
}

Expand Down
3 changes: 2 additions & 1 deletion internal/endpointspec/endpointspec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ func TestMessagesEndpointSpec_GetTranslator(t *testing.T) {
{Name: filterapi.APISchemaGCPAnthropic},
{Name: filterapi.APISchemaAWSAnthropic},
{Name: filterapi.APISchemaAnthropic},
{Name: filterapi.APISchemaOpenAI}, // This is for OpenAI-schema backends like vLLM that support the /v1/messages endpoint
{Name: filterapi.APISchemaOpenAI}, // This is for OpenAI-schema backends like vLLM that support the /v1/messages endpoint
{Name: filterapi.APISchemaAWSBedrock}, // This is for AWS Bedrock translation from the /v1/messages endpoint
} {
translator, err := spec.GetTranslator(schema, "override")
require.NoError(t, err)
Expand Down
Loading