BotConfiguration constructor

const BotConfiguration({
  1. required String userID,
  2. required String projectSecretKey,
  3. LocalizedText? welcomeMessage,
  4. LocalizedText? name,
  5. LocalizedText? systemInstructions,
  6. @Default.new('en') String defaultLocale,
  7. @Default.new(['en']) List<String> supportedLocales,
  8. String? currentLocale,
  9. String? allowedOrigins,
  10. @Default.new('Roboto') String? fontFamily,
  11. @Default.new('#3B82F6') String? color,
  12. @unfreezed Uint8List? avatar,
  13. @Default.new(false) bool isPreviewMode,
  14. @Default.new(FabConfiguration()) FabConfiguration fabConfiguration,
})

Implementation

const factory BotConfiguration({
  /// Unique identifier for the user interacting with the bot.
  required String userID,

  /// Secret key for authenticating with the bot service.
  /// Keep this secure and never expose in logs.
  required String projectSecretKey,

  /// Initial message displayed when the chat opens (localized).
  LocalizedText? welcomeMessage,

  /// Display name for the chatbot (localized).
  LocalizedText? name,

  /// System instructions that guide the bot's behavior (localized).
  LocalizedText? systemInstructions,

  /// Default locale code for the chat interface (e.g., 'en', 'fr', 'es').
  @Default('en') String defaultLocale,

  /// List of supported locale codes
  @Default(['en']) List<String> supportedLocales,

  // The locale code for the chat interface (e.g., 'en', 'fr', 'es').
  String? currentLocale,

  /// Comma-separated list of allowed origins for CORS.
  String? allowedOrigins,

  /// Font family for chat text. Defaults to 'Roboto'.
  @Default('Roboto') String? fontFamily,

  /// Primary color for the chat interface in hex format.
  @Default('#3B82F6') String? color,

  /// Avatar image data. Note: This is excluded from JSON serialization.
  @unfreezed Uint8List? avatar,

  /// Whether the bot is running in preview mode.
  @Default(false) bool isPreviewMode,

  /// Configuration for the floating action button appearance.
  @Default(FabConfiguration()) FabConfiguration fabConfiguration,
}) = _BotConfiguration;