Skip to content

Commit 11794e5

Browse files
authored
feat(go/plugins/compat_oai): add support for Claude 4.1 and 4.5 models (#3768)
1 parent 63a5297 commit 11794e5

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

go/plugins/compat_oai/anthropic/anthropic.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,36 @@ const (
3232

3333
// Supported models: https://docs.anthropic.com/en/docs/about-claude/models/all-models
3434
var supportedModels = map[string]ai.ModelOptions{
35+
"claude-opus-4-1-20250805": {
36+
Label: "Claude 4.1 Opus",
37+
Supports: &ai.ModelSupports{
38+
Multiturn: true,
39+
Tools: false, // NOTE: Anthropic supports tool use, but it's not compatible with the OpenAI API
40+
SystemRole: true,
41+
Media: true,
42+
},
43+
Versions: []string{"claude-opus-4-1-latest", "claude-opus-4-1-20250805"},
44+
},
45+
"claude-sonnet-4-5-20250929": {
46+
Label: "Claude 4.5 Sonnet",
47+
Supports: &ai.ModelSupports{
48+
Multiturn: true,
49+
Tools: false, // NOTE: Anthropic supports tool use, but it's not compatible with the OpenAI API
50+
SystemRole: true,
51+
Media: true,
52+
},
53+
Versions: []string{"claude-sonnet-4-5-latest", "claude-sonnet-4-5-20250929"},
54+
},
55+
"claude-haiku-4-5-20251001": {
56+
Label: "Claude 4.5 Haiku",
57+
Supports: &ai.ModelSupports{
58+
Multiturn: true,
59+
Tools: false, // NOTE: Anthropic supports tool use, but it's not compatible with the OpenAI API
60+
SystemRole: true,
61+
Media: true,
62+
},
63+
Versions: []string{"claude-haiku-4-5-latest", "claude-haiku-4-5-20251001"},
64+
},
3565
"claude-3-7-sonnet-20250219": {
3666
Label: "Claude 3.7 Sonnet",
3767
Supports: &ai.ModelSupports{

go/plugins/compat_oai/anthropic/anthropic_live_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ func TestPlugin(t *testing.T) {
3434

3535
ctx := context.Background()
3636

37-
// Initialize genkit with claude-3-7-sonnet as default model
37+
// Initialize genkit with claude-4-5-sonnet as default model
3838
g := genkit.Init(
3939
ctx,
40-
genkit.WithDefaultModel("anthropic/claude-3-7-sonnet-20250219"),
40+
genkit.WithDefaultModel("anthropic/claude-sonnet-4-5-20250929"),
4141
genkit.WithPlugins(&anthropic.Anthropic{
4242
Opts: []option.RequestOption{
4343
option.WithAPIKey(apiKey),

0 commit comments

Comments
 (0)