second_opinion_preprompts) from the main chat preprompts.
Each pre-prompt stores:
- a unique
key(used by clients), - the
publicValueshown in UI suggestion cards, - the
maskedValuesent to the LLM when user clicks the card, - optional
description(subtitle text) andtags.
Authentication
Administrative endpoints live under/api/v1/second-opinion/preprompts and are protected by the
backendSecretMiddleware. Send either:
BACKEND_SECRET is configured in your environment variables.
Surface area
| Action | Endpoint | Description |
|---|---|---|
| Create | POST /api/v1/second-opinion/preprompts | Create new suggestion card (admin) |
| List | GET /api/v1/second-opinion/preprompts | List all preprompts (admin) |
| Get | GET /api/v1/second-opinion/preprompts/{key} | Get specific preprompt (admin) |
| Update | PUT /api/v1/second-opinion/preprompts/{key} | Update preprompt (admin) |
| Delete | DELETE /api/v1/second-opinion/preprompts/{key} | Soft delete preprompt (admin) |
| Public | GET /api/v1/public/second-opinion/preprompts | Get public catalog (no auth) |
Quick start
- Create suggestion cards via the admin API (requires
BACKEND_SECRET). - Surface the public catalog (
GET /api/v1/public/second-opinion/preprompts) to end-users. - Render the cards in the Second Opinion UI for users to tap and get instant opinions.
second_opinion_preprompts collection.
Current PrePrompts
The following suggestion cards are currently configured:| Key | Display Text | Description |
|---|---|---|
groww_ipo | Groww IPO looks good… but should I actually apply? 🤔 | Understand hidden risks before subscribing. |
crypto_investment | Friend says crypto will 10x… should I invest my savings? 💰 | Get clarity on volatility and real risks. |
esop_worth | Boss offered ESOP… is it worth it? 🎯 | Know what you’re getting into. |
term_vs_investment | Should I buy term insurance or investment plan? 🛡️ | Understand what actually protects you. |
Frontend Integration
Front-ends should:- Fetch the public catalog on component mount
- Render the
publicValueas card titles anddescriptionas subtitles - When user taps a card, send
maskedValue(orpublicValuewith emojis stripped) to the Second Opinion API
maskedValue is intentionally kept separate to allow different text to be sent to the LLM
than what’s displayed to users (e.g., removing emojis, adding context).