Decode provider reasoning and cache usage details
This commit is contained in:
@@ -19,9 +19,9 @@ func stringPointerForTest(value string) *string {
|
||||
func TestGenerateResponseUsagePresenceJSON(t *testing.T) {
|
||||
value := promptkit.GenerateResponse{
|
||||
Content: "ok",
|
||||
Usage: promptkit.TokenUsage{TotalTokens: 5},
|
||||
Usage: promptkit.TokenUsage{TotalTokens: 5, ReasoningTokens: 2},
|
||||
UsagePresence: &promptkit.TokenUsagePresence{
|
||||
PromptTokens: true, CompletionTokens: true, TotalTokens: true,
|
||||
PromptTokens: true, CompletionTokens: true, TotalTokens: true, ReasoningTokens: true,
|
||||
CachedTokens: true, CacheWriteTokens: true,
|
||||
},
|
||||
}
|
||||
@@ -30,6 +30,9 @@ func TestGenerateResponseUsagePresenceJSON(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
object := decodeJSONObject(t, payload)
|
||||
if string(decodeJSONObject(t, object["usage"])["reasoning_tokens"]) != "2" {
|
||||
t.Fatalf("reasoning field missing: %s", payload)
|
||||
}
|
||||
if _, ok := object["usage_presence"]; !ok {
|
||||
t.Fatalf("missing usage_presence: %s", payload)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user