Closed rendomnet closed 1 year ago
It comes from the previous message in the conversation.
@terminalcommandnewsletter Sorry I cant find the step where we create the conversation.
See the "The process of asking ChatGPT a question" section.
See the "The process of asking ChatGPT a question" section.
Yes and there is no call for creating the conversation.
In this section we already using the parent_message_id
First, we make a POST request to /backend-api/conversation
with a request body like this:
action: next
messages (Array):
|__ (Object):
|____ author (Object):
|______ role: user
|____ content (Object):
|______ content_type: text
|______ parts (Array):
|________ What is ChatGPT?
|__ id: 0c[redacted]91
|__ role: user
model: text-davinci-002-render-sha
parent_message_id: a0[redacted]7f
This responds with an EventStream which ends with a [DONE] signal. You can view a sample response in sample/conversation-event-stream.txt.
First, we make a POST request to
/backend-api/conversation
with a request body like this:action: next messages (Array): |__ (Object): |____ author (Object): |______ role: user |____ content (Object): |______ content_type: text |______ parts (Array): |________ What is ChatGPT? |__ id: 0c[redacted]91 |__ role: user model: text-davinci-002-render-sha parent_message_id: a0[redacted]7f
This responds with an EventStream which ends with a [DONE] signal. You can view a sample response in sample/conversation-event-stream.txt.
Yes and where parent_message_id
value come from?
First, we make a POST request to
/backend-api/conversation
with a request body like this:action: next messages (Array): |__ (Object): |____ author (Object): |______ role: user |____ content (Object): |______ content_type: text |______ parts (Array): |________ What is ChatGPT? |__ id: 0c[redacted]91 |__ role: user model: text-davinci-002-render-sha parent_message_id: a0[redacted]7f
This responds with an EventStream which ends with a [DONE] signal. You can view a sample response in sample/conversation-event-stream.txt.
To make this request we first need to have parent_message_id
and id
values right?
I'm currently not able to check. I'll check it once I can and get back to you.
@terminalcommandnewsletter without this values post request returns error.
@terminalcommandnewsletter Any updates on this?
Hi! Sorry for the late response. The request (even on first message) already starts with a message ID and parent message ID.
I'm assuming this is generated on the client-side, though you can use any values as the message ID (changing the parent message ID to anything else returns an error "Hmm...something seems to have gone wrong." since that is used to link conversations) such as "13371337-1337-1337-1337-133713371337" and the server will correct it to use a different message ID (such as "f0[redacted]a0").
Hope this answers your question.
This is quite interesting. When I refreshed the page and clicked on each conversation, I found 3 conversations all containing a message with an id of 13371337-1337-1337-1337-133713371337 which is just crazy :laughing: (more so the multiple conversations with messages with the same ID).
Edit: Using a past message ID with this new message ID creates multiple conversations!
@terminalcommandnewsletter It is peculiar that we generate these IDs on the client side as they may intersect. Additionally, it seems odd to generate the parent_message_id during the initial call. We should make sure to document this process.
Agreed.
Hi. Any updates on this? Why did you closed it.
There's not much more information and the initial question you had was answered. If there's any related question you want to ask, feel free to comment that and I'll reopen the issue and solve.
There's not much more information and the initial question you had was answered. If there's any related question you want to ask, feel free to comment that and I'll reopen the issue and solve.
After conducting my own research, I have come to the conclusion that when initiating a conversation, it is necessary to generate a message ID and a parent ID. However, I'm unsure of the exact purpose of the parent ID in the initial call. Subsequently, to obtain the conversation ID, we must make a call to the conversations endpoint and search for our specific conversation after our initial call.
Yes. This is what the web app does. After the first message, it fetches the list of conversations and updates the sidebar. Then, it calls a generate title API and fetches the list again to update it.
Is there an existing issue for this?
Issue
In your example where parent_message_id and id values come from?
CONTRIBUTING.md
CONTRIBUTING.md