datarobot_genai.langgraph.history
history
Reconstruct prior AG-UI turns as structured LangChain messages.
The default chat-history path flattens prior turns into the text {chat_history}
prompt variable, which drops tool calls. This converter rebuilds real
HumanMessage / AIMessage(tool_calls=...) / ToolMessage so the model sees
structured tool history. Reasoning, when carried, is already plain text in
content (folded into the assistant turn during history extraction), so it needs
no special handling here.
ag_ui_history_to_langchain
Convert normalized AG-UI history (from BaseAgent.history_messages) to
LangChain messages, preserving tool calls and tool results.