From f8a486dda15b91c00c4ce70407cc22435b5220bf Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:01:23 -0400 Subject: [PATCH] fix: use array and new pluralized name for credential overrides Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- gptscript/opts.py | 4 ++-- tests/test_gptscript.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gptscript/opts.py b/gptscript/opts.py index 71b7831..932af4c 100644 --- a/gptscript/opts.py +++ b/gptscript/opts.py @@ -30,7 +30,7 @@ def __init__(self, chatState: str = "", confirm: bool = False, prompt: bool = False, - credentialOverride: str = "", + credentialOverrides: list[str] = None, env: list[str] = None, apiKey: str = "", baseURL: str = "", @@ -44,5 +44,5 @@ def __init__(self, self.chatState = chatState self.confirm = confirm self.prompt = prompt - self.credentialOverride = credentialOverride + self.credentialOverrides = credentialOverrides self.env = env diff --git a/tests/test_gptscript.py b/tests/test_gptscript.py index 1469d49..c12f719 100644 --- a/tests/test_gptscript.py +++ b/tests/test_gptscript.py @@ -186,10 +186,10 @@ async def collect_events(run: Run, e: CallFrame | RunFrame | PromptFrame): @pytest.mark.asyncio async def test_credential_override(gptscript): run = gptscript.run( - "./tests/fixtures/credential-override.gpt", + os.getcwd() + "/tests/fixtures/credential-override.gpt", Options( disableCache=True, - credentialOverride='test.ts.credential_override:TEST_CRED=foo' + credentialOverrides=['test.ts.credential_override:TEST_CRED=foo'] ), ) assert "foo" in await run.text(), "Expect credential override to have correct output"