BotConfiguration constructor
const
BotConfiguration({
- required String userID,
- required String projectSecretKey,
- LocalizedText? welcomeMessage,
- LocalizedText? name,
- LocalizedText? systemInstructions,
- @Default.new('en') String defaultLocale,
- @Default.new(['en']) List<
String> supportedLocales, - String? currentLocale,
- String? allowedOrigins,
- @Default.new('Roboto') String? fontFamily,
- @Default.new('#3B82F6') String? color,
- @unfreezed Uint8List? avatar,
- @Default.new(false) bool isPreviewMode,
- @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;