InMemoryAiChat class

Inheritance

Constructors

InMemoryAiChat({required String chatId, required String userId, required AiCompletions aiCompletions, required AiCompletions summaryCompletions, required String instructions(), required ExtendedLogger logger, CompactionSetup compactionSetup = defaultCompactionSetup, String summaryInstructions()?, bool isTimeAware = true, Duration contextGroupGap = const Duration(minutes: 5)})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startedStream Stream<AiChatState>
no setterinherited
state AiChatState
no setterinherited
stream Stream<AiChatState>
no setterinherited

Methods

addContext({required String text}) → void
Added to conversation as a <context> -tagged user message.
inherited
addTurnManually({required String? prompt, required String? answer}) Future<void>
inherited
clear() Future<void>
inherited
createAiRequest({required String prompt, Map<String, dynamic>? responseFormat, AiToolChoice toolChoice = const AiToolChoice.auto(), bool verbatim = false}) → AiRequest
inherited
dispose() → void
inherited
disposeAndClearLocalStorage() → void
inherited
getResponse({required String prompt, Map<String, dynamic>? responseFormat, bool recordTurn = true, AiToolChoice toolChoice = const AiToolChoice.auto(), bool verbatim = false}) Future<String>
recordTurn false answers from history without extending it: the prompt still shapes this response, but neither it nor the answer is stored.
inherited
getStructuredResponse<T>({required String prompt, required Map<String, dynamic> responseFormat, required T fromJson(Map<String, dynamic> json), bool recordTurn = true, AiToolChoice toolChoice = const AiToolChoice.auto()}) Future<T>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
streamResponse({required String prompt, bool recordTurn = true, AiToolChoice toolChoice = const AiToolChoice.auto(), bool verbatim = false}) Stream<String>
recordTurn false answers from history without extending it: the prompt still shapes this response, but neither it nor the answer is stored.
inherited
toString() String
A string representation of this object.
inherited

Operators

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