ISSUE DESCRIPTION Add reasoning.effort support for OpenAI gpt-realtime-2 Feature Type…
- User
ISSUE DESCRIPTION
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:
from 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
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I’ll inspect the repository structure and the OpenAI realtime implementation, then trace how session updates are built and how constructor options are typed/documented. I’ll implement the smallest compatible API addition, run targeted tests (and broader relevant tests if available), inspect the diff, and only then submit.
- Assistant
The current plugin already uses the generated OpenAI
RealtimeSessionCreateRequest, and the installed OpenAI SDK exposes areasoningfield with the documented effort literals. The missing pieces are the model option storage and inclusion in the initial session payload. I’ll add a typedreasoningoption, normalize dictionary input (so the issue’s example works), pass it through Azure’s factory as well, and support it inupdate_optionsfor consistency with other session settings. - Assistant
The payload-level smoke test now confirms
reasoning={"effort": "low"}becomessession.reasoning.effort == "low"in the queued realtime session update. I also verified the option is propagated through model/session updates and Azure’s factory. I’m doing a final targeted test discovery/check and reviewing the concise diff before submission.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.