Skip to content

Unable to stream with functional api #6373

@sdole

Description

@sdole

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

I've attached files.

Error Message and Stack Trace (if applicable)

None

Description

Streaming works find in graph but does not stream when the same code is organized using functional api. I was able to reproduce this with the example code on https://docs.langchain.com/oss/python/langgraph/quickstart. Take the full code example from the bottom of the page for both types and run them in my IDE. Changes prompt a bit to produce a longer generation and change the llm configuration to get my bedrock claude 4.5.

router.py
router_func.py

For the router func py, I get a single AIMessage (no chunks).

System Info

System Information

OS: Windows
OS Version: 10.0.26200
Python Version: 3.13.5 (main, Jun 12 2025, 12:42:35) [MSC v.1943 64 bit (AMD64)]

Package Information

langchain_core: 1.0.2
langchain: 1.0.3
langsmith: 0.4.38
langchain_aws: 1.0.0
langgraph_checkpoint_aws: 1.0.0
langgraph_dynamodb_checkpoint: 0.2.6.2
langgraph_sdk: 0.2.9

Optional packages not installed

langserve

Other Dependencies

beautifulsoup4: 4.14.2
bedrock-agentcore: Installed. No version info available.
black: Installed. No version info available.
boto3: 1.40.64
botocore: 1.40.64
claude-agent-sdk: Installed. No version info available.
httpx: 0.28.1
isort: Installed. No version info available.
jsonpatch: 1.33
langchain-anthropic: Installed. No version info available.
langchain-community: Installed. No version info available.
langchain-deepseek: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-genai: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-huggingface: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-ollama: Installed. No version info available.
langchain-openai: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.2
langgraph-checkpoint: 3.0.0
langsmith-pyo3: Installed. No version info available.
mypy: Installed. No version info available.
numpy: 2.3.4
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.4
packaging: 25.0
playwright: Installed. No version info available.
pydantic: 2.12.3
pytest: 8.4.1
pytest-cov: Installed. No version info available.
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: Installed. No version info available.
tenacity: 9.1.2
typing-extensions: 4.15.0
vcrpy: Installed. No version info available.
zstandard: 0.25.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingawaiting review/confirmation by maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions