Skip to content

IConversationManager

Defined in: agent/interfaces.ts:13

Manages the conversation history and message building. This interface abstracts conversation state management from the orchestration logic.

addAssistantMessage(content): void

Defined in: agent/interfaces.ts:23

Adds an assistant message to the conversation.

string

void


addGadgetCallResult(gadgetName, parameters, result, invocationId, media?, mediaIds?): void

Defined in: agent/interfaces.ts:30

Adds a gadget call and its result to the conversation. The invocationId is shown to the LLM so it can reference previous calls when building dependencies. Optionally includes media outputs (images, audio, etc.) for multimodal results.

string

Record<string, unknown>

string

string

GadgetMediaOutput[]

string[]

void


addUserMessage(content): void

Defined in: agent/interfaces.ts:18

Adds a user message to the conversation. Supports multimodal content (text + images/audio).

MessageContent

void


getBaseMessages(): LLMMessage[]

Defined in: agent/interfaces.ts:54

Gets the base messages (system prompts, gadget instructions). These are never compacted and always included at the start.

LLMMessage[]


getConversationHistory(): LLMMessage[]

Defined in: agent/interfaces.ts:70

Gets full conversation history including initial messages and runtime history. Used for REPL session continuation - returns everything except base (system) messages. This combines:

  • initialMessages: History from previous sessions (set via withHistory())
  • historyBuilder: Messages from the current session

LLMMessage[]


getHistoryMessages(): LLMMessage[]

Defined in: agent/interfaces.ts:48

Gets only the conversation history messages (excludes base messages). Used by compaction to determine what can be compressed.

LLMMessage[]


getMessages(): LLMMessage[]

Defined in: agent/interfaces.ts:42

Gets the complete conversation history including base messages (system prompts, gadget instructions).

LLMMessage[]


replaceHistory(newHistory): void

Defined in: agent/interfaces.ts:61

Replaces the conversation history with new messages. Used by compaction to update history after compression.

LLMMessage[]

The compacted history messages to replace with

void