mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +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 {
|
||||
log.info("Initializing agent tools");
|
||||
|
||||
// Initialize the context service first
|
||||
try {
|
||||
|
@ -559,11 +559,9 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re
|
||||
// Get agent tools manager and initialize it
|
||||
const agentTools = aiServiceManager.getAgentTools();
|
||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||
log.info('Initializing agent tools to create vectorSearchTool');
|
||||
try {
|
||||
// Force initialization to ensure it runs even if previously marked as initialized
|
||||
await agentTools.initialize(true);
|
||||
log.info('Agent tools initialized successfully');
|
||||
} catch (initError: unknown) {
|
||||
const errorMessage = initError instanceof Error ? initError.message : String(initError);
|
||||
log.error(`Failed to initialize agent tools: ${errorMessage}`);
|
||||
@ -812,14 +810,11 @@ export class ToolCallingStage extends BasePipelineStage<ToolExecutionInput, { re
|
||||
const agentTools = aiServiceManager.getAgentTools();
|
||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||
await agentTools.initialize(true);
|
||||
log.info(`Agent tools initialized during preloading`);
|
||||
}
|
||||
|
||||
// Check if the vector search tool is available
|
||||
const vectorSearchTool = aiServiceManager.getVectorSearchTool();
|
||||
if (vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function') {
|
||||
log.info(`Vector search tool successfully preloaded`);
|
||||
} else {
|
||||
if (!(vectorSearchTool && typeof vectorSearchTool.searchNotes === 'function')) {
|
||||
log.error(`Vector search tool not available after initialization`);
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
|
@ -63,11 +63,9 @@ async function getOrCreateVectorSearchTool(): Promise<any> {
|
||||
// Get agent tools manager and initialize it
|
||||
const agentTools = aiServiceManager.getAgentTools();
|
||||
if (agentTools && typeof agentTools.initialize === 'function') {
|
||||
log.info('Initializing agent tools to create vectorSearchTool');
|
||||
try {
|
||||
// Force initialization to ensure it runs even if previously marked as initialized
|
||||
await agentTools.initialize(true);
|
||||
log.info('Agent tools initialized successfully');
|
||||
} catch (initError: any) {
|
||||
log.error(`Failed to initialize agent tools: ${initError.message}`);
|
||||
return null;
|
||||
@ -143,7 +141,7 @@ export class SearchNotesTool implements ToolHandler {
|
||||
temperature: 0.3,
|
||||
maxTokens: 200,
|
||||
// Type assertion to bypass type checking for special internal parameters
|
||||
...(({
|
||||
...(({
|
||||
bypassFormatter: true,
|
||||
bypassContextProcessing: true
|
||||
} as Record<string, boolean>))
|
||||
|
@ -13,7 +13,7 @@ import log from '../../log.js';
|
||||
export class ToolRegistry {
|
||||
private static instance: ToolRegistry;
|
||||
private tools: Map<string, ToolHandler> = new Map();
|
||||
private initializationAttempted: boolean = false;
|
||||
private initializationAttempted = false;
|
||||
|
||||
private constructor() {}
|
||||
|
||||
@ -106,7 +106,6 @@ export class ToolRegistry {
|
||||
}
|
||||
|
||||
this.tools.set(name, handler);
|
||||
log.info(`Registered tool: ${name}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user