Output response types are not usable as parameters
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず src/openai/types/responses/easy_input_message_param.py と src/openai/types/responses/response_output_message.py を比較し、レポートに記載された必須フィールドに焦点を当てます。これらの自動生成された型がどのように生成されるかを追跡してから、互換性の変更をどこに置くべきかを判断します。報告された messages.append(item) パターンが、意図された response と input の型要件を弱めることなく、Python の型チェックを通過すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Consider the following code:
messages: ResponseInputParam = [{"role": "developer", "content": instructions}]
# ...
resp = client.responses.create(
model="o4-mini",
input=messages,
)
for item in resp.output:
match item:
case ResponseOutputMessage(content=content):
print(item.content)
messages.append(item)
This seems like it should work fine, but it generates a type checking error:
error: Argument of type "ResponseOutputMessage" cannot be assigned to parameter "object" of type "ResponseInputItemParam" in function "append"
Type "ResponseOutputMessage" is not assignable to type "ResponseInputItemParam"
"ResponseOutputMessage" is not assignable to "EasyInputMessageParam"
"ResponseOutputMessage" is not assignable to "Message"
"ResponseOutputMessage" is not assignable to "ResponseOutputMessageParam"
"ResponseOutputMessage" is not assignable to "ResponseFileSearchToolCallParam"
"ResponseOutputMessage" is not assignable to "ResponseComputerToolCallParam"
"ResponseOutputMessage" is not assignable to "ComputerCallOutput"
"ResponseOutputMessage" is not assignable to "ResponseFunctionWebSearchParam"
... (reportArgumentType)
I think this is because the parameter types use Required, but the output types don't. For example, EasyMessageInputParam requires content, but ResponseOutputMessage doesn't:
vs
I recognize that the bindings are auto-generated and this may not be trivial to fix.
To Reproduce
n/a
Code snippets
OS
linux
Python version
Python v3.13.2
Library version
openai v1.75.0
- 主要言語
- Python
- スター
- 31.8k
- フォーク
- 7.3k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 137
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openai/openai-python#4022 · コメント 19 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providers対応中かも @mohmedmm が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#4017 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Querystring drops explicit empty-string scalar values対応中かも @sylvesterkaczmarek が 33 日前に担当しました。 オープンsdk-breaking-change v4
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#3837 ·
メンテナーはふだん 1 日以内に返信
-
Define + export `ServiceTiers` string literal対応中かも @SparshGarg999 が 59 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#3556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Empty OPENAI_BASE_URL prevents fallback to default API endpoint対応中かも @Sehastrajit-S が 25 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#2927 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/peft#3955 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
acl-org/acl-anthology#10313 ·
メンテナーはふだん 1 日以内に返信
-
anime duplicate exception request-theme
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
LizardByte/ThemerrDB#8926 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
huggingface/transformers#49556 ·
メンテナーはふだん 1 日以内に返信
-
area/security bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
mozilla-ai/otari#2245 ·
メンテナーはふだん 1 日以内に返信