LemonAi. Types. Context
(lemon_ai v0.1.0)
View Source
Conversation context containing messages, tools, and system prompt
Summary
Functions
Add an assistant message to the context
Add a tool result to the context
Add a user message to the context
Returns messages in chronological order (oldest first).
Create a new empty context
Types
@type message() :: LemonAi.Types.UserMessage.t() | LemonAi.Types.AssistantMessage.t() | LemonAi.Types.ToolResultMessage.t()
@type t() :: %LemonAi.Types.Context{ messages: [message()], system_prompt: String.t() | nil, tools: [LemonAi.Types.Tool.t()] }
Functions
Add an assistant message to the context
Add a tool result to the context
Add a user message to the context
Returns messages in chronological order (oldest first).
Messages are stored internally in reverse order for O(1) append performance. Use this function when you need messages in chronological order for LLM APIs.
Create a new empty context