Constructors

Methods

  • Build the full LLM message array.

    Returns: [system_msg, ...conversation, state_msg?]

    Module state fields are collected into a trailing system message (not in the system_prompt) to preserve KV cache for the conversation prefix.

    Parameters

    • conversation: {
          content: string;
          role: string;
      }[]

    Returns {
        content: string;
        role: string;
    }[]

  • Returns {
        modules: {
            id: string;
            tokens: number;
        }[];
        totalTokenEstimate: number;
    }

    • modules: {
          id: string;
          tokens: number;
      }[]
    • totalTokenEstimate: number