(t *testing.T)
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // TestMessageTokensCountsReasoning: replayed reasoning items ride on every |
| 58 | // later request, so they must cost budget like any other bytes on the wire. |
| 59 | func TestMessageTokensCountsReasoning(t *testing.T) { |
| 60 | item := json.RawMessage(`{"type":"reasoning","encrypted_content":"` + strings.Repeat("A", 40) + `"}`) |
| 61 | base := Message{Role: RoleAssistant, Content: "ok"}.Tokens() |
| 62 | with := Message{Role: RoleAssistant, Content: "ok", Reasoning: []json.RawMessage{item}}.Tokens() |
| 63 | if got, want := with-base, Tokens(string(item)); got != want { |
| 64 | t.Fatalf("reasoning cost = %d tokens, want %d (Message.Tokens must account for Reasoning)", got, want) |
nothing calls this directly
no test coverage detected