File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,7 @@ export interface ToolDef {
680680 credentials ?: string [ ]
681681 instructions ?: string
682682 type ?: string
683+ metaData ?: Record < string , string >
683684}
684685
685686export interface ToolReference {
@@ -695,7 +696,6 @@ export interface Tool extends ToolDef {
695696 id : string
696697 type : typeof ToolType
697698 toolMapping ?: Record < string , ToolReference [ ] >
698- metaData ?: Record < string , string >
699699 localTools ?: Record < string , string >
700700 source ?: SourceRef
701701 workingDir ?: string
Original file line number Diff line number Diff line change @@ -361,8 +361,8 @@ describe("gptscript module", () => {
361361
362362 const inputs = [
363363 "List the 3 largest of the Great Lakes by volume." ,
364- "What is the volume of the second one in cubic miles?" ,
365- "What is the total area of the third one in square miles?"
364+ "What is the volume of the second in the list in cubic miles?" ,
365+ "What is the total area of the third in the list in square miles?"
366366 ]
367367
368368 const expectedOutputs = [
@@ -569,4 +569,20 @@ describe("gptscript module", () => {
569569 expect ( err ) . toEqual ( undefined )
570570 expect ( out ) . toEqual ( "200" )
571571 } , 20000 )
572+
573+ test ( "run parsed tool with metadata" , async ( ) => {
574+ let err = undefined
575+ let out = ""
576+ let tools = await g . parse ( path . join ( __dirname , "fixtures" , "parse-with-metadata.gpt" ) )
577+
578+ let run = await g . evaluate ( tools [ 0 ] )
579+
580+ try {
581+ out = await run . text ( )
582+ } catch ( e ) {
583+ err = e
584+ }
585+ expect ( err ) . toEqual ( undefined )
586+ expect ( out ) . toEqual ( "200" )
587+ } , 20000 )
572588} )
You can’t perform that action at this time.
0 commit comments