Hello everyone, I’m trying to have Glide AI generate a JSON string based on the reading of a transfer receipt.
The instruction I provide is this:
The problem is that, with some receipts, it reads well, but with others, it forms a seemingly broken JSON string, and therefore, when I try to extract each piece of data through a JSON Query column, they stop working.
Malformed JSON generated by the AI.:
Is there something wrong with the instructions I’m providing?
I have talked with Bob about this, since OpenAI does have an option to force returning JSON, if Glide can do it, give us a checkbox to force returning JSON or not.
I found the chat to text integration in which you pass an image along with the prompt tended to generate the issue above.
I tried a custom action involving a number of steps. In step 1 I ran the chat to text and returned some text, then in step 2 I ran the text to JSON. This led to issues with blank results.
The significant delays in running step 1 seemed difficult to manage even after inserting a ‘wait with condition’ action in-between.
In the end the solution I tested above uses 1 step, avoids the delay shenanigans and works ok.
@david because Each run uses 1 update and JSON Query doesn’t @Simon_Hill Thanks, I’m going to try this recommendation along with another one that was sent to me by private message
Say for Simon’s use case above, would you consider supporting image as an input for the Text to JSON action/column? I think the only action/column where image is supported is “Complete chat” in OpenAI.
Upload Image
Document to Text pointed to Upload Image (5 Updates)
Text to JSON pointed to Document to Text with all defined objects (1 Update)
1 Query JSON per object pointed to Document to Text to extract the specific information (No Updates)
I tried Image to Text which is only 1 update, but found it less consistent.