Skip to content

Reusing conversations in OpenaiChat provicer #3201

@molkemon

Description

@molkemon

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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedthis issue was recently fixedstale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions