mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-02 05:02:27 +08:00
fix(llm): get rid of a lot of log.info() statements that were spammy
This commit is contained in:
parent
d2ba270fdf
commit
d4d55b20a8
@ -42,7 +42,6 @@ export class AgentToolsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("Initializing agent tools");
|
|
||||||
|
|
||||||
// Initialize the context service first
|
// Initialize the context service first
|
||||||
try {
|
try {
|
||||||
|
@ -559,11 +559,9 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re
|
|||||||
// Get agent tools manager and initialize it
|
// Get agent tools manager and initialize it
|
||||||
const agentTools = aiServiceManager.getAgentTools();
|
const agentTools = aiServiceManager.getAgentTools();
|
||||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||||
log.info('Initializing agent tools to create vectorSearchTool');
|
|
||||||
try {
|
try {
|
||||||
// Force initialization to ensure it runs even if previously marked as initialized
|
// Force initialization to ensure it runs even if previously marked as initialized
|
||||||
await agentTools.initialize(true);
|
await agentTools.initialize(true);
|
||||||
log.info('Agent tools initialized successfully');
|
|
||||||
} catch (initError: unknown) {
|
} catch (initError: unknown) {
|
||||||
const errorMessage = initError instanceof Error ? initError.message : String(initError);
|
const errorMessage = initError instanceof Error ? initError.message : String(initError);
|
||||||
log.error(`Failed to initialize agent tools: ${errorMessage}`);
|
log.error(`Failed to initialize agent tools: ${errorMessage}`);
|
||||||
@ -812,14 +810,11 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re
|
|||||||
const agentTools = aiServiceManager.getAgentTools();
|
const agentTools = aiServiceManager.getAgentTools();
|
||||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||||
await agentTools.initialize(true);
|
await agentTools.initialize(true);
|
||||||
log.info(`Agent tools initialized during preloading`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the vector search tool is available
|
// Check if the vector search tool is available
|
||||||
const vectorSearchTool = aiServiceManager.getVectorSearchTool();
|
const vectorSearchTool = aiServiceManager.getVectorSearchTool();
|
||||||
if (vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function') {
|
if (!(vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function')) {
|
||||||
log.info(`Vector search tool successfully preloaded`);
|
|
||||||
} else {
|
|
||||||
log.error(`Vector search tool not available after initialization`);
|
log.error(`Vector search tool not available after initialization`);
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
@ -63,11 +63,9 @@ async function getOrCreateVectorSearchTool(): Promise<any> {
|
|||||||
// Get agent tools manager and initialize it
|
// Get agent tools manager and initialize it
|
||||||
const agentTools = aiServiceManager.getAgentTools();
|
const agentTools = aiServiceManager.getAgentTools();
|
||||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||||
log.info('Initializing agent tools to create vectorSearchTool');
|
|
||||||
try {
|
try {
|
||||||
// Force initialization to ensure it runs even if previously marked as initialized
|
// Force initialization to ensure it runs even if previously marked as initialized
|
||||||
await agentTools.initialize(true);
|
await agentTools.initialize(true);
|
||||||
log.info('Agent tools initialized successfully');
|
|
||||||
} catch (initError: any) {
|
} catch (initError: any) {
|
||||||
log.error(`Failed to initialize agent tools: ${initError.message}`);
|
log.error(`Failed to initialize agent tools: ${initError.message}`);
|
||||||
return null;
|
return null;
|
||||||
|
@ -13,7 +13,7 @@ import log from '../../log.js';
|
|||||||
export class ToolRegistry {
|
export class ToolRegistry {
|
||||||
private static instance: ToolRegistry;
|
private static instance: ToolRegistry;
|
||||||
private tools: Map<string, ToolHandler> = new Map();
|
private tools: Map<string, ToolHandler> = new Map();
|
||||||
private initializationAttempted: boolean = false;
|
private initializationAttempted = false;
|
||||||
|
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
|
|
||||||
@ -106,7 +106,6 @@ export class ToolRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.tools.set(name, handler);
|
this.tools.set(name, handler);
|
||||||
log.info(`Registered tool: ${name}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user