Chat message types for LLM interactions.
Provides struct-based message types and a reducer for accumulating messages in graph state.
Summary
Functions
Reducer that appends new messages to an existing list. Messages with matching IDs replace the existing message (for corrections/updates).
Create an AI message.
Create a human message.
Create a system message.
Create a tool result message.
Types
@type t() :: LangEx.Message.Human.t() | LangEx.Message.AI.t() | LangEx.Message.System.t() | LangEx.Message.Tool.t()
Functions
Reducer that appends new messages to an existing list. Messages with matching IDs replace the existing message (for corrections/updates).
@spec ai( String.t(), keyword() ) :: LangEx.Message.AI.t()
Create an AI message.
@spec human( String.t(), keyword() ) :: LangEx.Message.Human.t()
Create a human message.
@spec system( String.t(), keyword() ) :: LangEx.Message.System.t()
Create a system message.
@spec tool(String.t(), String.t(), keyword()) :: LangEx.Message.Tool.t()
Create a tool result message.