Realtime API Pydantic Models incomplete for RealtimeResponseStatus type
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/openai/types/beta/realtime/realtime_response_status.py から始め、特に issue で参照されている Error モデルを確認し、response.done ペイロードがどのように検証されるかを調べてください。失敗したレスポンスの例を再現し、モデルを更新したときに検証によってネストされたエラーメッセージが保持されることを確認してください。
索引モデルが 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
- フォーク
- 5.8k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 104
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-python のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
openai/openai-python#3962 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
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 日以内に返信
-
upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openai/openai-python#3294 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#2927 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
bot-found bug priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
madenvel/KalinkaPlayer#179 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ls1intum/edutelligence#1098 ·
メンテナーはふだん 1 日以内に返信