def to_dict()

in aidial_sdk/chat_completion/chunks.py [0:0]


    def to_dict(self):
        return {
            "choices": [
                {
                    "index": self.choice_index,
                    "delta": {
                        "content": None,
                        "tool_calls": [
                            remove_nones(
                                {
                                    "index": self.call_index,
                                    "id": self.id,
                                    "type": "function",
                                    "function": remove_nones(
                                        {
                                            "name": self.name,
                                            "arguments": self.arguments,
                                        }
                                    ),
                                }
                            )
                        ],
                    },
                }
            ],
            "usage": None,
        }