Skip to content

Conversation

hayescode
Copy link
Contributor

@hayescode hayescode commented Aug 12, 2025

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hayescode hayescode merged commit 5d037d8 into main Aug 18, 2025
1 check passed
@hayescode hayescode deleted the feat/on_profile_switch branch August 18, 2025 13:59
github-merge-queue bot pushed a commit to Chainlit/chainlit that referenced this pull request Aug 18, 2025
## 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 <asvishnyakov@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants