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