Skip to content

Commit

Permalink
Merge pull request #604 from njhale/enhance/ui-cred-override
Browse files Browse the repository at this point in the history
enhance: set sdk cred override env var for ui
  • Loading branch information
njhale authored Jul 2, 2024
2 parents 5173357 + 966b493 commit a0013e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cli/gptscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,13 @@ 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.
// Pass the corrected environment variables for SDK server options
if r.DefaultModel != "" {
gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_DEFAULT_MODEL="+r.DefaultModel)
}
if len(r.CredentialOverride) > 0 {
gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_CREDENTIAL_OVERRIDE="+strings.Join(r.CredentialOverride, ","))
}

args = append([]string{args[0]}, "--file="+file)

Expand Down

0 comments on commit a0013e4

Please sign in to comment.