"""ChatCompletionChunkObject class
"""
from databricks_genai_inference.api.abstract.foundation_model_object import FoundationModelObject


class ChatCompletionChunkObject(FoundationModelObject):
    """
    A class representing a chunk of completed chat message generated by the model, when `stream` is set True.
    """

    @property
    def message(self):
        """
        Returns the message content from the chat completion API response.

        Returns:
            str: The message content.
        """
        return self.response['choices'][0]['delta']["content"]
