diff --git a/main.js b/main.js index 33fc725..3f6b802 100644 --- a/main.js +++ b/main.js @@ -9337,7 +9337,6 @@ ${userMessage}` : userMessage; const stream = this.ollamaClient.streamChat(completeMessages, tools); let fullResponse = ""; let toolCalls = []; - let chunkCount = 0; for await (const chunk of stream) { if (chunk.content) { fullResponse += chunk.content; @@ -9350,10 +9349,6 @@ ${userMessage}` : userMessage; if (chunk.tool_calls) { toolCalls = [...toolCalls, ...chunk.tool_calls]; } - chunkCount++; - if (chunkCount > MAX_STREAM_CHUNKS) { - break; - } } if (toolCalls.length > 0) { await this.processToolCalls( @@ -9391,7 +9386,6 @@ ${userMessage}` : userMessage; } } }; -var MAX_STREAM_CHUNKS = 1e3; var MAX_TOOL_CALLS = 5; // src/constants.ts diff --git a/src/chat-view.ts b/src/chat-view.ts index 7a2f14f..4bbff71 100755 --- a/src/chat-view.ts +++ b/src/chat-view.ts @@ -487,7 +487,6 @@ export class ChatView extends ItemView { let fullResponse = ''; let toolCalls: OllamaToolCall[] = []; - let chunkCount = 0; for await (const chunk of stream) { if (chunk.content) { @@ -502,11 +501,6 @@ export class ChatView extends ItemView { if (chunk.tool_calls) { toolCalls = [...toolCalls, ...chunk.tool_calls]; } - - chunkCount++; - if (chunkCount > MAX_STREAM_CHUNKS) { - break; - } } // Process tool calls if any @@ -575,5 +569,4 @@ export class ChatView extends ItemView { private conversationStateManager: ConversationStateManager; } -const MAX_STREAM_CHUNKS = 1000; const MAX_TOOL_CALLS = 5;