Why OpenAI doesn't contain "messages" prop to send the chat history?

Just wondering. For any conversational chatbot you need to send the chat history to GPT.
So it’s reasonable to expect the messages prop like described in the documentation

Moreover, it’s required. It means that OpenAI in chat mode sends whatever is given in the Prompt section:

This looks odd. You send a manualy-defined bunch of fields, but you can’t send the history of previous interactions.

What I suggest: add the messages option to load the chat history as an array. The Prompt fields are just pushed to this array following by sending the whole array to GPT.

Hey @artildo,

The Prompt option we have maps to the messages in the documentation so you can have multiple prompts and include the content for the roles as needed.

We could maybe look at providing a raw json field for this as well to make it a bit easier.

@Jon Thanks for reply. Unfortunately, I can’t send the WHOLE history. I might send 1 last message with reply, 3 last message or like that. It depends on how many fields I create maually.

In this example I’m able to send 3 pieces of chat: a request, a reply, a new request. But what if I have to send 20 or 50 messages? There’s no possibility to create these fields dynamically

And this HTTP request sends the messages property in the right way - as a dynamic array of messages:

upd I found similar request here: Allow to use a dynamic list as user/assistant prompts for chats in OpenAI

Hey @artildo,

Perfect so it would be the json field option to have something more dynamic. It might be worth putting a vote on that feature request you found.


@I addeb my vote. Still only 2 votes so I’ll have to use HTTP request to send the chat history.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.