userContext property
Free-form host-app context forwarded to the bot on every
/api/chat/ request and surfaced into the system prompt.
Use this to give the LLM facts about the current user that aren't
already visible from the message history — e.g. Pro entitlement
state, current hand-analysis ID, last design they viewed, skin
tone, accessibility preferences. The backend reads it from the
request body and inlines it into the system prompt under a
dedicated <user_context> section.
Keep payloads small (a few KB max) — every key here is tokenised per turn. Don't include large blobs, image bytes, or PII the bot doesn't need. Map values must be JSON-serialisable.
Example:
BotConfiguration(
userID: '42',
projectSecretKey: '...',
userContext: {
'pro': true,
'hand_analysis_id': 'h_abc',
'last_design_id': 789,
'skin_tone_fitzpatrick': 4,
},
)
Implementation
String get defaultThemeMode;/// Free-form host-app context forwarded to the bot on every
/// `/api/chat/` request and surfaced into the system prompt.
///
/// Use this to give the LLM facts about the current user that aren't
/// already visible from the message history — e.g. Pro entitlement
/// state, current hand-analysis ID, last design they viewed, skin
/// tone, accessibility preferences. The backend reads it from the
/// request body and inlines it into the system prompt under a
/// dedicated `<user_context>` section.
///
/// Keep payloads small (a few KB max) — every key here is tokenised
/// per turn. Don't include large blobs, image bytes, or PII the bot
/// doesn't need. Map values must be JSON-serialisable.
///
/// Example:
/// ```dart
/// BotConfiguration(
/// userID: '42',
/// projectSecretKey: '...',
/// userContext: {
/// 'pro': true,
/// 'hand_analysis_id': 'h_abc',
/// 'last_design_id': 789,
/// 'skin_tone_fitzpatrick': 4,
/// },
/// )
/// ```
Map<String, dynamic>? get userContext;