I have a workflow that is designed to pass data from my DB to openai, get a structured json response back, the create a set of things based on that response. My aim is to have this all working back end.
The openai api response format is this
I have structured the prompt so the message content is a valid structured json.
However, when I then try and pass this json through (either as-is or using the formatted as json safe function) I always get errors.
I have got it working using the json machine plugin that can take the text from the openai response and provide filtered json as a state back to me. But this is only an option via front end workflows not back end.
Any ideas before I tear out my little remaining hair?