feat(core): add a observe phase in a step; improve abortSignal

This commit is contained in:
Simon
2026-02-10 22:20:42 +08:00
parent c71ffcec1c
commit 1fcf931685
2 changed files with 35 additions and 18 deletions

View File

@@ -49,6 +49,9 @@ export class LLM extends EventTarget {
): Promise<InvokeResult> {
return await withRetry(
async () => {
// in case user aborted before invoking
if (abortSignal.aborted) throw new Error('AbortError')
const result = await this.client.invoke(messages, tools, abortSignal, options)
return result