Skip to content

Commit

Permalink
fix: add providerId to serve mode (#1260)
Browse files Browse the repository at this point in the history
Signed-off-by: yanweili <yanweili@ibm.com>
Co-authored-by: yanweili <yanweili@ibm.com>
  • Loading branch information
liyanwei93 and yanweili authored Sep 27, 2024
1 parent b62b7db commit da0764d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 != ""
Expand All @@ -119,6 +121,7 @@ var ServeCmd = &cobra.Command{
BaseURL: baseURL,
Engine: engine,
ProxyEndpoint: proxyEndpoint,
ProviderId: providerId,
Temperature: temperature(),
TopP: topP(),
TopK: topK(),
Expand Down

0 comments on commit da0764d

Please sign in to comment.