start static method
Future<FakeAiServer>
start({
- List<
String> replies = const ['Hello from the fixture.'], - FakeAiServerBehaviour behaviour = FakeAiServerBehaviour.succeed,
- String workspaceName = 'agent-sdk-fixture',
- Duration dripInterval = const Duration(milliseconds: 200),
- int thinkingBeats = 5,
- int port = 0,
- List<
Map< recorded = const [],String, dynamic> >
Implementation
static Future<FakeAiServer> start({
List<String> replies = const ['Hello from the fixture.'],
FakeAiServerBehaviour behaviour = FakeAiServerBehaviour.succeed,
String workspaceName = 'agent-sdk-fixture',
Duration dripInterval = const Duration(milliseconds: 200),
int thinkingBeats = 5,
int port = 0,
List<Map<String, dynamic>> recorded = const [],
}) async {
final socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, port);
final server = FakeAiServer._(
socket,
replies: replies,
behaviour: behaviour,
workspaceName: workspaceName,
dripInterval: dripInterval,
thinkingBeats: thinkingBeats,
recorded: recorded,
);
socket.listen(server._handle);
return server;
}