Add reasoning effort

This commit is contained in:
dwrz
2026-07-07 15:14:07 +00:00
parent c730ecdc22
commit 27fa702071
9 changed files with 192 additions and 122 deletions

View File

@@ -77,17 +77,18 @@ func TestIntegration_Completions(t *testing.T) {
}
res, err := client.Completions(
context.Background(),
testModel(t),
"",
0,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Say hello in three words.",
context.Background(), CompletionsParams{
Model: testModel(t),
SystemMessage: "",
MaxIterations: 0,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Say hello in three words.",
}},
}},
}},
},
)
if err != nil {
t.Fatalf("Completions: %v", err)
@@ -117,18 +118,18 @@ func TestIntegration_CompletionsStream(t *testing.T) {
errCh := make(chan error, 1)
go func() {
errCh <- client.CompletionsStream(
context.Background(),
testModel(t),
"",
0,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Say hello in three words.",
context.Background(), CompletionsParams{
Model: testModel(t),
SystemMessage: "",
MaxIterations: 0,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Say hello in three words.",
}},
}},
}},
events,
}, events,
)
}()
@@ -182,17 +183,18 @@ func TestIntegration_ToolCalling(t *testing.T) {
}
res, err := client.Completions(
context.Background(),
testModel(t),
"",
10,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Use the echo tool to say 'hello'",
context.Background(), CompletionsParams{
Model: testModel(t),
SystemMessage: "",
MaxIterations: 10,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: "text",
Text: "Use the echo tool to say 'hello'",
}},
}},
}},
},
)
if err != nil {
t.Fatalf("Completions: %v", err)