Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix the note_creation tool
perf3ct7c97493b5c47
diff --git a/src/services/llm/tools/note_creation_tool.ts b/src/services/llm/tools/note_creation_tool.tsindex 58cd34dc49..d5f84df708 100644--- a/src/services/llm/tools/note_creation_tool.ts+++ b/src/services/llm/tools/note_creation_tool.ts@@ -44,7 +44,21 @@ export const noteCreationToolDefinition: Tool = {},attributes: {type: 'array',- description: 'Array of attributes to set on the note (e.g., [{"name":"#tag"}, {"name":"priority", "value":"high"}])'+ description: 'Array of attributes to set on the note (e.g., [{"name":"#tag"}, {"name":"priority", "value":"high"}])',+ items: {+ type: 'object',+ properties: {+ name: {+ type: 'string',+ description: 'Name of the attribute'+ },+ value: {+ type: 'string',+ description: 'Value of the attribute (optional)'+ }+ },+ required: ['name']+ }}},required: ['title', 'content']diff --git a/src/services/llm/tools/tool_interfaces.ts b/src/services/llm/tools/tool_interfaces.tsindex 37be43786e..9cff91f466 100644--- a/src/services/llm/tools/tool_interfaces.ts+++ b/src/services/llm/tools/tool_interfaces.ts@@ -1,6 +1,6 @@/*** Tool Interfaces- *+ ** This file defines the interfaces for the LLM tool calling system.*/@@ -27,6 +27,11 @@ export interface ToolParameter {type: string;description: string;enum?: string[];+ items?: ToolParameter | {+ type: string;+ properties?: Record<string, ToolParameter>;+ required?: string[];+ };}/**@@ -49,7 +54,7 @@ export interface ToolHandler {* Tool definition to be sent to the LLM*/definition: Tool;-+/*** Execute the tool with the given arguments*/