How to send formatted json data to labels and prettify it?

I’m a newbie in Grafana Loki plugin and I have one very interesting question.
Recently, I set up self-hosted grafana-server and Loki like systemctl services.
Writing own python library to send data from Django requests took time and I have the problem.
While sending dict object to Loki in my "stream" : {} object, I get error, so I use either json.dumps(dict) or f"{dict}" formats of my json headers and json_body:

My working configuration is:

data = {
            "streams": [
                    "stream": {
                        "levelname": record.levelname,
                        "headers": f"{record.message['headers']}",
                        "json_body": f"{record.message['json_body']}"
                    "values": [

How can I send properly json format dicts to labels to make them real json on the first screen and properly prettify them like I do on the second screen?