You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add Dynamic Configuration to ChatProfiles (#2401)
## Changes:
- Audio.enabled and MCP.enabled now must be explicitly enabled. Before
it was inferred if on_audio_chunk and on_mcp_connect existed. This
enables selective enablement by ChatProfile now.
- Documentation Update PR: Chainlit/docs#256
## ✅ Backend Implementation Complete
- ChainlitConfigOverrides class in config.py - allows specifying UI,
features, and project overrides
- ChatProfile.config_overrides field - stores profile-specific
configuration overrides
- /project/settings endpoint enhancement - applies config overrides
based on the chat_profile parameter
- Proper serialization - removes config_overrides from profiles sent to
frontend (they're applied server-side)
- Pydantic dataclass rebuild - fixes forward reference issues
## ✅ Frontend Implementation Complete
- Enhanced useConfig hook - includes chat_profile parameter in API calls
- Automatic re-fetching - clears config when chat profile changes to
trigger re-fetch with new profile-specific settings
## 🎯 How It Works
- Default state: Frontend calls /project/settings?language=en-US → gets
base configuration
- Profile selection: User selects "vision-assistant" → chatProfileState
updates
- Config refresh: Frontend clears config and calls
/project/settings?language=en-US&chat_profile=vision-assistant
- Server merges: Backend finds vision-assistant profile, applies its
config_overrides to base config
- Frontend receives: Merged configuration with vision-assistant's UI
name, file upload settings, etc.
## Other:
- Added "UP007" to ruff ignore because it was flagging these when using
Optional[str] which is valid.
<img width="474" height="147" alt="image"
src="https://github.com/user-attachments/assets/cfbcf0d6-68e6-4bc6-aeee-539014a52b2d"
/>
Fixes#1502
---------
Co-authored-by: Aleksandr Vishniakov <[email protected]>
0 commit comments