Skip to content

Commit cabe3a7

Browse files
committed
feat: add K8SGPT_PROVIDER_REGION env var support for serve command
1 parent c80b2e2 commit cabe3a7

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

cmd/serve/serve.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,24 @@ var ServeCmd = &cobra.Command{
128128
engine := os.Getenv("K8SGPT_ENGINE")
129129
proxyEndpoint := os.Getenv("K8SGPT_PROXY_ENDPOINT")
130130
providerId := os.Getenv("K8SGPT_PROVIDER_ID")
131+
providerRegion := os.Getenv("K8SGPT_PROVIDER_REGION")
131132
// If the envs are set, allocate in place to the aiProvider
132133
// else exit with error
133134
envIsSet := backend != "" || password != "" || model != ""
134135
if envIsSet {
135136
aiProvider = &ai.AIProvider{
136-
Name: backend,
137-
Password: password,
138-
Model: model,
139-
BaseURL: baseURL,
140-
Engine: engine,
141-
ProxyEndpoint: proxyEndpoint,
142-
ProviderId: providerId,
143-
Temperature: temperature(),
144-
TopP: topP(),
145-
TopK: topK(),
146-
MaxTokens: maxTokens(),
137+
Name: backend,
138+
Password: password,
139+
Model: model,
140+
BaseURL: baseURL,
141+
Engine: engine,
142+
ProxyEndpoint: proxyEndpoint,
143+
ProviderId: providerId,
144+
ProviderRegion: providerRegion,
145+
Temperature: temperature(),
146+
TopP: topP(),
147+
TopK: topK(),
148+
MaxTokens: maxTokens(),
147149
}
148150

149151
configAI.Providers = append(configAI.Providers, *aiProvider)

0 commit comments

Comments
 (0)