@@ -151,7 +151,7 @@ func TestEvaluateWithContext(t *testing.T) {
151
151
},
152
152
}
153
153
154
- run , err := g .Evaluate (context .Background (), Options {DisableCache : true , IncludeEvents : true }, tool )
154
+ run , err := g .Evaluate (context .Background (), Options {}, tool )
155
155
if err != nil {
156
156
t .Errorf ("Error executing tool: %v" , err )
157
157
}
@@ -214,7 +214,7 @@ func TestEvaluateWithToolList(t *testing.T) {
214
214
Tools : []string {"sys.exec" },
215
215
Description : "Echoes the input" ,
216
216
Arguments : ObjectSchema ("input" , "The string input to echo" ),
217
- Instructions : shebang + "\n echo ${input}" ,
217
+ Instructions : shebang + "\n echo ${input}" ,
218
218
},
219
219
}
220
220
@@ -410,9 +410,12 @@ func TestParseToolWithTextNode(t *testing.T) {
410
410
t .Fatalf ("No text node found" )
411
411
}
412
412
413
- if tools [1 ].TextNode .Text != "!markdown \n hello \n " {
413
+ if tools [1 ].TextNode .Text != "hello \n " {
414
414
t .Errorf ("Unexpected text: %s" , tools [1 ].TextNode .Text )
415
415
}
416
+ if tools [1 ].TextNode .Fmt != "markdown" {
417
+ t .Errorf ("Unexpected fmt: %s" , tools [1 ].TextNode .Fmt )
418
+ }
416
419
}
417
420
418
421
func TestFmt (t * testing.T ) {
@@ -484,7 +487,8 @@ func TestFmtWithTextNode(t *testing.T) {
484
487
},
485
488
{
486
489
TextNode : & TextNode {
487
- Text : "!markdown\n We now echo hello there\n " ,
490
+ Fmt : "markdown" ,
491
+ Text : "We now echo hello there\n " ,
488
492
},
489
493
},
490
494
{
@@ -686,14 +690,12 @@ func TestToolWithGlobalTools(t *testing.T) {
686
690
687
691
func TestConfirm (t * testing.T ) {
688
692
var eventContent string
689
- tools := []ToolDef {
690
- {
691
- Instructions : "List the files in the current directory" ,
692
- Tools : []string {"sys.exec" },
693
- },
693
+ tools := ToolDef {
694
+ Instructions : "List the files in the current directory" ,
695
+ Tools : []string {"sys.exec" },
694
696
}
695
697
696
- run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Confirm : true }, tools ... )
698
+ run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Confirm : true }, tools )
697
699
if err != nil {
698
700
t .Errorf ("Error executing tool: %v" , err )
699
701
}
@@ -771,14 +773,12 @@ func TestConfirm(t *testing.T) {
771
773
772
774
func TestConfirmDeny (t * testing.T ) {
773
775
var eventContent string
774
- tools := []ToolDef {
775
- {
776
- Instructions : "List the files in the current directory" ,
777
- Tools : []string {"sys.exec" },
778
- },
776
+ tools := ToolDef {
777
+ Instructions : "List the files in the current directory" ,
778
+ Tools : []string {"sys.exec" },
779
779
}
780
780
781
- run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Confirm : true }, tools ... )
781
+ run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Confirm : true }, tools )
782
782
if err != nil {
783
783
t .Errorf ("Error executing tool: %v" , err )
784
784
}
@@ -843,14 +843,12 @@ func TestConfirmDeny(t *testing.T) {
843
843
844
844
func TestPrompt (t * testing.T ) {
845
845
var eventContent string
846
- tools := []ToolDef {
847
- {
848
- Instructions : "Use the sys.prompt user to ask the user for 'first name' which is not sensitive. After you get their first name, say hello." ,
849
- Tools : []string {"sys.prompt" },
850
- },
846
+ tools := ToolDef {
847
+ Instructions : "Use the sys.prompt user to ask the user for 'first name' which is not sensitive. After you get their first name, say hello." ,
848
+ Tools : []string {"sys.prompt" },
851
849
}
852
850
853
- run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Prompt : true }, tools ... )
851
+ run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true , Prompt : true }, tools )
854
852
if err != nil {
855
853
t .Errorf ("Error executing tool: %v" , err )
856
854
}
@@ -926,14 +924,12 @@ func TestPrompt(t *testing.T) {
926
924
}
927
925
928
926
func TestPromptWithoutPromptAllowed (t * testing.T ) {
929
- tools := []ToolDef {
930
- {
931
- Instructions : "Use the sys.prompt user to ask the user for 'first name' which is not sensitive. After you get their first name, say hello." ,
932
- Tools : []string {"sys.prompt" },
933
- },
927
+ tools := ToolDef {
928
+ Instructions : "Use the sys.prompt user to ask the user for 'first name' which is not sensitive. After you get their first name, say hello." ,
929
+ Tools : []string {"sys.prompt" },
934
930
}
935
931
936
- run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true }, tools ... )
932
+ run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true }, tools )
937
933
if err != nil {
938
934
t .Errorf ("Error executing tool: %v" , err )
939
935
}
0 commit comments