fix: add providerId to serve mode (#1260)

Signed-off-by: yanweili <yanweili@ibm.com>
Co-authored-by: yanweili <yanweili@ibm.com>
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
Yanwei Li 2024-09-26 23:32:58 -07:00 committed by AlexsJones
parent b1528c77a0
commit ff73434d34

View File

@ -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(),