25 lines
864 B
Go
25 lines
864 B
Go
|
|
package llm
|
||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
func TestShouldDisableThinkingParam(t *testing.T) {
|
||
|
|
if !shouldDisableThinkingParam("https://dashscope.aliyuncs.com/compatible-mode/v1") {
|
||
|
|
t.Fatal("expected DashScope base URL to require enable_thinking=false")
|
||
|
|
}
|
||
|
|
if shouldDisableThinkingParam("https://api.openai.com/v1") {
|
||
|
|
t.Fatal("expected standard OpenAI base URL not to require enable_thinking=false")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestChatCompletionRequestOptions(t *testing.T) {
|
||
|
|
client := &OpenAICompatibleClient{disableThinkingParam: true}
|
||
|
|
if got := len(client.chatCompletionRequestOptions()); got != 1 {
|
||
|
|
t.Fatalf("expected 1 request option when disableThinkingParam=true, got %d", got)
|
||
|
|
}
|
||
|
|
|
||
|
|
client.disableThinkingParam = false
|
||
|
|
if got := len(client.chatCompletionRequestOptions()); got != 0 {
|
||
|
|
t.Fatalf("expected 0 request options when disableThinkingParam=false, got %d", got)
|
||
|
|
}
|
||
|
|
}
|