X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/4a605fa39078354654ae648e489c117c7a445197..6e3e9c5c10f3d35bae7e9846334974a09418aef7:/prompt_test.go diff --git a/prompt_test.go b/prompt_test.go index 4c88ad8..5b10597 100644 --- a/prompt_test.go +++ b/prompt_test.go @@ -16,6 +16,7 @@ func TestPromptNamesTheAgent(t *testing.T) { require.Contains(t, text, "- reply: Ada's replies") require.Contains(t, text, "Goal: let Ada work later") require.Contains(t, text, `- work: an agent's report, starting "[Name]"`) + require.Contains(t, text, "- zoom(id, 1) gives message id whole\n- zoom(\"Name\") gives an agent's whole chat\n") require.NotContains(t, text, promptName) // The old agent name is built from parts, so the source does not spell @@ -25,7 +26,7 @@ func TestPromptNamesTheAgent(t *testing.T) { func TestPromptLeavesOutAbsentFeatures(t *testing.T) { text := prompt("Ada", "") - for _, absent := range []string{"image", "ubagent", "computer", "device", `zoom("Name")`, "instructions at the end"} { + for _, absent := range []string{"image", "ubagent", "computer", "device", "instructions at the end"} { require.NotContains(t, text, absent) } } @@ -47,8 +48,13 @@ func TestPromptWithoutInstructionsHasNoClause(t *testing.T) { } func TestAgentToolsAreStrictAndStable(t *testing.T) { - tools := agentTools() - require.Equal(t, []string{"zoom", "date"}, []string{tools[0].Name, tools[1].Name}) + tools := promptTools() + names := make([]string, len(tools)) + for n, tool := range tools { + names[n] = tool.Name + } + + require.Equal(t, []string{"zoom", "date", "shell", "read", "write", "edit"}, names) for _, tool := range tools { schema := tool.Parameters.(map[string]any) @@ -62,7 +68,7 @@ func TestAgentToolsAreStrictAndStable(t *testing.T) { require.NoError(t, err) for range 10 { - again, err := json.Marshal(agentTools()) + again, err := json.Marshal(promptTools()) require.NoError(t, err) require.Equal(t, first, again) }