-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
Description
Hello, I have found several issues on this already but in none is a solution that I can understand.
Obviously I can just include the entire message history in the request, and this works, but it takes a lot of tokens and also it creates a new conversation on the chatgpt homepage for each turn which is obviously undesireable.
I want to reuse an existing conversation, but it seems no matter what I do, it will always generates a new conv.

I have tried several things, including this, but that does not seem to do anything (the vars do have the correct ids though, so that works)
completion = await client.chat.completions.create({
provider: "OpenaiChat",
model: "gpt-5",
temperature: temp,
messages: messagesToSend,
stream: false,
conversation: {
conversation_id: g4fState.conversation_id || undefined,
parent_message_id: g4fState.parent_message_id || undefined,
user_id: g4fState.user_id || undefined
},
conversation_id: g4fState.conversation_id || undefined,
parent_message_id: g4fState.parent_message_id || undefined
});
A clear example on how to do this would be appreciated, the documentation for the js does not mention conversation history at all.