okami.mom/web-extract-go

git clone https://git.nkp.pet/okami.mom/web-extract-go

nekomimi.petsummaries: thinking off for previews, capped at 256 tokens for answers3009bc8

main
738 B24 linesraw
1package app
2
3import (
4	"encoding/json"
5	"strings"
6	"testing"
7)
8
9func TestThinkingIsOffForPreviewsAndCappedForAnswers(t *testing.T) {
10	base := CompletionRequest{Model: "bonsai", MaxTokens: 2048}
11	for task, want := range map[string]string{
12		"preview_summary":  `"chat_template_kwargs":{"enable_thinking":false}`,
13		"synthesis_digest": `"reasoning_budget_tokens":256`,
14	} {
15		body, _ := json.Marshal(withThinking(base, task))
16		if !strings.Contains(string(body), want) {
17			t.Errorf("%s: %s lacks %s", task, body, want)
18		}
19	}
20	body, _ := json.Marshal(withThinking(base, "other"))
21	if strings.Contains(string(body), "thinking") || strings.Contains(string(body), "reasoning") {
22		t.Errorf("an unlisted task changed thinking: %s", body)
23	}
24}