How do I get the JSON dump from a UDF Batch

I was successfully able to setup a custom UDF where it takes into BATCH and outputs STREAM. I however want to see the Batch and convert the JSON Structure for some into some specific structure.
How do I that within the UDF in Python?