-
-
Notifications
You must be signed in to change notification settings - Fork 946
Expand file tree
/
Copy pathusechat_mode_test.go
More file actions
39 lines (34 loc) · 1.15 KB
/
usechat_mode_test.go
File metadata and controls
39 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2026, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
package aiusechat
import (
"testing"
"github.com/wavetermdev/waveterm/pkg/aiusechat/uctypes"
"github.com/wavetermdev/waveterm/pkg/wconfig"
)
func TestApplyProviderDefaultsGroq(t *testing.T) {
config := wconfig.AIModeConfigType{
Provider: uctypes.AIProvider_Groq,
}
applyProviderDefaults(&config)
if config.APIType != uctypes.APIType_OpenAIChat {
t.Fatalf("expected API type %q, got %q", uctypes.APIType_OpenAIChat, config.APIType)
}
if config.Endpoint != GroqChatEndpoint {
t.Fatalf("expected endpoint %q, got %q", GroqChatEndpoint, config.Endpoint)
}
if config.APITokenSecretName != GroqAPITokenSecretName {
t.Fatalf("expected API token secret name %q, got %q", GroqAPITokenSecretName, config.APITokenSecretName)
}
}
func TestApplyProviderDefaultsKeepsProxyURL(t *testing.T) {
config := wconfig.AIModeConfigType{
Provider: uctypes.AIProvider_OpenAI,
Model: "gpt-5-mini",
ProxyURL: "http://localhost:8080",
}
applyProviderDefaults(&config)
if config.ProxyURL != "http://localhost:8080" {
t.Fatalf("expected proxy URL to be preserved, got %q", config.ProxyURL)
}
}