From 7373249dee070fe568e6d630ddfeeaebc3173477 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 8 Apr 2025 22:08:52 +0000 Subject: [PATCH] well this works for tool calling the "readNote" func --- .../pipeline/stages/model_selection_stage.ts | 29 ++++++------------- src/services/llm/providers/ollama_service.ts | 18 ++++++++++-- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/services/llm/pipeline/stages/model_selection_stage.ts b/src/services/llm/pipeline/stages/model_selection_stage.ts index 4b6f8e126..2945fec5b 100644 --- a/src/services/llm/pipeline/stages/model_selection_stage.ts +++ b/src/services/llm/pipeline/stages/model_selection_stage.ts @@ -27,17 +27,17 @@ export class ModelSelectionStage extends BasePipelineStage 0) { updatedOptions.tools = toolDefinitions; log.info(`Added ${toolDefinitions.length} tools to options`); @@ -47,7 +47,7 @@ export class ModelSelectionStage extends BasePipelineStage maxChunkSize) { + let i = 0; + while (i < requestStr.length) { + const chunk = requestStr.substring(i, i + maxChunkSize); + log.info(`Request part ${Math.floor(i/maxChunkSize) + 1}/${Math.ceil(requestStr.length/maxChunkSize)}: ${chunk}`); + i += maxChunkSize; + } + } else { + log.info(`Full request: ${requestStr}`); + } + log.info(`========== END FULL OLLAMA REQUEST ==========`); log.info(`========== END OLLAMA REQUEST ==========`); // Make API request