[BUG] Native OpenAI async streaming does not send response_model as response_format
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
調査の方向性
lib/crewai/src/crewai/llms/providers/openai/completion.pyを読み、_ahandle_streaming_completionと_handle_streaming_completionを比較してください。テストtest_openai_streaming_with_response_modelを見つけ、非同期パスをどのようにカバーしているか確認してください。非同期ストリーミングリクエストにresponse_modelのスキーマがresponse_formatとして含まれ、テストでリクエスト引数が検証されることが完了条件です。
索引モデルが issue の本文から書いたものです。
説明
Description
OpenAICompletion._ahandle_streaming_completion ignores the per-call response_model when it builds the request. In llms/providers/openai/completion.py the if response_model: branch calls self._get_async_client().chat.completions.create(**params), and params come from _prepare_completion_params, which only sets response_format from self.response_format. The sync twin (_handle_streaming_completion) uses beta.chat.completions.stream(..., response_format=response_model). So await llm.acall(..., response_model=M) with streaming sends an unconstrained request and usually gets prose back instead of an instance of M.
Steps to Reproduce
- Create
LLM(model="openai/gpt-4o", stream=True)with the native OpenAI provider. - Mock or inspect
llm._async_client.chat.completions.createand callawait llm.acall(messages, response_model=SomeModel). - The kwargs passed to
createcontain noresponse_format.
Expected behavior
The structured-output schema of response_model is sent, as on the sync path.
Screenshots/Code snippets
Related, on the LiteLLM path (llm.py): #9283 and PR #9284. This issue is the native OpenAI async path only.
Evidence
Code reading of lib/crewai/src/crewai/llms/providers/openai/completion.py at 97f2424 (async streaming handler vs the sync one). I can send a fix with a test next to test_openai_streaming_with_response_model.
Operating System
Linux (Debian-based)
Python Version
3.12
crewAI Version
1.15.45 (origin/main at 97f2424)
crewAI Tools Version
Not relevant
Virtual Environment
uv
- 主要言語
- Python
- スター
- 61.2k
- フォーク
- 9.2k
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 180
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crewAIInc/crewAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[FEATURE] Add Straitly as a native OpenAI-compatible LLM provider対応中かも @HashimSyedUBC が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native OpenAI sync streaming with response_model returns an empty string and emits no completed event when the parse is missing対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native Azure provider ignores the seed setting対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
crewAIInc/crewAI#9787 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] LiteLLM path reports 0 cached and reasoning tokens in the usage summary対応中かも @basil-k-aji-dev が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
crewAIInc/crewAI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fedora-infra/anitya#2272 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
unitaryfoundation/mitiq#3205 ·
メンテナーはふだん 6 日以内に返信
-
[Bug]: Index worker test drops empty Git config values on Windows対応中かも @xiaoyesoso が今日担当しました。 オープンtriage/confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
agentscope-ai/agentscope#4377 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
area/config comp/agent P2 type/perf
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#161039 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
astral-sh/ty-pre-commit#46 ·