mirror of https://github.com/buster-so/buster.git
Merge pull request #1225 from buster-so/wells-bus-2004-fix-todos-step-erroring-without-throwing-an-error
Fixing the todo step to throw llm errors if the model throws an error
This commit is contained in:
commit
ec1c90138a
|
@ -102,6 +102,10 @@ async function generateTodosWithLLM(
|
||||||
messages: todosMessages,
|
messages: todosMessages,
|
||||||
temperature: 0,
|
temperature: 0,
|
||||||
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
providerOptions: DEFAULT_ANTHROPIC_OPTIONS,
|
||||||
|
onError: (error) => {
|
||||||
|
console.info('LLM error while generating todos', error);
|
||||||
|
throw new Error('LLM error while generating todos');
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Process text deltas for optimistic updates
|
// Process text deltas for optimistic updates
|
||||||
|
@ -111,11 +115,8 @@ async function generateTodosWithLLM(
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Wait for the final object
|
|
||||||
const result = await object;
|
|
||||||
|
|
||||||
// Ensure all delta processing is complete before finalizing
|
// Ensure all delta processing is complete before finalizing
|
||||||
await deltaProcessing;
|
const [_, result] = await Promise.all([deltaProcessing, object]);
|
||||||
|
|
||||||
// Finalize the reasoning message
|
// Finalize the reasoning message
|
||||||
await onStreamFinish(result);
|
await onStreamFinish(result);
|
||||||
|
|
Loading…
Reference in New Issue