def _get_streaming_chunk_content(self, chunk: str) -> Dict:
        """
        Extract json from chunks received from llamafile API streaming calls.

        When streaming is turned on, llamafile server returns lines like:

        'data: {"content":" They","multimodal":true,"slot_id":0,"stop":false}'

        Here, we convert this to a dict and return the value of the 'content'
        field
        """
        if chunk.startswith("data:"):
            cleaned = chunk.lstrip("data: ")
            return json.loads(cleaned)
        else:
            raise ValueError(
                f"Received chunk with unexpected format during streaming: '{chunk}'"
            )

        Extract json from chunks received from llamafile API streaming calls.

        When streaming is turned on, llamafile server returns lines like:

        'data: {"content":" They","multimodal":true,"slot_id":0,"stop":false}'

        Here, we convert this to a dict and return the value of the 'content'
        field
        
llama-index-integrations/llms/llama-index-llms-llamafile/llama_index/llms/llamafile/base.py