- langgraph_agent_toolkit.helper.utils.langchain_to_chat_message(message)[source][source]
Create a ChatMessage from a LangChain message.
- Parameters:
- Return type:
- langgraph_agent_toolkit.helper.utils.remove_tool_calls(content)[source][source]
Remove tool calls from content.
- langgraph_agent_toolkit.helper.utils.sanitize_chat_history(messages)[source][source]
Sanitize chat history by removing AIMessages with tool_calls that don’t have corresponding ToolMessages.
This is useful when: - A previous execution was interrupted before tool responses were added - Chat history was corrupted - Connection was lost during tool execution
- langgraph_agent_toolkit.helper.utils.create_ai_message(parts)[source][source]
- Parameters:
parts (dict)
- Return type:
AIMessage