org.llm4s.llmconnect.model.Message
See theMessage companion object
@Stable
A single turn in an LLM conversation.
Conversations are sequences of Message values passed to org.llm4s.llmconnect.LLMClient. Each concrete subtype corresponds to one participant role: UserMessage, SystemMessage, AssistantMessage, ToolMessage.
A UserMessage and a ToolMessage carry ContentParts - text, images and documents; a SystemMessage and an AssistantMessage carry text. content is a message's text: for a user or tool message, its text parts joined by newlines, so "" for one that is all media. Use validate or the smart constructors on the Message companion to ensure a message has content. AssistantMessage.content returns "" rather than null when the LLM response contains only tool calls and no text.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
In this article