From 13604359cac06db9f4c1885fac773844a737ccf0 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Wed, 26 Jun 2024 12:11:45 -0400 Subject: [PATCH] fix: pass default model configuration to the UI Signed-off-by: Donnie Adams --- pkg/cli/gptscript.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cli/gptscript.go b/pkg/cli/gptscript.go index a8561abf..5a44c5fb 100644 --- a/pkg/cli/gptscript.go +++ b/pkg/cli/gptscript.go @@ -361,6 +361,11 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) { gptOpt.Env = append(gptOpt.Env, system.BinEnvVar+"="+system.Bin()) } + // If the DefaultModel is set, then pass the correct environment variable. + if r.DefaultModel != "" { + gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_DEFAULT_MODEL="+r.DefaultModel) + } + args = append([]string{args[0]}, "--file="+file) if len(args) > 2 {