fix: add state attribute to ToolCallRequest overrides (#6668)

Following https://github.com/langchain-ai/langchain/pull/34692
This commit is contained in:
Mason Daugherty
2026-01-09 21:26:39 -05:00
committed by GitHub
parent 728db10b1f
commit 7045a23148
@@ -121,6 +121,7 @@ class _ToolCallRequestOverrides(TypedDict, total=False):
"""Possible overrides for ToolCallRequest.override() method."""
tool_call: ToolCall
state: Any
@dataclass
@@ -170,8 +171,12 @@ class ToolCallRequest:
This follows an immutable pattern, leaving the original request unchanged.
Args:
**overrides: Keyword arguments for attributes to override. Supported keys:
- tool_call: Tool call dict with name, args, and id
**overrides: Keyword arguments for attributes to override.
Supported keys:
- tool_call: Tool call dict with `name`, `args`, and `id`
- state: Agent state (`dict`, `list`, or `BaseModel`)
Returns:
New ToolCallRequest instance with specified overrides applied.