feat: forward tool.started/completed events in SSE stream
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 35s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 35s
This commit is contained in:
parent
ff56b79659
commit
fc2725b5df
@ -142,6 +142,12 @@ export class AdminAiChatService {
|
|||||||
// Forward to client
|
// Forward to client
|
||||||
res.write(`data: ${JSON.stringify({ ...event, runId })}\n\n`);
|
res.write(`data: ${JSON.stringify({ ...event, runId })}\n\n`);
|
||||||
|
|
||||||
|
// Forward tool events
|
||||||
|
if (event.event === 'tool.started' || event.event === 'tool.completed') {
|
||||||
|
res.write(`data: ${JSON.stringify({ event: event.event, tool: (event as any).tool, preview: (event as any).preview, duration: (event as any).duration, error: (event as any).error })}
|
||||||
|
|
||||||
|
`);
|
||||||
|
}
|
||||||
if (event.event === 'message.delta' && event.delta) {
|
if (event.event === 'message.delta' && event.delta) {
|
||||||
fullResponse += event.delta;
|
fullResponse += event.delta;
|
||||||
} else if (event.event === 'run.completed') {
|
} else if (event.event === 'run.completed') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user