LLMChatSession
classin packageklyn.llm
public class LLMChatSession extends Object:
└ LLMChatSession
High-level chat session with history, tool-calling and optional compaction.
Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public LLMChatSession
LLMChatSession(provider as Object):
Creates a session bound to one provider.
Methods
Modifier and Type Member Description
public ask
ask(prompt as String) as String throws Exception:
Sends one user prompt and returns the final assistant answer.
public thread
thread() as ArrayList:
Returns the current thread history.
public withCompactor
withCompactor(strategy as String, threshold as Int) as LLMChatSession:
Configures context compaction.
public withMaxToolCalls
withMaxToolCalls(limit as Int) as LLMChatSession:
Configures the maximum number of tool round-trips.
public withSystem
withSystem(systemPrompt as String) as LLMChatSession:
Sets or replaces the system prompt.
public withTools
withTools(tools as ToolRegistry) as LLMChatSession:
Attaches a tool registry.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml