From 67da30e744b56a748ef74758039f8cf28042e857 Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:39:46 -0400 Subject: [PATCH] enhance: support credential override Enable users to set credential overrides on `Run`. e.g. ```go run, err := g.Run( ctx, "./test.gpt", gptscript.Options{ DisableCache: true, IncludeEvents: true, CredentialOverride: "sys.openai:OPENAI_API_KEY", }, ) ``` ```yaml tools: github.com/gptscript-ai/dalle-image-generation You are an expert in image generation. Please generate a lion standing proudly in the savannah. ``` Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- opts.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/opts.go b/opts.go index 3df9467..0315b2c 100644 --- a/opts.go +++ b/opts.go @@ -28,13 +28,14 @@ func (g GlobalOptions) toEnv() []string { type Options struct { GlobalOptions `json:",inline"` - Confirm bool `json:"confirm"` - Input string `json:"input"` - DisableCache bool `json:"disableCache"` - CacheDir string `json:"cacheDir"` - SubTool string `json:"subTool"` - Workspace string `json:"workspace"` - ChatState string `json:"chatState"` - IncludeEvents bool `json:"includeEvents"` - Prompt bool `json:"prompt"` + Confirm bool `json:"confirm"` + Input string `json:"input"` + DisableCache bool `json:"disableCache"` + CacheDir string `json:"cacheDir"` + SubTool string `json:"subTool"` + Workspace string `json:"workspace"` + ChatState string `json:"chatState"` + IncludeEvents bool `json:"includeEvents"` + Prompt bool `json:"prompt"` + CredentialOverride string `json:"credentialOverride"` }