- Issue created by @arwillame
- 🇩🇪Germany marcus_johansson
Ah, it needs have exception handling in the automators.
How the decode method works is that if it can't find any working JSON in the message it just returns the message or the streaming message so you can continue outputting it. This is useful when you ask for conditionals like in the Assisstants API where you might want a JSON or you might want to output a message back to the user, it will give back the message when its not using JSON.
So the solution would be simple, to check the output and throw exceptions when its wrong.
- 🇩🇪Germany marcus_johansson
Thank you @arwillame - could I ask one more thing from your - in this folder there is files with test results that are use against this function, could you add one example where the previous code failed and where this would pass?
https://git.drupalcode.org/project/ai/-/tree/1.0.x/tests/assets/test-pro...
If you don't have the time, let me know and I'll try to add a test for it.