@@ -81,7 +81,7 @@ func TestListModels(t *testing.T) {
8181}
8282
8383func TestAbortRun (t * testing.T ) {
84- tool := & ToolDef {Instructions : "What is the capital of the united states?" }
84+ tool := ToolDef {Instructions : "What is the capital of the united states?" }
8585
8686 run , err := g .Evaluate (context .Background (), Options {DisableCache : true , IncludeEvents : true }, tool )
8787 if err != nil {
@@ -105,7 +105,7 @@ func TestAbortRun(t *testing.T) {
105105}
106106
107107func TestSimpleEvaluate (t * testing.T ) {
108- tool := & ToolDef {Instructions : "What is the capital of the united states?" }
108+ tool := ToolDef {Instructions : "What is the capital of the united states?" }
109109
110110 run , err := g .Evaluate (context .Background (), Options {}, tool )
111111 if err != nil {
@@ -142,7 +142,7 @@ func TestEvaluateWithContext(t *testing.T) {
142142 t .Fatalf ("Error getting current working directory: %v" , err )
143143 }
144144
145- tool := & ToolDef {
145+ tool := ToolDef {
146146 Instructions : "What is the capital of the united states?" ,
147147 Context : []string {
148148 wd + "/test/acorn-labs-context.gpt" ,
@@ -165,7 +165,7 @@ func TestEvaluateWithContext(t *testing.T) {
165165}
166166
167167func TestEvaluateComplexTool (t * testing.T ) {
168- tool := & ToolDef {
168+ tool := ToolDef {
169169 JSONResponse : true ,
170170 Instructions : `
171171Create three short graphic artist descriptions and their muses.
@@ -202,18 +202,16 @@ func TestEvaluateWithToolList(t *testing.T) {
202202 if runtime .GOOS == "windows" {
203203 shebang = "#!/usr/bin/env powershell.exe"
204204 }
205- tools := []fmt. Stringer {
206- & ToolDef {
205+ tools := []ToolDef {
206+ {
207207 Tools : []string {"echo" },
208208 Instructions : "echo hello there" ,
209209 },
210- & ToolDef {
211- Name : "echo" ,
212- Tools : []string {"sys.exec" },
213- Description : "Echoes the input" ,
214- Args : map [string ]string {
215- "input" : "The string input to echo" ,
216- },
210+ {
211+ Name : "echo" ,
212+ Tools : []string {"sys.exec" },
213+ Description : "Echoes the input" ,
214+ Arguments : ObjectSchema ("input" , "The string input to echo" ),
217215 Instructions : shebang + "\n echo ${input}" ,
218216 },
219217 }
@@ -238,23 +236,21 @@ func TestEvaluateWithToolListAndSubTool(t *testing.T) {
238236 if runtime .GOOS == "windows" {
239237 shebang = "#!/usr/bin/env powershell.exe"
240238 }
241- tools := []fmt. Stringer {
242- & ToolDef {
239+ tools := []ToolDef {
240+ {
243241 Tools : []string {"echo" },
244242 Instructions : "echo 'hello there'" ,
245243 },
246- & ToolDef {
244+ {
247245 Name : "other" ,
248246 Tools : []string {"echo" },
249247 Instructions : "echo 'hello somewhere else'" ,
250248 },
251- & ToolDef {
252- Name : "echo" ,
253- Tools : []string {"sys.exec" },
254- Description : "Echoes the input" ,
255- Args : map [string ]string {
256- "input" : "The string input to echo" ,
257- },
249+ {
250+ Name : "echo" ,
251+ Tools : []string {"sys.exec" },
252+ Description : "Echoes the input" ,
253+ Arguments : ObjectSchema ("input" , "The string input to echo" ),
258254 Instructions : shebang + "\n echo ${input}" ,
259255 },
260256 }
@@ -276,7 +272,7 @@ func TestEvaluateWithToolListAndSubTool(t *testing.T) {
276272
277273func TestStreamEvaluate (t * testing.T ) {
278274 var eventContent string
279- tool := & ToolDef {Instructions : "What is the capital of the united states?" }
275+ tool := ToolDef {Instructions : "What is the capital of the united states?" }
280276
281277 run , err := g .Evaluate (context .Background (), Options {IncludeEvents : true }, tool )
282278 if err != nil {
@@ -536,7 +532,7 @@ echo hello there
536532}
537533
538534func TestToolChat (t * testing.T ) {
539- tool := & ToolDef {
535+ tool := ToolDef {
540536 Chat : true ,
541537 Instructions : "You are a chat bot. Don't finish the conversation until I say 'bye'." ,
542538 Tools : []string {"sys.chat.finish" },
@@ -688,8 +684,8 @@ func TestToolWithGlobalTools(t *testing.T) {
688684
689685func TestConfirm (t * testing.T ) {
690686 var eventContent string
691- tools := []fmt. Stringer {
692- & ToolDef {
687+ tools := []ToolDef {
688+ {
693689 Instructions : "List the files in the current directory" ,
694690 Tools : []string {"sys.exec" },
695691 },
@@ -759,8 +755,8 @@ func TestConfirm(t *testing.T) {
759755
760756func TestConfirmDeny (t * testing.T ) {
761757 var eventContent string
762- tools := []fmt. Stringer {
763- & ToolDef {
758+ tools := []ToolDef {
759+ {
764760 Instructions : "List the files in the current directory" ,
765761 Tools : []string {"sys.exec" },
766762 },
@@ -831,8 +827,8 @@ func TestConfirmDeny(t *testing.T) {
831827
832828func TestPrompt (t * testing.T ) {
833829 var eventContent string
834- tools := []fmt. Stringer {
835- & ToolDef {
830+ tools := []ToolDef {
831+ {
836832 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." ,
837833 Tools : []string {"sys.prompt" },
838834 },
@@ -914,8 +910,8 @@ func TestPrompt(t *testing.T) {
914910}
915911
916912func TestPromptWithoutPromptAllowed (t * testing.T ) {
917- tools := []fmt. Stringer {
918- & ToolDef {
913+ tools := []ToolDef {
914+ {
919915 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." ,
920916 Tools : []string {"sys.prompt" },
921917 },
0 commit comments