-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdefault_test.go
More file actions
31 lines (24 loc) · 1 KB
/
default_test.go
File metadata and controls
31 lines (24 loc) · 1 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
package ai
import (
"testing"
"github.com/stretchr/testify/assert"
"go.jetify.com/ai/provider/anthropic"
"go.jetify.com/ai/provider/openai"
)
func TestDefaultLanguageModel(t *testing.T) {
// Get current model and verify provider and model ID match expected values
originalModel := DefaultLanguageModel()
assert.Equal(t, "openai", originalModel.ProviderName())
assert.Equal(t, openai.ChatModelGPT5, originalModel.ModelID())
// Change model to different provider (Anthropic)
anthropicModel := anthropic.NewLanguageModel(anthropic.ModelClaude3_5SonnetLatest)
SetDefaultLanguageModel(anthropicModel)
currentModel := DefaultLanguageModel()
assert.Equal(t, "anthropic", currentModel.ProviderName())
assert.Equal(t, anthropic.ModelClaude3_5SonnetLatest, currentModel.ModelID())
// Restore model to original
SetDefaultLanguageModel(originalModel)
restoredModel := DefaultLanguageModel()
assert.Equal(t, "openai", restoredModel.ProviderName())
assert.Equal(t, openai.ChatModelGPT5, restoredModel.ModelID())
}