mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
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?
This commit is contained in:
36
src/services/llm/tools/tool_initializer.ts
Normal file
36
src/services/llm/tools/tool_initializer.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 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
|
||||
};
|
||||
Reference in New Issue
Block a user