File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,7 @@ export interface ToolDef {
680
680
credentials ?: string [ ]
681
681
instructions ?: string
682
682
type ?: string
683
+ metaData ?: Record < string , string >
683
684
}
684
685
685
686
export interface ToolReference {
@@ -695,7 +696,6 @@ export interface Tool extends ToolDef {
695
696
id : string
696
697
type : typeof ToolType
697
698
toolMapping ?: Record < string , ToolReference [ ] >
698
- metaData ?: Record < string , string >
699
699
localTools ?: Record < string , string >
700
700
source ?: SourceRef
701
701
workingDir ?: string
Original file line number Diff line number Diff line change @@ -361,8 +361,8 @@ describe("gptscript module", () => {
361
361
362
362
const inputs = [
363
363
"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?"
366
366
]
367
367
368
368
const expectedOutputs = [
@@ -569,4 +569,20 @@ describe("gptscript module", () => {
569
569
expect ( err ) . toEqual ( undefined )
570
570
expect ( out ) . toEqual ( "200" )
571
571
} , 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 )
572
588
} )
You can’t perform that action at this time.
0 commit comments