URL-based Chat Thread Creation and Prepopulation
How to Open New Threads and Prepopulate the Chat Input Using URL Parameters
Introduction
Navigating chat interfaces should be seamless, whether you're starting a fresh conversation or continuing where you left off. To enhance user experience, our platform allows you to control the chat window using URL parameters. These parameters enable automatic thread creation, query prepopulation, and even automatic message submission. Below, we break down how these features work and how you can use them effectively.
1. Opening a New Chat Thread
If you want to start a brand-new conversation without any prior context, use the thread=new
parameter.
-
Example URL:
app.ejento.ai?thread=new
-
Behavior:
A completely new chat thread is created, allowing you to begin a fresh discussion.
2. Prepopulating the Last Thread with a Query Parameter
Sometimes, you may want to continue your last conversation and prefill the chat input box with a query. You can achieve this using the query
parameter.
-
Example URL:
app.ejento.ai?query=How%20can%20I%20reset%20my%20password
-
Behavior:
The last created thread is opened, and the chat input box is prefilled with the provided query.
3. Prepopulating and Automatically Submitting a Query
To further streamline interactions, you can prepopulate the chat input and submit it automatically by adding the submit=true
parameter.
-
Example URL:
app.ejento.ai?query=How%20can%20I%20reset%20my%20password&submit=true
-
Behavior:
- The last thread is opened.
- The query is automatically inserted into the chat input box.
- After a short delay (1000ms), the query is submitted.
- The
query
andsubmit
parameters are removed from the URL after submission.
4. Creating a New Thread with a Prepopulated Query
If you want to start a fresh conversation while prepopulating the input field with a specific query, use both thread=new
and query
parameters.
-
Example URL:
app.ejento.ai?thread=new&query=How%20can%20I%20track%20my%20order
-
Behavior:
A new thread is created, and the chat input box is prefilled with the query.
5. Creating a New Thread and Submitting the Query Automatically
To combine the benefits of starting a new conversation and submitting a query instantly, use thread=new
, query
, and submit=true
parameters.
-
Example URL:
app.ejento.ai?thread=new&query=How%20can%20I%20track%20my%20order&submit=true
-
Behavior:
- A new chat thread is created.
- The input box is prefilled with the query.
- After 1000ms, the query is automatically submitted.
- The
thread=new
,query
, andsubmit=true
parameters are removed from the URL after submission to maintain a clean state.
Conclusion
Using these URL parameters, you can significantly enhance your chat experience, making interactions more efficient and intuitive. Whether you're starting a new conversation or resuming an existing one, these features ensure a smoother, faster workflow.
Try these options out and enjoy a more seamless chat experience!