default_tool_chunk_parser() — langchain Function Reference
Architecture documentation for the default_tool_chunk_parser() function in tool.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 429e0c2c_748e_3b96_8be3_c5b27f01d3b0["default_tool_chunk_parser()"] 210f83c5_4be3_e20e_b877_98a194178520["tool.py"] 429e0c2c_748e_3b96_8be3_c5b27f01d3b0 -->|defined in| 210f83c5_4be3_e20e_b877_98a194178520 ca240eca_eed5_eb55_5e92_d17218108c68["tool_call_chunk()"] 429e0c2c_748e_3b96_8be3_c5b27f01d3b0 -->|calls| ca240eca_eed5_eb55_5e92_d17218108c68 style 429e0c2c_748e_3b96_8be3_c5b27f01d3b0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/messages/tool.py lines 386–410
def default_tool_chunk_parser(raw_tool_calls: list[dict]) -> list[ToolCallChunk]:
"""Best-effort parsing of tool chunks.
Args:
raw_tool_calls: List of raw tool call dicts to parse.
Returns:
List of parsed ToolCallChunk objects.
"""
tool_call_chunks = []
for tool_call in raw_tool_calls:
if "function" not in tool_call:
function_args = None
function_name = None
else:
function_args = tool_call["function"]["arguments"]
function_name = tool_call["function"]["name"]
parsed = tool_call_chunk(
name=function_name,
args=function_args,
id=tool_call.get("id"),
index=tool_call.get("index"),
)
tool_call_chunks.append(parsed)
return tool_call_chunks
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does default_tool_chunk_parser() do?
default_tool_chunk_parser() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/tool.py.
Where is default_tool_chunk_parser() defined?
default_tool_chunk_parser() is defined in libs/core/langchain_core/messages/tool.py at line 386.
What does default_tool_chunk_parser() call?
default_tool_chunk_parser() calls 1 function(s): tool_call_chunk.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free