Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions api-reference/chat-profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,37 @@ async def on_chat_start():
content=f"starting chat with {user.identifier} using the {chat_profile} chat profile"
).send()
```

## Dynamic Configuration

You can override the global `config.toml` for specific ChatProfiles by configuring overrides

```python
from chainlit.config import (
ChainlitConfigOverrides,
FeaturesSettings,
McpFeature,
UISettings,
)

@cl.set_chat_profiles
async def chat_profile(current_user: cl.User):
return [
cl.ChatProfile(
name="MCP Enabled",
markdown_description="Profile with **MCP features enabled**. This profile has *Model Context Protocol* support activated. [Learn more](https://example.com/mcp)",
icon="https://picsum.photos/250",
starters=starters,
config_overrides=ChainlitConfigOverrides(
ui=UISettings(name="MCP UI"),
features=FeaturesSettings(
mcp=McpFeature(
enabled=True,
stdio={"enabled": True},
sse={"enabled": True},
streamable_http={"enabled": True},
)
),
),
),
```
2 changes: 2 additions & 0 deletions backend/config/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "Overview"

The `.chainlit/config.toml` file is created when you run `chainlit run ...` or `chainlit init`. It allows you to configure your Chainlit app and to enable/disable specific features.

You can also dynamically override specific `config.toml` variables by Chat Profile at runtime. See [Dynamic Profile-based Configuration](/api-reference/lifecycle-hooks/on-profile-switch) for details.

It is composed of three sections:

<CardGroup cols={2}>
Expand Down