HocusPocus
HocusPocus3mo ago

JSON object in OpenAI Request

Hi all, I want to make an OpenAI API request by giving the message as an array, denoted as: "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Who won the world series in 2020?" } ] Since I want to give the chat history this seems the way OPENAI accepts the messages. However the messages key is not passed in my request. How can I solve this?
No description
No description
No description
No description
Solution:
I was too quick to post it 🙂 I solved it by putting the messages array in the Body.
Jump to solution
3 Replies
AI Support
AI Support3mo ago
To resolve the issue of passing the messages key in your OpenAI API request, you can use the "Add Object to Firestore Array" node. This node will help you structure your data correctly so that the messages key is included in your request. For more detailed guidance, you can refer to the BuildShip documentation on how to build custom nodes using AI: Building Custom Node via AI. If you still face issues, please submit your query via the in-app support button.
Solution
HocusPocus
HocusPocus3mo ago
I was too quick to post it 🙂 I solved it by putting the messages array in the Body.
AI Support
AI Support3mo ago
That's great to hear that you solved your issue! If you have any further questions or need additional information, you can always refer to the BuildShip documentation or submit your query via the in-app support button.