I have been stuck at this spot for a few days now, hoping for an assist. Also I know how JSON responses are handled in FF is rapidly updating, so I am just unsure which is the best method.
Goal is to rebuilt the thread by looping through the output of a response from the listMessages endpoint.
I have done several tutorials but mainly they focus on building it for the first time, not reloading an existing one. I structured my data types like it is done in this video. I added role and time to this one, but I may adjust that if needed.
Tutorial I followed: https://youtu.be/rWArVlymIPw?t=2222
OpenAI docs - https://platform.openai.com/docs/api-reference/messages/listMessages
I can't figure out how to properly pull data out of this structure.
Here is a simplified version of it for quick reference. I want to reference 3 fields in the list view -
role, created_at and text.value
{
"object": "list",
"data": [
{
"created_at": 1699016383,
"role": "user",
"content": [
{
"type": "text",
"text": {
"value": "How does AI work? Explain it in simple terms."
}
}
]
},
{ repeats }
]
}
Any help with this is greatly appreciated. Thanks!