mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00

getting closer to calling tools... we definitely need this closer to tool execution... agentic tool calling is...kind of working?
37 lines
1.0 KiB
TypeScript
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
|
|
};
|