diff --git a/pkg/tests/runner_test.go b/pkg/tests/runner_test.go index 76c5c5fa..83ad3642 100644 --- a/pkg/tests/runner_test.go +++ b/pkg/tests/runner_test.go @@ -640,6 +640,13 @@ func TestCase(t *testing.T) { assert.Equal(t, "TEST RESULT CALL: 1", x) } +func TestCase2(t *testing.T) { + runner := tester.NewRunner(t) + x, err := runner.Run("", "") + require.NoError(t, err) + assert.Equal(t, "TEST RESULT CALL: 1", x) +} + func TestContextArg(t *testing.T) { runner := tester.NewRunner(t) x, err := runner.Run("", `{ diff --git a/pkg/tests/testdata/TestCase2/call1.golden b/pkg/tests/testdata/TestCase2/call1.golden new file mode 100644 index 00000000..a5eddc59 --- /dev/null +++ b/pkg/tests/testdata/TestCase2/call1.golden @@ -0,0 +1,37 @@ +`{ + "Model": "gpt-4-turbo-preview", + "InternalSystemPrompt": null, + "Tools": [ + { + "function": { + "toolID": "testdata/TestCase2/test.gpt:6", + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "parameters": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + } + } + } + ], + "Messages": [ + { + "role": "system", + "content": [ + { + "text": "Ask Bob how he is doing and let me know exactly what he said." + } + ] + } + ], + "MaxTokens": 0, + "Temperature": null, + "JSONResponse": false, + "Grammar": "", + "Cache": null +}` diff --git a/pkg/tests/testdata/TestCase2/test.gpt b/pkg/tests/testdata/TestCase2/test.gpt new file mode 100644 index 00000000..a18efd18 --- /dev/null +++ b/pkg/tests/testdata/TestCase2/test.gpt @@ -0,0 +1,12 @@ +tools: Bob + +Ask Bob how he is doing and let me know exactly what he said. + +--- +name: bob +description: I'm Bob, a friendly guy. +args: question: The question to ask Bob. + +#!/bin/bash + +echo "Thanks for asking ${question}, I'm doing great fellow friendly AI tool!"