From 198f5b776af13aecff2cd715b7535186ccfeaa85 Mon Sep 17 00:00:00 2001 From: yanweili Date: Thu, 26 Sep 2024 16:33:07 -0700 Subject: [PATCH] fix: add providerId to serve mode Signed-off-by: yanweili --- cmd/serve/serve.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/serve/serve.go b/cmd/serve/serve.go index 703182c004..be49588278 100644 --- a/cmd/serve/serve.go +++ b/cmd/serve/serve.go @@ -14,10 +14,11 @@ limitations under the License. package serve import ( - k8sgptserver "github.com/k8sgpt-ai/k8sgpt/pkg/server" "os" "strconv" + k8sgptserver "github.com/k8sgpt-ai/k8sgpt/pkg/server" + "github.com/fatih/color" "github.com/k8sgpt-ai/k8sgpt/pkg/ai" "github.com/spf13/cobra" @@ -108,6 +109,7 @@ var ServeCmd = &cobra.Command{ baseURL := os.Getenv("K8SGPT_BASEURL") engine := os.Getenv("K8SGPT_ENGINE") proxyEndpoint := os.Getenv("K8SGPT_PROXY_ENDPOINT") + providerId := os.Getenv("K8SGPT_PROVIDER_ID") // If the envs are set, allocate in place to the aiProvider // else exit with error envIsSet := backend != "" || password != "" || model != "" @@ -119,6 +121,7 @@ var ServeCmd = &cobra.Command{ BaseURL: baseURL, Engine: engine, ProxyEndpoint: proxyEndpoint, + ProviderId: providerId, Temperature: temperature(), TopP: topP(), TopK: topK(),