PupauConfig class

Configuration class for Pupau Agent package

Constructors

PupauConfig.createWithApiKey({required String apiKey, String? apiUrl, String? conversationId, bool isAnonymous = false, PupauLanguage language = PupauLanguage.en, String? googleMapsApiKey, bool hideInputBox = false, WidgetMode widgetMode = WidgetMode.full, SizedConfig? sizedConfig, FloatingConfig? floatingConfig, bool showNerdStats = false, bool hideAudioRecordingButton = false, dynamic customProperties, List<String> conversationStarters = const [], AppBarConfig? appBarConfig, DrawerConfig? drawerConfig, bool resetChatOnOpen = true, String? initialWelcomeMessage})
Factory constructor for creating config with API key
factory
PupauConfig.createWithToken({required String bearerToken, required String assistantId, String? apiUrl, bool isMarketplace = false, String? conversationId, bool isAnonymous = false, PupauLanguage language = PupauLanguage.en, String? googleMapsApiKey, bool hideInputBox = false, WidgetMode widgetMode = WidgetMode.full, SizedConfig? sizedConfig, FloatingConfig? floatingConfig, bool showNerdStats = false, bool hideAudioRecordingButton = false, dynamic customProperties, List<String> conversationStarters = const [], AppBarConfig? appBarConfig, DrawerConfig? drawerConfig, bool resetChatOnOpen = true, String? initialWelcomeMessage})
Factory constructor for creating config with bearer token
factory

Properties

apiKey String?
API key for authentication
final
apiUrl String?
Override the base API URL. If null, defaults to https://api.pupau.ai.
final
appBarConfig AppBarConfig?
Configuration for the app bar.
final
assistantId String
The id of the assistant to use.
final
authHeaders Map<String, String>?
Returns the appropriate header key and value for authentication as a Map. For static access, use PupauConfig.getAuthParams() instead.
no setter
bearerToken String?
Bearer token for authentication
final
conversationId String?
If set when entering the chat page, the conversation with this id will be loaded. If not set, a new conversation will be created on first message sent.
final
conversationStarters List<String>
List of predefined messages that will be displayed in an empty conversation. The user can tap on a message to start the conversation with it.
final
customProperties → dynamic
Custom properties, useful to pass custom data to the agent.
final
drawerConfig DrawerConfig?
Configuration for the drawer and end drawer.
final
floatingConfig FloatingConfig?
Configuration for floating widget mode. Only used when widgetMode is WidgetMode.floating.
final
googleMapsApiKey String?
API key for Google Maps used for Google Map syntax builder.
final
hashCode int
The hash code for this object.
no setterinherited
hideAudioRecordingButton bool
Whether the audio recording button is hidden. See README for details on permissions setup.
final
hideInputBox bool
Whether to hide the input box. Defaults to false.
final
initialWelcomeMessage String?
Optional welcome message passed by the host (e.g. from a list). Used when the assistant from getAssistants has no welcome message, so the chat can show it immediately without waiting for getAssistant. Ignored once the API returns a welcome message.
final
isAnonymous bool
Whether the chat will be anonymous, ignores conversation id if true. Defaults to false.
final
isMarketplace bool
Whether the assistant is a marketplace assistant. Defaults to false.
final
language PupauLanguage
Language used for translations in the plugin. Defaults to PupauLanguage.en.
final
resetChatOnOpen bool
Whether to reset the chat state on open. Defaults to true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showNerdStats bool
Whether to show stats regarding tokens, credits and context size. Defaults to false.
final
sizedConfig SizedConfig?
Configuration for sized widget mode. Only used when widgetMode is WidgetMode.sized.
final
widgetMode WidgetMode
Widget mode. Defaults to full.
final

Methods

copyWith({String? apiUrl, bool? isMarketplace, String? conversationId, bool? isAnonymous, PupauLanguage? language, String? googleMapsApiKey, bool? hideInputBox, WidgetMode? widgetMode, SizedConfig? sizedConfig, FloatingConfig? floatingConfig, bool? showNerdStats, bool? hideAudioRecordingButton, dynamic customProperties, List<String>? conversationStarters, AppBarConfig? appBarConfig, DrawerConfig? drawerConfig, String? initialWelcomeMessage}) PupauConfig
Creates a copy of this config with the given fields replaced with new values. Note: apiKey, assistantId, and bearerToken cannot be changed as they are locked at creation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

assistantIdFromApiKey(String apiKey) String