Skip to content

Commit 7d63d01

Browse files
committed
better error message...
1 parent ce95cc7 commit 7d63d01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/taskyon/chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function accumulateChatCompletion(
182182
// Accumulate tool calls
183183
for (const tc of chunk.choices[choiceIdx]?.delta?.tool_calls || []) {
184184
// initialize toolCalls if it doesn't exist
185+
// TODO: prepare openai tool cools
185186
const tcnew = toolCalls[tc.index] || {
186187
id: '',
187188
type: 'function',
@@ -329,7 +330,10 @@ export async function callLLM(
329330
// Call the callback function to process the chunk
330331
contentCallBack(jsonChunk);
331332
} catch (err) {
332-
console.error('Failed to parse chunk:', jsonString, err);
333+
throw {
334+
message: `Failed to parse chunk; ${jsonString}`,
335+
details: { err },
336+
};
333337
}
334338
}
335339
}

0 commit comments

Comments
 (0)