trilium/src/services/llm/tools/tool_initializer.ts
perf3ct 26b1b08129
tool calling is close to working
getting closer to calling tools...

we definitely need this

closer to tool execution...

agentic tool calling is...kind of working?
2025-04-08 19:15:01 +00:00

37 lines
1.0 KiB
TypeScript

/**
* Tool Initializer
*
* This module initializes all available tools for the LLM to use.
*/
import toolRegistry from './tool_registry.js';
import { SearchNotesTool } from './search_notes_tool.js';
import { ReadNoteTool } from './read_note_tool.js';
import log from '../../log.js';
/**
* Initialize all tools for the LLM
*/
export async function initializeTools(): Promise<void> {
try {
log.info('Initializing LLM tools...');
// Register basic notes tools
toolRegistry.registerTool(new SearchNotesTool());
toolRegistry.registerTool(new ReadNoteTool());
// More tools can be registered here
// Log registered tools
const toolCount = toolRegistry.getAllTools().length;
log.info(`Successfully registered ${toolCount} LLM tools`);
} catch (error: any) {
log.error(`Error initializing LLM tools: ${error.message || String(error)}`);
// Don't throw, just log the error to prevent breaking the pipeline
}
}
export default {
initializeTools
};