LlmChatSession class

Each instance owns independent context, cancellation and permissions. Only completed turns enter future requests. Tools execute in the host.

Inheritance
Mixed-in types

Constructors

LlmChatSession({required OpenAiChatClient client, String? sessionId, String agentName = 'Assistant', String systemPrompt = '', bool supportsImages = false, List<ChatTool> tools = const [], int maxToolRounds = 8, int maxToolCallsPerRound = 32, int maxHistoryTurns = 30, int maxContextBytes = 4 * 1024 * 1024, ChatInputBudget inputBudget = const ChatInputBudget()})

Properties

agentName String
final
client OpenAiChatClient
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
inputBudget ChatInputBudget
final
maxContextBytes int
final
maxHistoryTurns int
final
maxToolCallsPerRound int
final
maxToolRounds int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String
final
state ChatSessionState
no setteroverride
supportsImages bool
final
systemPrompt String
final
tools List<ChatTool>
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearQueuedPrompts() → void
inherited
dispose() → void
Discards any resources used by the object.
override
guideQueuedPrompt(int id) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeQueuedPrompt(int id) → void
inherited
reorderQueuedPrompt(int oldIndex, int newIndex) → void
inherited
resolvePermission(ChatPermissionDecision decision) Future<void>
override
selectPermissionOption(String optionId) Future<void>
override
send(String text, {List<PromptAttachment> attachments = const []}) Future<void>
override
setConfigOption(String id, Object value) Future<void>
inherited
setExecutionPolicy(ChatToolCallExecutionPolicy policy) → void
inherited
stop() Future<void>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited