MCPcopy Create free account
hub / github.com/diillson/chatcli / TestKnowledgeToolDefinition_Schema

Function TestKnowledgeToolDefinition_Schema

cli/chat_knowledge_test.go:54–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestKnowledgeToolDefinition_Schema(t *testing.T) {
55 def := knowledgeToolDefinition()
56 if def.Function.Name != "knowledge" {
57 t.Fatalf("name = %q", def.Function.Name)
58 }
59 b, err := json.Marshal(def.Function.Parameters)
60 if err != nil {
61 t.Fatal(err)
62 }
63 for _, want := range []string{`"cmd"`, `"search"`, `"source"`, `"offset"`} {
64 if !strings.Contains(string(b), want) {
65 t.Errorf("parameters missing %s: %s", want, b)
66 }
67 }
68}
69
70func TestAppendKnowledgeRound(t *testing.T) {
71 hist, prompt := appendKnowledgeRound(

Callers

nothing calls this directly

Calls 2

knowledgeToolDefinitionFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected