Skip to content

Commit 4345db0

Browse files
committed
enhance: support credential override
Enable users to set credential overrides on `run`. ```python gptscript = GPTScript() run = gptscript.run('./test.gpt', opts=Options(credentialOverride='sys.openai:OPENAI_API_KEY') output = await run.text() print(output) gptscript.close() ``` ```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 <[email protected]>
1 parent 09dec27 commit 4345db0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gptscript/opts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def __init__(self,
3030
chatState: str = "",
3131
confirm: bool = False,
3232
prompt: bool = False,
33+
credentialOverride: str = "",
3334
env: list[str] = None,
3435
apiKey: str = "",
3536
baseURL: str = "",
@@ -43,4 +44,5 @@ def __init__(self,
4344
self.chatState = chatState
4445
self.confirm = confirm
4546
self.prompt = prompt
47+
self.credentialOverride = credentialOverride
4648
self.env = env

0 commit comments

Comments
 (0)