FakeChatModel constructor
FakeChatModel({})
Creates a model that plays turns in order.
When the script is exhausted the last turn repeats. That is deliberate: an agent loop under test usually needs one interesting turn followed by an ordinary one, and requiring an exact count would make every test brittle against an extra iteration.
Implementation
FakeChatModel({
List<FakeTurn> turns = const <FakeTurn>[],
ModelInfo? info,
this.latency = Duration.zero,
}) : _turns = List<FakeTurn>.of(turns),
info =
info ??
ModelInfo(
id: 'fake-model',
provider: 'fake',
capabilities: ModelCapabilities.frontier,
);