From e78ac425b63de256819fb40d511ea1a6b628d2d9 Mon Sep 17 00:00:00 2001 From: Taylor Price Date: Fri, 14 Jun 2024 14:11:42 -0700 Subject: [PATCH 1/4] fix: correct path to install script Signed-off-by: Taylor Price --- .github/workflows/dispatch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dispatch.yaml b/.github/workflows/dispatch.yaml index 7f12d49..7045abc 100644 --- a/.github/workflows/dispatch.yaml +++ b/.github/workflows/dispatch.yaml @@ -22,7 +22,7 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Automated GPTScript Version Update - file_pattern: 'package*.json src/install-binary.js' + file_pattern: 'package*.json scripts/install-binary.js' tag-release: needs: update-gptscript-dep runs-on: ubuntu-latest From 5b2714246036751f6e5700291aed047dd84bc0a7 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Mon, 17 Jun 2024 12:30:37 -0400 Subject: [PATCH 2/4] chore: check for duplicate CallFinish events Signed-off-by: Donnie Adams --- tests/gptscript.test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/gptscript.test.ts b/tests/gptscript.test.ts index e061a82..9ff7aff 100644 --- a/tests/gptscript.test.ts +++ b/tests/gptscript.test.ts @@ -1,5 +1,5 @@ import * as gptscript from "../src/gptscript" -import {ArgumentSchemaType, PropertyType, ToolType} from "../src/gptscript" +import {ArgumentSchemaType, PropertyType, RunEventType, ToolType} from "../src/gptscript" import path from "path" import {fileURLToPath} from "url" @@ -66,6 +66,14 @@ describe("gptscript module", () => { for (let output of data.output) out += `system: ${output.content}` }) + let callFinished = false + run.on(gptscript.RunEventType.CallFinish, (data: gptscript.CallFrame) => { + if (data.type == RunEventType.CallFinish) { + expect(callFinished).toBe(false) + callFinished = true + } + }) + await run.text() err = run.err From 36dffe9d56f11853f5bc26afb21b484b8fc0ec08 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Mon, 17 Jun 2024 18:47:31 -0400 Subject: [PATCH 3/4] fix: correctly set parent call from for run Signed-off-by: Donnie Adams --- src/gptscript.ts | 2 +- tests/gptscript.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gptscript.ts b/src/gptscript.ts index 3735f9b..64214da 100644 --- a/src/gptscript.ts +++ b/src/gptscript.ts @@ -569,7 +569,7 @@ export class Run { } } else if ((f.type as string).startsWith("call")) { f = f as CallFrame - if (f.parentID === "" && this.parentCallId === "") { + if (!f.parentID && this.parentCallId === "") { this.parentCallId = f.id } this.calls[f.id] = f diff --git a/tests/gptscript.test.ts b/tests/gptscript.test.ts index 9ff7aff..4a298bf 100644 --- a/tests/gptscript.test.ts +++ b/tests/gptscript.test.ts @@ -79,6 +79,7 @@ describe("gptscript module", () => { expect(out).toContain("Calvin Coolidge") expect(err).toEqual("") + expect(run.parentCallFrame()).toBeTruthy() }) test("evaluate executes a prompt correctly with context", async () => { From 1859b5092b66d806367cc7b6e19bbd442306c9c6 Mon Sep 17 00:00:00 2001 From: Craig Jellick Date: Tue, 18 Jun 2024 17:17:00 -0700 Subject: [PATCH 4/4] chore: bump to v0.8.3 Signed-off-by: Craig Jellick --- package-lock.json | 4 ++-- package.json | 2 +- scripts/install-binary.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5ff7ca6..5ea2a64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gptscript-ai/gptscript", - "version": "v0.8.2", + "version": "v0.8.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gptscript-ai/gptscript", - "version": "v0.8.2", + "version": "v0.8.3", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 210836f..593b53b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gptscript-ai/gptscript", - "version": "v0.8.2", + "version": "v0.8.3", "description": "Run gptscript in node.js", "source": "src/gptscript.ts", "main": "dist/gptscript.js", diff --git a/scripts/install-binary.js b/scripts/install-binary.js index 7c4bbbd..7e09eaa 100644 --- a/scripts/install-binary.js +++ b/scripts/install-binary.js @@ -68,7 +68,7 @@ if (process.platform === 'win32') { const gptscript_info = { name: "gptscript", url: "https://github.com/gptscript-ai/gptscript/releases/download/", - version: "v0.8.2" + version: "v0.8.3" } const pltfm = {