Welcome to the Silver Chatbot User Interface built using the Svelte framework. This interface allows users to engage with the Silver Chatbot, powered by OpenAI, in a seamless and interactive manner.
The provided Svelte component offers an intuitive and user-friendly chat interface where users can input queries and receive responses from the chatbot. The chatbot's responses are powered by OpenAI's GPT-like model.
Chatbot.svelte
).npm install
or yarn install
).npm run dev
or yarn dev
.http://localhost:5000
(default port).handleSubmit()
This function is called when the user submits a message. It initializes an event source to send and receive messages between the frontend and backend.
handleError(err)
This function handles errors during the communication and resets the chat state if an error occurs.
scrollToBottom()
This function scrolls the chat display to the bottom, ensuring the latest messages are always visible.
The chat display is implemented using the ChatMessage
component. It displays the conversation history, including messages from the user, chatbot, and loading indicators.