I’m integrating openai with Gmail using pipedream. I’m trying to use the prior message history option, so that it’s a continuous conversation. What exactly do I write in the “Prior Message History” box?
Anything I tried putting in came back as invalid. I’m new to this, so please explain clearly.
Hi @dangptzabz , take a look at this blog post — there’s an example workflow there that passes prior message history. This is an array of objects in the format that OpenAI expects.
Thanks for the response
I want it to be a continuous conversation every time I trigger the workflow, so creating a chain workflow as is outlined in the blog won’t work. Is there a way to enter code into the prior message history box?
What format would I write that in?
Thank You
Yes, you can write code inside of any form input. Just add any Node.js expression within the {{ }}
, like in these docs.
If you want to store the entire chat history and pass it each time, you can also use a data store. You’d store each incoming message / assistant response there, reading it the next time your workflow runs and passing it to OpenAI.
Thank you for taking the time to respond.
I tried using a data store, and this is the response I get when I run it in prior history;
‘’'Configuration error
The following message doesn’t have a “role” property:
"[{“role”:“user”,“content”:“Hello”},{“role”:“assistant”,“content”:“Hello! How can I assist you today?”}]
See the docs here: OpenAI API’‘’
I can’t figure out what’s wrong with the format.