LlmTrailFileWriter class
Writes the sessions' trail files.
Constructors
- LlmTrailFileWriter({required LlmTrails trails, required LlmTrailMedium medium, required String directory, required String reason, LlmTrailLog? log, Duration coalesce = const Duration(milliseconds: 250), int maxBytes = 1 << 20})
-
Writes into
medium, which is the directorydirectory;reasonsays which rule chose it.
Properties
- coalesce → Duration
-
How long a streaming run's changes wait before they are written: 250 ms
, shorter only in a test.
final
- directory → String
-
The trail directory.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- log → LlmTrailLog?
-
Where a failed write is recorded; null records nothing.
final
- maxBytes → int
-
A file's size bound, in UTF-8 bytes.
final
- questTargetFor ↔ LlmQuestTarget? Function(String sessionId)?
-
The quest folder a session writes into, or null for a session that
writes into the trail directory. Bound by the root, which knows the
sessions; asked each time a file is first opened.
getter/setter pair
- reason → String
-
Which rule chose directory, in the words a view shows.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trails → LlmTrails
-
final
Methods
-
dispose(
) → Future< void> - Writes what is pending and stops following the trails.
-
fileFor(
String sessionId) → String -
The path of
sessionId's trail file. -
flush(
) → Future< void> - Writes every file with changes now, and waits for the history entries of runs that have ended.
-
isMemoryOnly(
String sessionId) → bool -
Whether
sessionId's latest run draws on an encrypted document and is therefore kept in memory only. -
keepOnDisk(
String sessionId) → Future< void> -
The memory-only switch:
sessionId's runs are written even when they draw on an encrypted document, until the writer is disposed. The run the session is showing is written now. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
retarget(
{required LlmTrailMedium medium, required String directory, required String reason}) → Future< void> -
Moves the trail files to
directoryfor every write from now on. A file already in the new directory is continued. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited