Using AI in workflow to generate python scipt that will create base64 images

I am trying to use GPT to create executable Python code in the next block in a workflow. The Python code it generates is correct, if I copy and paste the code into the Python code block it works fine. But If I reference the data from the previous block "{{AIPlot.data}}" I get this error "TypeError: unhashable type: 'set' (line 1)". Can anyone help?