Realtime API Pydantic Models incomplete for RealtimeResponseStatus type
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 src/openai/types/beta/realtime/realtime_response_status.py 开始,尤其检查 issue 中引用的 Error 模型,并查看 response.done payload 是如何进行验证的。复现失败响应示例,并验证更新模型后,验证过程仍会保留嵌套的错误消息。
由索引模型根据 Issue 内容生成。
描述
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library --> It is both and I have informed the issue via https://help.openai.com/en
Describe the bug
And I have got errors like this when using latest Azure deployments of OpenAI Realtime model
{
"type": "response.done",
"event_id": "event_BvlnvdNtqw7LLGP7xDfyA",
"response": {
"object": "realtime.response",
"id": "resp_BvlnvRcuxxRLrr5FBygyo",
"status": "failed",
"status_details": {
"type": "failed",
"error": {
"type": "invalid_request_error",
"code": "inference_rate_limit_exceeded",
"message": "We're currently processing too many requests — please try again later."
}
},
"output": [],
"conversation_id": "conv_Bvlm1z1fjvrisuRsPx8hC",
"modalities": ["text", "audio"],
"voice": "sage",
"output_audio_format": "pcm16",
"temperature": 0.6,
"max_output_tokens": "inf",
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"input_token_details": {
"text_tokens": 0,
"audio_tokens": 0,
"cached_tokens": 0,
"cached_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0
}
},
"output_token_details": {
"text_tokens": 0,
"audio_tokens": 0
}
},
"metadata": {
"client_event_id": "response_create_6448171658c7"
}
}
}
I have seen online others report errors like this: https://community.openai.com/t/realtime-api-errors-in-both-playground-and-api-calls/1007933 or here https://github.com/pipecat-ai/pipecat/issues/2106#issue-3193722974 etc.
The problem is that the pydantic model for Error is wrong - it does not include the message field (e.g. "We're currently processing too many requests — please try again later." in the above example). This seems to be the case in the API reference itself too https://platform.openai.com/docs/api-reference/realtime-server-events/response/done
A side effect of this is that pydantic validated code sometimes will omit the message which is quite helpeful for debugging.
To Reproduce
Create a response that fails to complete, e.g. due to exceeding the rate limit of your server
The issue is present even in latest code base of openai repo: https://github.com/openai/openai-python/blob/e6c6757553bbdb777c31d0daf5916fb9e2b47ff8/src/openai/types/beta/realtime/realtime_response_status.py#L11
Code snippets
OS
Linux
Python version
3.13
Library version
1.84.0
- 主要语言
- Python
- 星标
- 31.7k
- 派生
- 6.8k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 128
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openai/openai-python 的其他 Issue
-
sdk-breaking-change v4
难度 2/5 1-3 小时 新手友好度 86/100
openai/openai-python#3837 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
openai/openai-python#3556 · 3 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
openai/openai-python#2927 · 7 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
openai/openai-python#2486 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 38/100
openai/openai-python#3966 · 2 条评论 ·
维护者通常 1 天内回复
查看 openai/openai-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
mozilla/bedrock#17413 · 1 个 reaction ·
维护者通常 2 天内回复
-
instance instance add
难度 2/5 1-3 小时 新手友好度 68/100
searxng/searx-instances#943 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug tools
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
lance-format/lance#9655 ·
维护者通常 2 天内回复