feat(voice): stream tool call status events#6100
Conversation
|
We will need to bump python-sdks/livekit-protocol as well |
| await ctx.update( | ||
| "Thanks for providing your email address, we are confirming the booking now." | ||
| ) |
There was a problem hiding this comment.
🟡 ctx.update() with email-specific message runs unconditionally, even when email was already known
The new await ctx.update("Thanks for providing your email address, we are confirming the booking now.") at line 124 is placed outside the if self._user_email is None: block (line 115). On a second flight booking, the email collection is skipped (email already cached in self._user_email), but this update still fires, telling the LLM "Thanks for providing your email address" when no email was just provided. The LLM would then relay a misleading message to the user about an email they didn't just give.
Prompt for agents
The ctx.update() call at line 124-126 is at the same indentation level as the `if self._user_email is None:` block, so it always executes. It should either be indented one level deeper (inside the if block, after line 123) so the "Thanks for providing your email address" message is only sent when the email was actually just collected, or the message should be changed to something appropriate for both cases (e.g. "Confirming the booking now.").
Was this helpful? React with 👍 or 👎 to provide feedback.
Adds a
tool_status_updatedsession event that streams the lifecycle of each function tool call, so frontends and remote sessions can render tool progress (especially for async/long-running tools that usectx.update()).The event (
ToolStatusUpdatedEvent) carries one of three updates:ToolCallStarted— a tool call was dispatched.ToolCallUpdated— a progress update (running) fromctx.update(), or the call's single terminal entry (done/error/cancelled).ToolReplyUpdated— the deferred reply that voices buffered updates (scheduledthencompleted/interrupted/skipped).SessionHostforwards the event to remote sessions over the newAgentSessionEvent.ToolStatusUpdatedproto (livekit/protocol#1625), and the new types are exported fromlivekit.agents. Theasync_tool_agentexample shows publishing the stream to a frontend.Depends on livekit/protocol#1625 and livekit/python-sdks#716 for the generated bindings.