Skip to content

Commit d59f602

Browse files
committed
add a check for the models
1 parent d4b2f2b commit d59f602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/env/env.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func GetConfiguredChatProviders() []ChatProvider {
8282
})
8383
}
8484

85-
if len(OpenAICompatibleAPIKey) > 0 && len(OpenAICompatibleEndpoint) > 0 {
85+
if len(OpenAICompatibleAPIKey) > 0 && len(OpenAICompatibleEndpoint) > 0 && len(CustomModels) > 0 {
8686
providers = append(providers, ChatProvider{
8787
Type: "OpenAI-Compatible",
8888
APIKey: OpenAICompatibleAPIKey,
@@ -134,7 +134,7 @@ func GetOpenAIEndpoint() string {
134134
}
135135

136136
func GetOpenAICompatibleEndpoint() string {
137-
if OpenAICompatibleEndpoint != "" && OpenAICompatibleAPIKey != "" {
137+
if OpenAICompatibleEndpoint != "" && OpenAICompatibleAPIKey != "" && len(CustomModels) > 0 {
138138
return OpenAICompatibleEndpoint
139139
}
140140
return "https://api.openai.com/v1"

0 commit comments

Comments
 (0)