A single message in a conversation with an LLM.
content is either a plain string or a list of content parts for multimodal
messages (text + images/files).
Plain text message
%Message{role: :user, content: "Hello"}Multimodal message (text + image)
%Message{role: :user, content: [
%{type: :text, content: "Describe this image"},
%{type: :image, content: "base64...", media: :jpg}
]}Multimodal messages are built automatically by LangchainPrompt.execute/4
when you pass attachments.
Summary
Types
@type t() :: %LangchainPrompt.Message{ content: String.t() | [content_part()], role: :system | :user | :assistant }