diff --git a/src/gptscript.ts b/src/gptscript.ts index 6ee0e82..ac79975 100644 --- a/src/gptscript.ts +++ b/src/gptscript.ts @@ -680,6 +680,7 @@ export interface ToolDef { credentials?: string[] instructions?: string type?: string + metaData?: Record } export interface ToolReference { @@ -695,7 +696,6 @@ export interface Tool extends ToolDef { id: string type: typeof ToolType toolMapping?: Record - metaData?: Record localTools?: Record source?: SourceRef workingDir?: string diff --git a/tests/gptscript.test.ts b/tests/gptscript.test.ts index f12564d..a9976c7 100644 --- a/tests/gptscript.test.ts +++ b/tests/gptscript.test.ts @@ -361,8 +361,8 @@ describe("gptscript module", () => { const inputs = [ "List the 3 largest of the Great Lakes by volume.", - "What is the volume of the second one in cubic miles?", - "What is the total area of the third one in square miles?" + "What is the volume of the second in the list in cubic miles?", + "What is the total area of the third in the list in square miles?" ] const expectedOutputs = [ @@ -569,4 +569,20 @@ describe("gptscript module", () => { expect(err).toEqual(undefined) expect(out).toEqual("200") }, 20000) + + test("run parsed tool with metadata", async () => { + let err = undefined + let out = "" + let tools = await g.parse(path.join(__dirname, "fixtures", "parse-with-metadata.gpt")) + + let run = await g.evaluate(tools[0]) + + try { + out = await run.text() + } catch (e) { + err = e + } + expect(err).toEqual(undefined) + expect(out).toEqual("200") + }, 20000) }) \ No newline at end of file