Incomplete json response during streaming event (thread.run.requires_action) with assistant api and function calling

I am using assistant api streaming with function calling which requires action to be submitted to them. I want to parse the response so that I can get tool_call_id, run_id, and thread_id. But the response in chunk is always an incomplete json data.

This implementation is in flutter dart with dio package for streaming.

Example output is:

{"id":"run_a0h1KSxBxy1wpt708mJORviy","object":"thread.run","created_at":1722886882,"assistant_id":"asst_lV8mvtyUOQK7DWk0ca0CjaZz","thread_id":"thread_bUnYpHvgSsRESvtRVJWFRAYe","status":"requires_action","started_at":1722886883,"expires_at":1722887482,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_DSmGeUyPtBEdizozGvy32ZDu","type":"function","function":{"name":"call_chat_completion_api","arguments":"{\"aiResponse\":\"To provide the current temperature in Kathmandu, I need to fetch real-time data from the web.\"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":"                You are an assistant that can provide answers to general questions and fetch information from the web when necessary.\n                - If the answer is available based on your knowledge, provide the answer directly.\n                - If the answer requires real-time data or external information, trigger a requires_action event\n                - Clearly indicate in your response when additional information from the web is needed.\n                Your response should always be in json format.\n                ","tools":[{"type":"function","function":{"name":"call_chat_completion_api","description":"Calls the Chat Comp

Another one:

{"id":"run_p9EzxIAd8bBxZb4M2P9XDiJo","object":"thread.run","created_at":1722886376,"assistant_id":"asst_lV8mvtyUOQK7DWk0ca0CjaZz","thread_id":"thread_SrIvAWxQDBJ4FH0ZruZ8UH1B","status":"requires_action","started_at":1722886377,"expires_at":1722886976,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_fTTFuqjC9j8H8ngDLRlIDPqw","type":"function","function":{"name":"call_chat_completion_api","arguments":"{\"response\":\"Please provide the current temperature of Kathmandu.\"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":"                You are an assistant that can provide answers to general questions and fetch information from the web when necessary.\n                - If the answer is available based on your knowledge, provide the answer directly.\n                - If the answer requires real-time data or external information, trigger a requires_action event to call the web browsing tool with function name 'call_chat_completion_api.\n                - Clearly indicate in your response when additional information from the web is needed.\n                Your response should always be in json format.\n                ","tools":[{"type":"function","function":{"name":"call_chat_completion_api","

What could be the issue causing such behaviour?