FakeLocalAiSession class

One session the fake was asked to create, and everything sent to it.

Assert against this rather than against call strings: it survives a rename, and it says what the code under test actually did.

Constructors

FakeLocalAiSession({required int id, required double temperature, required int topK, double? topP, int? maxOutputTokens, String? systemInstruction, List<LocalAiTool> tools = const []})

Properties

closed ↔ bool
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id → int
final
images → List<Uint8List>
Everything addImage appended, in order.
final
lastOverrides ↔ LocalAiGenerationOverrides?
Sampling the most recent generate call on this session carried, or null when it inherited the session's own.
getter/setter pair
lastSchemaJson ↔ String?
The schema the most recent structured call carried, as raw JSON.
getter/setter pair
maxOutputTokens → int?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
systemInstruction → String?
final
temperature → double
final
toolNames → List<String>
The names of tools, for the common assertion.
no setter
tools → List<LocalAiTool>
The tools this session was opened with, as the caller declared them.
final
toolSchemas → Map<String, Map<String, dynamic>>
The declaration each tool sent, keyed by tool name: the JSON Schema the native host would build the model's parameter constraint from. Assert against this to prove a nested object, a list or a string enum survived the declaration.
no setter
topK → int
final
topP → double?
final
transcript → StringBuffer
Everything addQueryChunk appended, in order.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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