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

@@ -35,18 +35,18 @@ func TestCompletionsStreamStreamsReasoningDeltas(t *testing.T) {
errCh := make(chan error, 1)
go func() {
errCh <- client.CompletionsStream(
context.Background(),
"test-model",
"",
0,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hello",
context.Background(), CompletionsParams{
Model: "test-model",
SystemMessage: "",
MaxIterations: 0,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hello",
}},
}},
}},
events,
}, events,
)
}()
@@ -131,17 +131,18 @@ func TestCompletionsReturnsUsageAndTimings(t *testing.T) {
}
res, err := client.Completions(
context.Background(),
"test-model",
"",
0,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hi",
context.Background(), CompletionsParams{
Model: "test-model",
SystemMessage: "",
MaxIterations: 0,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hi",
}},
}},
}},
},
)
if err != nil {
t.Fatalf("Completions: %v", err)
@@ -205,18 +206,18 @@ func TestCompletionsStreamEmitsUsageEvent(t *testing.T) {
errCh := make(chan error, 1)
go func() {
errCh <- client.CompletionsStream(
context.Background(),
"test-model",
"",
0,
[]Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hi",
context.Background(), CompletionsParams{
Model: "test-model",
SystemMessage: "",
MaxIterations: 0,
Messages: []Message{{
Role: RoleUser,
ContentParts: []ContentPart{{
Type: ContentTypeText,
Text: "hi",
}},
}},
}},
events,
}, events,
)
}()