mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-08-14 22:13:01 +00:00
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:
parent
b1528c77a0
commit
ff73434d34
@ -14,10 +14,11 @@ limitations under the License.
|
|||||||
package serve
|
package serve
|
||||||
|
|
||||||
import (
|
import (
|
||||||
k8sgptserver "github.com/k8sgpt-ai/k8sgpt/pkg/server"
|
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
k8sgptserver "github.com/k8sgpt-ai/k8sgpt/pkg/server"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/k8sgpt-ai/k8sgpt/pkg/ai"
|
"github.com/k8sgpt-ai/k8sgpt/pkg/ai"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -108,6 +109,7 @@ var ServeCmd = &cobra.Command{
|
|||||||
baseURL := os.Getenv("K8SGPT_BASEURL")
|
baseURL := os.Getenv("K8SGPT_BASEURL")
|
||||||
engine := os.Getenv("K8SGPT_ENGINE")
|
engine := os.Getenv("K8SGPT_ENGINE")
|
||||||
proxyEndpoint := os.Getenv("K8SGPT_PROXY_ENDPOINT")
|
proxyEndpoint := os.Getenv("K8SGPT_PROXY_ENDPOINT")
|
||||||
|
providerId := os.Getenv("K8SGPT_PROVIDER_ID")
|
||||||
// If the envs are set, allocate in place to the aiProvider
|
// If the envs are set, allocate in place to the aiProvider
|
||||||
// else exit with error
|
// else exit with error
|
||||||
envIsSet := backend != "" || password != "" || model != ""
|
envIsSet := backend != "" || password != "" || model != ""
|
||||||
@ -119,6 +121,7 @@ var ServeCmd = &cobra.Command{
|
|||||||
BaseURL: baseURL,
|
BaseURL: baseURL,
|
||||||
Engine: engine,
|
Engine: engine,
|
||||||
ProxyEndpoint: proxyEndpoint,
|
ProxyEndpoint: proxyEndpoint,
|
||||||
|
ProviderId: providerId,
|
||||||
Temperature: temperature(),
|
Temperature: temperature(),
|
||||||
TopP: topP(),
|
TopP: topP(),
|
||||||
TopK: topK(),
|
TopK: topK(),
|
||||||
|
Loading…
Reference in New Issue
Block a user