knowledgeToolDefinition is the native tool-use definition offered in the chat decision turn. The parameters mirror the @knowledge JSON envelope, so the call arguments feed the plugin executor unchanged.
()
| 63 | // chat decision turn. The parameters mirror the @knowledge JSON envelope, so |
| 64 | // the call arguments feed the plugin executor unchanged. |
| 65 | func knowledgeToolDefinition() models.ToolDefinition { |
| 66 | return models.ToolDefinition{ |
| 67 | Type: "function", |
| 68 | Function: models.ToolFunctionDef{ |
| 69 | Name: "knowledge", |
| 70 | Description: "Query the knowledge bases attached to this session (read-only). " + |
| 71 | "Use when the auto-retrieved passages are not enough to answer: search finds ranked passages, " + |
| 72 | "get reads a full document page by page, toc lists what the corpus covers.", |
| 73 | Parameters: map[string]interface{}{ |
| 74 | "type": "object", |
| 75 | "properties": map[string]interface{}{ |
| 76 | "cmd": map[string]interface{}{ |
| 77 | "type": "string", |
| 78 | "enum": []string{"search", "get", "toc", "list"}, |
| 79 | }, |
| 80 | "args": map[string]interface{}{ |
| 81 | "type": "object", |
| 82 | "properties": map[string]interface{}{ |
| 83 | "query": map[string]interface{}{"type": "string", "description": "search: what to look for"}, |
| 84 | "top_k": map[string]interface{}{"type": "number", "description": "search: passages to return (default 8)"}, |
| 85 | "source": map[string]interface{}{"type": "string", "description": "get: document path as cited by search/toc"}, |
| 86 | "offset": map[string]interface{}{"type": "number", "description": "get: continuation offset from a previous page"}, |
| 87 | "prefix": map[string]interface{}{"type": "string", "description": "toc: path prefix filter"}, |
| 88 | "kb": map[string]interface{}{"type": "string", "description": "restrict to one knowledge base by name"}, |
| 89 | }, |
| 90 | }, |
| 91 | }, |
| 92 | "required": []string{"cmd"}, |
| 93 | }, |
| 94 | }, |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | // isKnowledgeToolName matches the tool name in plugin (@knowledge) or native |
| 99 | // (knowledge) form, case-insensitively. |
no outgoing calls