Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /Chainlit_chainlit /cypress /e2e /modes /main.py
| """Test app for Modes picker e2e tests.""" | |
| import chainlit as cl | |
| async def start(): | |
| """Set up modes for the picker.""" | |
| await cl.context.emitter.set_modes( | |
| [ | |
| cl.Mode( | |
| id="model", | |
| name="Model", | |
| options=[ | |
| cl.ModeOption( | |
| id="gemini_3_pro", | |
| name="Gemini 3 Pro", | |
| description="Most capable and intelligent", | |
| icon="sparkles", | |
| default=False, | |
| ), | |
| cl.ModeOption( | |
| id="gemini_3_flash", | |
| name="Gemini 3 Flash", | |
| description="Quick and efficient", | |
| icon="bolt", | |
| default=True, | |
| ), | |
| ], | |
| ), | |
| cl.Mode( | |
| id="reasoning", | |
| name="Reasoning", | |
| options=[ | |
| cl.ModeOption( | |
| id="high", | |
| name="High", | |
| description="Maximum depth analysis", | |
| icon="flame", | |
| default=False, | |
| ), | |
| cl.ModeOption( | |
| id="medium", | |
| name="Medium", | |
| description="Balanced approach", | |
| icon="scale", | |
| default=True, | |
| ), | |
| cl.ModeOption( | |
| id="low", | |
| name="Low", | |
| description="Quick responses", | |
| icon="rocket", | |
| default=False, | |
| ), | |
| ], | |
| ), | |
| ] | |
| ) | |
| async def on_message(message: cl.Message): | |
| """Echo the message with the selected modes.""" | |
| modes = message.modes or {} | |
| selected_model = modes.get("model", "No model selected") | |
| selected_reasoning = modes.get("reasoning", "No reasoning selected") | |
| await cl.Message( | |
| content=f"Model: {selected_model}\nReasoning: {selected_reasoning}\n\nYour message: {message.content}" | |
| ).send() | |
Xet Storage Details
- Size:
- 2.3 kB
- Xet hash:
- 9159f7210eeb647f3b9f12447a82709c92192dcd2560931a4278cabbc3382f50
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.