Closed thucpn closed 2 months ago
Latest commit: d6215cf7ec15f9d557961e1743bee03fe5f5dbe5
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The recent changes introduce conversation starters to the chat functionality across various frameworks (Next.js, Express, FastAPI). These starters are fetched from environment variables and displayed to users when no chat messages are present. The changes include new API endpoints, hooks, and functions to handle the retrieval and display of these starter questions.
File(s) | Change Summary |
---|---|
helpers/env-variables.ts |
Added environment variables for "nextjs" including CONVERSATION_STARTERS . |
.../components/ui/html/chat/chat-messages.tsx |
Introduced append function to handle new messages. |
.../components/chat-section.tsx |
Added append function from useChat hook. |
.../components/ui/chat/chat-messages.tsx |
Added logic to display starter questions as buttons when no messages are present. |
.../api/chat/config/route.ts |
Introduced API endpoint to retrieve chat configuration data. |
.changeset/ten-badgers-learn.md |
Added patch notes for conversation starter functionality. |
.../express/src/controllers/chat-config.controller.ts |
Added controller to handle chat configuration requests. |
.../express/src/routes/chat.route.ts |
Added route for chat configuration endpoint. |
.../fastapi/app/api/routers/chat.py |
Added class and endpoint for chat configuration. |
.../components/ui/chat/chat.interface.ts |
Added append method to ChatHandler interface. |
.../components/ui/chat/use-config.ts |
Introduced useClientConfig hook to fetch chat configuration. |
sequenceDiagram
participant User
participant ChatUI
participant ConfigAPI
participant EnvVariables
User->>ChatUI: Opens chat
ChatUI->>ConfigAPI: Fetch chat configuration
ConfigAPI->>EnvVariables: Retrieve starter questions
EnvVariables-->>ConfigAPI: Return starter questions
ConfigAPI-->>ChatUI: Provide starter questions
ChatUI-->>User: Display starter questions
User->>ChatUI: Selects starter question
ChatUI->>ConfigAPI: Append new message
ConfigAPI-->>ChatUI: Confirm message appended
ChatUI-->>User: Display new message
In the chat, where silence looms,
Conversation starters bloom.
From the backend, questions flow,
Helping users start the show.
With buttons bright, no need to fear,
Just click and let your thoughts appear.
A rabbit's touch, simple and clear! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
useClientConfig
to retrieve chat configuration.Enhancements
Bug Fixes
Documentation