Add reasoning.effort support for OpenAI gpt-realtime-2 Feature Type Would make my life…
- User
Add reasoning.effort support for OpenAI gpt-realtime-2
Feature Type
Would make my life easier
Feature Description
OpenAI
gpt-realtime-2supports configurable reasoning viareasoning.effort, but the Python OpenAI Realtime plugin does not seem to expose this option onopenai.realtime.RealtimeModel.It would be useful to support something like:
pythonfrom livekit.plugins import openai llm = openai.realtime.RealtimeModel( model="gpt-realtime-2", reasoning={"effort": "low"}, )Workarounds / Alternatives
I don't think there is a clean workaround through the current Python
RealtimeModelAPI.The only workaround I can see is patching the plugin locally to add
reasoningto the session update payload.Additional Context
OpenAI docs list these effort values:
minimal,low,medium,high,xhigh.References:
- https://developers.openai.com/api/docs/models/gpt-realtime-2
- https://developers.openai.com/api/docs/guides/realtime-models-prompting#set-reasoning-effort
- Related JS issue: https://github.com/livekit/agents-js/issues/1433
- Related JS PR: https://github.com/livekit/agents-js/pull/1575
Interface
No new interfaces are introduced.
- Assistant
I’ll trace the OpenAI realtime model options and session-update serialization, then add the typed parameter and focused tests.
- Assistant
rgisn’t installed in this checkout, so I’m using targetedfind/grepsearches instead. - Assistant
The installed OpenAI SDK already provides a typed
RealtimeReasoningmodel and input mapping with exactly the five effort values. I’m wiring that through model options into the initialsession.update, while preserving omission when unset. - Assistant
The first focused test caught a subtle serialization issue: assigning
Nonewould send"reasoning": nullinstead of leaving the field absent. I’ve adjusted construction so existing models keep the prior payload exactly. - Assistant
The focused behavior and lint checks now pass. I’m running the repository’s configured type checker and a broader relevant test slice to catch overload or SDK-type integration issues.
- Assistant
The repository-wide strict type check is still running and has produced no diagnostics so far; focused formatting, lint, and all six new tests are clean.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.