(chunk)
| 52 | } |
| 53 | |
| 54 | const loadingMessageChunk = (chunk) => { |
| 55 | const semanticChunk = streamEventToMessageChunk(chunk?.stream_event) |
| 56 | if (semanticChunk) return semanticChunk |
| 57 | |
| 58 | const msg = chunk?.msg |
| 59 | if (msg?.event) return null |
| 60 | return msg || null |
| 61 | } |
| 62 | |
| 63 | // 工具结果不走 messages 流,而是以 method=tools 的 stream_event 事件返回(tool-started/tool-finished)。 |
| 64 | // 取出 tool-finished 的 output(一条 ToolMessage 字典),交给 msgChunks 与 AI 消息按 tool_call_id 关联。 |
no test coverage detected