Skip to main content

Module langchain

Module langchain 

Source
Expand description

LangChain dialect: AIMessage.tool_calls in, error ToolMessages out. The same shapes serve LangGraph nodes, which pass LangChain messages.

Constants§

DIALECT
Dialect name used in error messages and the Python bindings.

Functions§

denial
Render a denied/undecided call as an error ToolMessage dict (status: "error"), so graphs/chains feed the refusal back to the model. Returns None for allowed calls.
filter_tools
Filter a list of serialized tool definitions (dicts with a name) down to the definitions keep accepts.
parse_tool_calls
Parse tool calls from an AIMessage ({"tool_calls": [...]}) or a bare array of LangChain ToolCall dicts ({"name", "args", "id"}).