From e6d22c691e4c686652bca3156d546c87aa3bebc5 Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:22:54 -0400 Subject: [PATCH 1/2] fix: correct default model env var name Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- opts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opts.go b/opts.go index 03f2cd4..3df9467 100644 --- a/opts.go +++ b/opts.go @@ -18,7 +18,7 @@ func (g GlobalOptions) toEnv() []string { args = append(args, "OPENAI_BASE_URL="+g.OpenAIBaseURL) } if g.DefaultModel != "" { - args = append(args, "GPTSCRIPT_DEFAULT_MODEL="+g.DefaultModel) + args = append(args, "GPTSCRIPT_SDKSERVER_DEFAULT_MODEL="+g.DefaultModel) } return args From b4784e17f9f00382a19ebfcd99f1aebdbd32dd0c Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:39:26 -0400 Subject: [PATCH 2/2] test: change confirm deny assertion to adjust for gptscript changes Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- gptscript_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gptscript_test.go b/gptscript_test.go index 938f5e6..9a667da 100644 --- a/gptscript_test.go +++ b/gptscript_test.go @@ -774,7 +774,7 @@ func TestConfirm(t *testing.T) { func TestConfirmDeny(t *testing.T) { var eventContent string tools := ToolDef{ - Instructions: "List the files in the current directory", + Instructions: "List the files in the current directory as '.'. If that doesn't work print the word FAIL.", Tools: []string{"sys.exec"}, } @@ -828,11 +828,11 @@ func TestConfirmDeny(t *testing.T) { t.Errorf("Error reading output: %v", err) } - if !strings.Contains(strings.ToLower(eventContent), "authorization error") { + if !strings.Contains(strings.ToLower(eventContent), "fail") { t.Errorf("Unexpected event output: %s", eventContent) } - if !strings.Contains(strings.ToLower(out), "authorization error") { + if !strings.Contains(strings.ToLower(out), "fail") { t.Errorf("Unexpected output: %s", out) }