langchain - ✅(Solved) Fix (Anthropic) Natively Support "eager_input_streaming": true for Fine Grained Tool Streaming [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35767Fetched 2026-04-08 00:24:37
View on GitHub
Comments
0
Participants
1
Timeline
8
Reactions
0
Participants
Timeline (top)
labeled ×5closed ×1cross-referenced ×1issue_type_added ×1

Fix Action

Fix / Workaround

There is no way to support fine grained tool streaming for Anthropic models natively without a monkey-patch in-code, which is fragile and doesn't work properly.

PR fix notes

PR #35779: fix(anthropic): support eager_input_streaming

Description (problem / solution / changelog)

Resolves https://github.com/langchain-ai/langchain/issues/35767

Changed files

  • libs/partners/anthropic/langchain_anthropic/chat_models.py (modified, +1/-0)
  • libs/partners/anthropic/tests/unit_tests/test_chat_models.py (modified, +27/-8)
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Feature Description

There is no way to support fine grained tool streaming for Anthropic models natively without a monkey-patch in-code, which is fragile and doesn't work properly.

The native way to support fine grained tool streaming is documented at: https://platform.claude.com/docs/en/agents-and-tools/tool-use/fine-grained-tool-streaming

This is critical for tool calling performance speed.

Use Case

I have a supervisor agent that does a large amount of tool calling. Before Sonnet 4.6, the beta header worked just fine. But now it's first class and required on every tool definition. This would solve the current inability to have fine grained tool streaming enabled for anthropic models for anyone using >= Sonnet/Opus 4.6.

Proposed Solution

I think this could be implemented by somehow allowing an input parameter to init_chat_model where model_provider = "anthropic" | "anthropic_bedrock" to default turn on for every tool, similar to how the beta header used to work.

Could also simply allow provider kwargs to @tool decorator definitions to allow enablement per-tool.

Alternatives Considered

No response

Additional Context

I'm using anthropic_bedrock as model_provider in my current setup, but think this feature would apply to anthropic directly as well.

extent analysis

Fine Grained Tool Streaming for Anthropic Models

Fix Plan

Step 1: Implement a new init_chat_model parameter

Add a new parameter fine_grained_tool_streaming to the init_chat_model function in langchain-anthropic package. This parameter should default to True for anthropic and anthropic_bedrock model providers.

# langchain-anthropic/init_chat_model.py
def init_chat_model(model_provider: str, fine_grained_tool_streaming: bool = True) -> ChatModel:
    # ...

Step 2: Update @tool decorator to accept fine_grained_tool_streaming parameter

Modify the @tool decorator in langchain-core package to accept a fine_grained_tool_streaming parameter. This parameter should default to True if not provided.

# langchain-core/decorators.py
def tool(fine_grained_tool_streaming: bool = True):
    def decorator(func):
        # ...
    return decorator

Step 3: Update anthropic_bedrock model provider to use new fine_grained_tool_streaming parameter

Update the anthropic_bedrock model provider to use the new fine_grained_tool_streaming parameter when initializing the chat model.

# langchain-anthropic/model_providers.py
class AnthropicBedrockModelProvider:
    def init_chat_model(self, fine_grained_tool_streaming: bool = True) -> ChatModel:
        # ...

Step 4: Test the new feature

Test the new feature by creating a supervisor agent that uses the anthropic_bedrock model provider and enables fine grained tool streaming.

# test_supervisor_agent.py
from langchain import SupervisorAgent
from langchain.anthropic import AnthropicBedrockModel

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix (Anthropic) Natively Support "eager_input_streaming": true for Fine Grained Tool Streaming [1 pull requests, 1 participants]