Async streaming ignores response_model and returns raw text
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Read lib/crewai/src/crewai/llm.py, comparing _ahandle_streaming_response with _handle_streaming_response and how the sync path uses InternalInstructor. Reproduce with LLM.acall(..., response_model=Answer) and confirm the async result is raw text. Done means async streaming returns the serialized structured response; a linked open pull request is already addressing this issue.
索引モデルが issue の本文から書いたものです。
説明
Description
LLM.acall(..., response_model=...) with stream=True returns the raw streamed string instead of the validated model.
The sync path (_handle_streaming_response) converts the accumulated text through InternalInstructor and returns model_dump_json() when a response_model is configured, but the async twin (_ahandle_streaming_response) accepts the same response_model argument and never uses it.
Steps to reproduce
from pydantic import BaseModel
from crewai import LLM
class Answer(BaseModel):
answer: str
llm = LLM(model="gpt-4o-mini", stream=True)
sync = llm.call("What is 6 * 7?", response_model=Answer) # '{"answer": "42"}'
async_ = await llm.acall("What is 6 * 7?", response_model=Answer) # 'The answer is 42.' (raw text)
Expected behavior
Both code paths should return the serialized structured response; async streaming should not silently downgrade to unstructured text. Any downstream Answer.model_validate_json(result) then fails with a JSON decode error even though the model answered correctly.
Environment
- crewai: current
main(lib/crewai/src/crewai/llm.py,_ahandle_streaming_response)
- 主要言語
- Python
- スター
- 60.6k
- フォーク
- 9.1k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 218
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crewAIInc/crewAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
crewAIInc/crewAI#9200 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE] Docs: ApifyActorsTool example with a typed-input Actor対応中かも @johnisanerd が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crewAIInc/crewAI#9132 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Scrape tools reject the documented cookies mapping and drop cookies when the URL is passed at runtime対応中かも @Luckyou-d が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction対応中かも @gokay-ai が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
crewAIInc/crewAI#8761 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
crewAIInc/crewAI の issue をすべて見る
似ている issue
-
question
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
vllm-project/vime#524 ·
メンテナーはふだん 7 日以内に返信
-
WOPI editor page is scrollable by a few pixels, which breaks scrolling in the document (Firefox)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
suitenumerique/drive#969 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
theupdateframework/python-tuf#3044 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
FAIRmat-NFDI/pynxtools#861 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/nsight-python#88 ·
メンテナーはふだん 1 日以内に返信