InvalidToolCall Class — langchain Architecture
Architecture documentation for the InvalidToolCall class in content.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d9694bf0_2725_8cd8_52a4_c308616c9805["InvalidToolCall"] c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"] d9694bf0_2725_8cd8_52a4_c308616c9805 -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630
Relationship Graph
Source Code
libs/core/langchain_core/messages/content.py lines 336–369
class InvalidToolCall(TypedDict):
"""Allowance for errors made by LLM.
Here we add an `error` key to surface errors made during generation
(e.g., invalid JSON arguments.)
"""
# TODO: Consider making fields NotRequired[str] in the future.
type: Literal["invalid_tool_call"]
"""Used for discrimination."""
id: str | None
"""An identifier associated with the tool call.
An identifier is needed to associate a tool call request with a tool
call result in events when multiple concurrent tool calls are made.
"""
# TODO: Consider making this NotRequired[str] in the future.
name: str | None
"""The name of the tool to be called."""
args: str | None
"""The arguments to the tool call."""
error: str | None
"""An error message associated with the tool call."""
index: NotRequired[int | str]
"""Index of block in aggregate response. Used during streaming."""
extras: NotRequired[dict[str, Any]]
"""Provider-specific metadata."""
Defined In
Source
Frequently Asked Questions
What is the InvalidToolCall class?
InvalidToolCall is a class in the langchain codebase, defined in libs/core/langchain_core/messages/content.py.
Where is InvalidToolCall defined?
InvalidToolCall is defined in libs/core/langchain_core/messages/content.py at line 336.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free