klyn.llm.LLMChatSession.withMessages
method
public withMessages(messages as ArrayList<LLMThreadMessage>) as LLMChatSession
Description

Restores an existing provider history without sharing its list container.

Parameters
ParameterDescription
messagesOrdered messages, including system prompts and tool results.
Returns

This session. Last provider usage is reset; retained context is estimated.

Throws
  • ValueException if the list or a message is null, or a role is invalid.
Example
session.withMessages(savedMessages)