startAdkWebServer function

Future<HttpServer> startAdkWebServer({
  1. required String agentsDir,
  2. String appName = '',
  3. int port = 8000,
  4. String host = '127.0.0.1',
  5. List<String> allowOrigins = const <String>[],
  6. String? sessionServiceUri,
  7. String? artifactServiceUri,
  8. String? memoryServiceUri,
  9. bool useLocalStorage = true,
  10. String? urlPrefix,
  11. bool autoCreateSession = false,
  12. bool enableWebUi = true,
  13. String? logoText,
  14. String? logoImageUrl,
})

Starts an AdkWebServer with one call.

Returns the bound HttpServer.

Implementation

Future<HttpServer> startAdkWebServer({
  required String agentsDir,
  String appName = '',
  int port = 8000,
  String host = '127.0.0.1',
  List<String> allowOrigins = const <String>[],
  String? sessionServiceUri,
  String? artifactServiceUri,
  String? memoryServiceUri,
  bool useLocalStorage = true,
  String? urlPrefix,
  bool autoCreateSession = false,
  bool enableWebUi = true,
  String? logoText,
  String? logoImageUrl,
}) async {
  final AdkWebServer server = AdkWebServer(
    agentsDir: agentsDir,
    appName: appName,
    port: port,
    host: host,
    allowOrigins: allowOrigins,
    sessionServiceUri: sessionServiceUri,
    artifactServiceUri: artifactServiceUri,
    memoryServiceUri: memoryServiceUri,
    useLocalStorage: useLocalStorage,
    urlPrefix: urlPrefix,
    autoCreateSession: autoCreateSession,
    enableWebUi: enableWebUi,
    logoText: logoText,
    logoImageUrl: logoImageUrl,
  );
  return server.start();
}