Emit LLM stream lifecycle events (#26971)

This commit is contained in:
Kit Langton
2026-05-11 21:31:48 -04:00
committed by GitHub
parent e5aa5161f2
commit 8030a6c187
14 changed files with 560 additions and 196 deletions

View File

@@ -154,8 +154,8 @@ const accumulate = (state: StepState, event: LLMEvent) => {
)
return
}
if (event.type === "request-finish") {
state.finishReason = event.reason
if (event.type === "step-finish" || event.type === "request-finish") {
state.finishReason = event.reason === "stop" && state.toolCalls.length > 0 ? "tool-calls" : event.reason
}
}