clean up hardcoded values part 4

This commit is contained in:
perf3ct 2025-04-15 17:53:05 +00:00
parent 284ba096d0
commit 67a45333b3
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
3 changed files with 11 additions and 7 deletions

View File

@ -15,6 +15,7 @@ import { CONTEXT_PROMPTS } from '../../constants/llm_prompt_constants.js';
import { QUERY_DECOMPOSITION_STRINGS } from '../../constants/query_decomposition_constants.js'; import { QUERY_DECOMPOSITION_STRINGS } from '../../constants/query_decomposition_constants.js';
import JsonExtractor from '../../utils/json_extractor.js'; import JsonExtractor from '../../utils/json_extractor.js';
import type { LLMServiceInterface } from '../../interfaces/agent_tool_interfaces.js'; import type { LLMServiceInterface } from '../../interfaces/agent_tool_interfaces.js';
import { SEARCH_CONSTANTS } from '../../constants/search_constants.js';
// Interfaces // Interfaces
export interface SubQuery { export interface SubQuery {
@ -72,8 +73,8 @@ Format your answer as a valid JSON array without markdown code blocks, like this
]; ];
const options = { const options = {
temperature: 0.3, temperature: SEARCH_CONSTANTS.TEMPERATURE.QUERY_PROCESSOR,
maxTokens: 300, maxTokens: SEARCH_CONSTANTS.LIMITS.QUERY_PROCESSOR_MAX_TOKENS,
bypassFormatter: true, bypassFormatter: true,
expectsJsonResponse: true, expectsJsonResponse: true,
_bypassContextProcessing: true // Prevent recursive calls _bypassContextProcessing: true // Prevent recursive calls

View File

@ -15,6 +15,8 @@ import becca from '../../../becca/becca.js';
import log from '../../log.js'; import log from '../../log.js';
import type BNote from '../../../becca/entities/bnote.js'; import type BNote from '../../../becca/entities/bnote.js';
import type BAttribute from '../../../becca/entities/battribute.js'; import type BAttribute from '../../../becca/entities/battribute.js';
import sql from "../../sql.js";
import { SEARCH_CONSTANTS } from "../constants/search_constants.js";
export interface NoteInfo { export interface NoteInfo {
noteId: string; noteId: string;
@ -51,9 +53,9 @@ interface NoteStructure {
} }
export class NoteNavigatorTool { export class NoteNavigatorTool {
private maxPathLength: number = 20; private maxPathLength: number = SEARCH_CONSTANTS.HIERARCHY.MAX_PATH_LENGTH;
private maxBreadth: number = 100; private maxBreadth: number = SEARCH_CONSTANTS.HIERARCHY.MAX_BREADTH;
private maxDepth: number = 5; private maxDepth: number = SEARCH_CONSTANTS.HIERARCHY.MAX_DEPTH;
/** /**
* Get detailed information about a note * Get detailed information about a note

View File

@ -9,6 +9,7 @@ import log from '../../log.js';
import becca from '../../../becca/becca.js'; import becca from '../../../becca/becca.js';
import attributes from '../../attributes.js'; import attributes from '../../attributes.js';
import aiServiceManager from '../ai_service_manager.js'; import aiServiceManager from '../ai_service_manager.js';
import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
/** /**
* Definition of the relationship tool * Definition of the relationship tool
@ -347,8 +348,8 @@ Suggest the most appropriate relationship type that would connect the source not
}, },
{ role: 'user', content: prompt } { role: 'user', content: prompt }
], { ], {
temperature: 0.4, temperature: SEARCH_CONSTANTS.TEMPERATURE.RELATIONSHIP_TOOL,
maxTokens: 50 maxTokens: SEARCH_CONSTANTS.LIMITS.RELATIONSHIP_TOOL_MAX_TOKENS
}); });
// Extract just the relation name (remove any formatting or explanation) // Extract just the relation name (remove any formatting or explanation)