Skip to main content

Chat UI Configuration

The app/chat/config.ts file serves as the central control center for the chat interface. It allows developers to toggle features, tune animations, and adjust AI behaviors without needing to modify multiple files or restart the server with new environment variables.

Configuration Hierarchy

Core Settings

UI Features

Controls the visibility of various interface elements:

SettingDefaultDescription
showThinkingBartrueShows the "thinking" indicator while AI processes
showTimestampstrueDisplays time next to messages
showDiagnosticsReportstrueShows technical details for debugging
showContextPillstrueDisplays extracted context (budget, recipient)

Animations

Controls the feel of the chat interaction:

  • Streaming Speed: 20 chars/sec (adjustable)
  • Preset: fadeIn (Options: dropIn, blurIn, slideInFromLeft, typewriter)

Context Enrichment (Smart Questions)

This feature enables the AI to proactively ask clarifying questions to gather better context for recommendations.

Configuration Options

  • maxQuestions: Limits how many questions to ask (Default: 3)
  • requireProducts: Only ask if products were successfully found (Default: true)
  • minConfidence: Threshold to prevent asking when uncertain (Default: 0.6)

Product Descriptions (Conversion Optimization)

Controls how the AI describes products to maximize engagement and conversion.

Tone & Style

  • Tone: enthusiastic (Default), friendly, professional, or standard
  • Conversion Language: Uses persuasive phrases like "Perfect gift!" or "Highly recommended"
  • Benefit Emphasis: Focuses on value rather than just features

Length Control

  • sentencesPerProduct: 4 sentences (Optimal for detail)
  • maxWords: 220 words total response limit

[!TIP] Optimization Guide:

  • Higher Conversion: Keep default settings (Enthusiastic, 4 sentences)
  • Mobile/Fast: Reduce to 2 sentences, 140 words
  • Professional/B2B: Switch tone to 'professional', disable conversion language