Implementing Stream-based Real-time Chatbot Responses #6310
Replies: 3 comments 5 replies
-
Only one sentence comes to mind.
For bots, for Discord and especially for users on limited mobile connections. |
Beta Was this translation helpful? Give feedback.
-
We have no plans to implement this. The premise also seems flawed, because normal humans on Discord don't send long essays in a live stream, they send multiple shorter messages. You can train your AI to do the same thing if that's your goal. |
Beta Was this translation helpful? Give feedback.
-
Discord has the potential to become the leading front end for AI agents, it would be a shame to miss this opportunity... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Problem:
The current method of interacting with Language Models (LLMs) on Discord poses certain challenges for users seeking dynamic and engaging conversations. When a user sends a query or prompt to an LLM, the response is typically generated as a complete text block. While this approach provides the necessary information, it lacks the fluidity and real-time nature of a human-like conversation.
Imagine sending a question to an LLM and receiving a massive block of text as a response. Scanning through lengthy paragraphs to find the relevant information can be cumbersome and time-consuming. Moreover, the lack of real-time typing makes the interaction feel less interactive and engaging, as if you're merely reading a pre-scripted response.
This current experience also limits the user's ability to influence the direction of the conversation in real-time. Once the LLM generates the response, any further input or follow-up questions may not be as seamless, hindering the back-and-forth exchange that characterizes dynamic conversations.
Feature Proposal:
In light of recent advancements in artificial intelligence, more specifically Language Models (LLMs), the way we interact with chatbots is rapidly evolving. One notable advancement involves the capability of LLMs to generate outputs not as a complete text block, but in a character-by-character, stream-based format. This reflects a more organic, human-like conversation flow, which could revolutionize the expected behavior of chatbots.
The aim is to deliver this dynamic, real-time conversational experience within Discord. Envision a scenario where a user presents an AI prompt, and this AI responds within the Discord platform, streaming its response in real-time, akin to the way ChatGPT operates.
To achieve this, we propose the development of a new API endpoint that allows text output from an AI chatbot to be pushed into a Discord message incrementally. As an AI model generates the narrative step-by-step, each new line is pushed to Discord, effectively updating an existing message with additional content. On the Discord platform, message presentation would be animated or 'streamed', replicating the look and feel of real-time typing.
Following the streaming of the response, a cursor will indicate the temporary pause in conversation until either a timeout is reached, or the API endpoint receives an explicit instruction that the message is complete, signaling that no further content will be added.
Technical Considerations:
New API Endpoints Proposal
Creating a Message in Stream Mode
To initiate a new message in streaming mode, we propose adding a similar endpoint where a bot can create a new live message.
Parameters:
Should accept an object payload with the initial content and a status key
writing
for starting the real-time message.A successful
POST
request will respond with the initial content and themessage_id
can be used later forPATCH
requests to update the message with additional content.Example usage:
Response:
Updating an Existing Message
We suggest adding a new endpoint under the
Channels
Resource. This endpoint will be used for updating a specific existing message within a specific channel, using their respective IDs.Initiating a stream:
Parameters:
Accepts a JSON object containing the content to be appended to the message and a status key to indicate if the message is 'writing' (being updated) or 'finished' (no more content will be appended).
Example usage:
Modifications to the Existing API
To ensure a seamless user experience, this feature needs to be integrated with the existing typing indicator mechanism. For the
POST
request, initiating a new live message should trigger the typing indicator in the associated channel. Similarly, for thePATCH
request, the typing indicator start triggering as soon as the 'status' is set to 'writing' and should stop upon receiving thefinished
status.This active text streaming feature would revolutionize chatbot interactions on Discord. It carries the potential to offer a more dynamic, engaging conversation mode with chatbots, thus improving user interactivity drastically. Furthermore, it opens up avenues for several interesting applications on the Discord platform including but not limited to real-time transcription services, collaborative editing, AI-based real-time conversations, and more.
As a community member, I think the introduction of this new feature could be a significant step towards enhancing the overall Discord experience. I look forward to hearing everybody's thoughts, feedback, and any possible suggestions for improvement.
Some parts of the text and the examples were generated by an LLM.
Beta Was this translation helpful? Give feedback.
All reactions