Add debug stats

This commit is contained in:
dwrz
2026-06-27 00:13:16 +00:00
parent bcdbd9092a
commit f2edd39160
8 changed files with 553 additions and 28 deletions

View File

@@ -76,7 +76,7 @@ func TestIntegration_Completions(t *testing.T) {
t.Fatalf("NewClient: %v", err)
}
msgs, err := client.Completions(
res, err := client.Completions(
context.Background(),
testModel(t),
"",
@@ -92,10 +92,10 @@ func TestIntegration_Completions(t *testing.T) {
if err != nil {
t.Fatalf("Completions: %v", err)
}
if len(msgs) == 0 {
if len(res.Messages) == 0 {
t.Fatal("expected at least one message")
}
text := msgs[len(msgs)-1].Text()
text := res.Messages[len(res.Messages)-1].Text()
if text == "" {
t.Error("final message has no text")
}
@@ -181,7 +181,7 @@ func TestIntegration_ToolCalling(t *testing.T) {
t.Fatalf("NewClient: %v", err)
}
msgs, err := client.Completions(
res, err := client.Completions(
context.Background(),
testModel(t),
"",
@@ -197,11 +197,11 @@ func TestIntegration_ToolCalling(t *testing.T) {
if err != nil {
t.Fatalf("Completions: %v", err)
}
if len(msgs) == 0 {
if len(res.Messages) == 0 {
t.Fatal("expected at least one message")
}
// The final message should be a non-tool-call assistant message.
final := msgs[len(msgs)-1]
final := res.Messages[len(res.Messages)-1]
if len(final.ToolCalls) > 0 {
t.Error("final message still has tool calls")
}