Skip to content

Session agent_end callback receives empty 'output' for Realtime turns before a tool call #551

@josephtannenbaum

Description

@josephtannenbaum
  • Have you read the docs? Agents SDK docs
  • Have you searched for related issues? Others may have faced similar issues. ✅

Describe the bug

The Realtime agent will produce audio response before a tool call, but the associated agent_end callback receives an empty output argument.

Transcript of actual call:

assistant: Hello, thanks for calling. How can I assist you today?
user: Hello, what's my phone number?
assistant: Sure, let me get that for you. One moment.
tool: getCallerPhone
assistant: The phone number you're calling from is 555-555-5555.

My logs for each event:

[agent-tracing] <agent_start> Agent Base Agent started
[agent-tracing] <agent_end> Agent Base Agent ended: Hello, thanks for calling. How can I assist you today?
[agent-tracing] <agent_start> Agent Base Agent started
[agent-tracing] <agent_end> Agent Base Agent ended:
[agent-tracing] <agent_start> Agent Base Agent started
[agent-tracing] <agent_end> Agent Base Agent ended: The phone number you're calling from is 555-555-5555.

Thus "Sure, let me get that for you. One moment." is invisible to the event callbacks. Is this an SDK limitation or is it just not sent through the API?

Debug information

  • Agents SDK version: 0.1.6

Code

  session.on('agent_end', (context, agentFromEvent, output) => {
    console.log(
      `[agent-tracing] <agent_end> Agent ${agentFromEvent.name} ended: ${output}`,
    );

Another note, the session.on callback is present but not in the TS types.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions