start static method

Future<FakeAiServer> start({
  1. List<String> replies = const ['Hello from the fixture.'],
  2. FakeAiServerBehaviour behaviour = FakeAiServerBehaviour.succeed,
  3. String workspaceName = 'agent-sdk-fixture',
  4. Duration dripInterval = const Duration(milliseconds: 200),
  5. int thinkingBeats = 5,
  6. int port = 0,
  7. List<Map<String, dynamic>> recorded = const [],
})

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;
}