Skip to content

Pre-connect Realtime manager.send crashes on Omit in dict events #3402

Description

@KirtiRamchandani

AsyncRealtimeConnectionManager.send() / RealtimeConnectionManager.send() call json.dumps(event) on dict payloads, but post-connect connection.send() uses maybe_transform() which strips Omit/NotGiven.

Repro:

manager = client.realtime.connect(model="gpt-4o-realtime-preview")
manager.send({"type": "response.cancel", "event_id": omit})
# TypeError: Object of type Omit is not JSON serializable

PR incoming with regression test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions