from datetime import date, datetime  # noqa: F401
from typing import Dict, List  # noqa: F401

from timestep.api.openai.v1 import util
from timestep.api.openai.v1.models.base_model import Model
from timestep.api.openai.v1.models.chat_completion_stream_response_delta import \
    ChatCompletionStreamResponseDelta  # noqa: E501
from timestep.api.openai.v1.models.create_chat_completion_response_choices_inner_logprobs import \
    CreateChatCompletionResponseChoicesInnerLogprobs  # noqa: E501


class CreateChatCompletionStreamResponseChoicesInner(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, delta=None, logprobs=None, finish_reason=None, index=None):  # noqa: E501
        """CreateChatCompletionStreamResponseChoicesInner - a model defined in OpenAPI

        :param delta: The delta of this CreateChatCompletionStreamResponseChoicesInner.  # noqa: E501
        :type delta: ChatCompletionStreamResponseDelta
        :param logprobs: The logprobs of this CreateChatCompletionStreamResponseChoicesInner.  # noqa: E501
        :type logprobs: CreateChatCompletionResponseChoicesInnerLogprobs
        :param finish_reason: The finish_reason of this CreateChatCompletionStreamResponseChoicesInner.  # noqa: E501
        :type finish_reason: str
        :param index: The index of this CreateChatCompletionStreamResponseChoicesInner.  # noqa: E501
        :type index: int
        """
        self.openapi_types = {
            'delta': ChatCompletionStreamResponseDelta,
            'logprobs': CreateChatCompletionResponseChoicesInnerLogprobs,
            'finish_reason': str,
            'index': int
        }

        self.attribute_map = {
            'delta': 'delta',
            'logprobs': 'logprobs',
            'finish_reason': 'finish_reason',
            'index': 'index'
        }

        self._delta = delta
        self._logprobs = logprobs
        self._finish_reason = finish_reason
        self._index = index

    @classmethod
    def from_dict(cls, dikt) -> 'CreateChatCompletionStreamResponseChoicesInner':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The CreateChatCompletionStreamResponse_choices_inner of this CreateChatCompletionStreamResponseChoicesInner.  # noqa: E501
        :rtype: CreateChatCompletionStreamResponseChoicesInner
        """
        return util.deserialize_model(dikt, cls)

    @property
    def delta(self) -> ChatCompletionStreamResponseDelta:
        """Gets the delta of this CreateChatCompletionStreamResponseChoicesInner.


        :return: The delta of this CreateChatCompletionStreamResponseChoicesInner.
        :rtype: ChatCompletionStreamResponseDelta
        """
        return self._delta

    @delta.setter
    def delta(self, delta: ChatCompletionStreamResponseDelta):
        """Sets the delta of this CreateChatCompletionStreamResponseChoicesInner.


        :param delta: The delta of this CreateChatCompletionStreamResponseChoicesInner.
        :type delta: ChatCompletionStreamResponseDelta
        """
        if delta is None:
            raise ValueError("Invalid value for `delta`, must not be `None`")  # noqa: E501

        self._delta = delta

    @property
    def logprobs(self) -> CreateChatCompletionResponseChoicesInnerLogprobs:
        """Gets the logprobs of this CreateChatCompletionStreamResponseChoicesInner.


        :return: The logprobs of this CreateChatCompletionStreamResponseChoicesInner.
        :rtype: CreateChatCompletionResponseChoicesInnerLogprobs
        """
        return self._logprobs

    @logprobs.setter
    def logprobs(self, logprobs: CreateChatCompletionResponseChoicesInnerLogprobs):
        """Sets the logprobs of this CreateChatCompletionStreamResponseChoicesInner.


        :param logprobs: The logprobs of this CreateChatCompletionStreamResponseChoicesInner.
        :type logprobs: CreateChatCompletionResponseChoicesInnerLogprobs
        """

        self._logprobs = logprobs

    @property
    def finish_reason(self) -> str:
        """Gets the finish_reason of this CreateChatCompletionStreamResponseChoicesInner.

        The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.   # noqa: E501

        :return: The finish_reason of this CreateChatCompletionStreamResponseChoicesInner.
        :rtype: str
        """
        return self._finish_reason

    @finish_reason.setter
    def finish_reason(self, finish_reason: str):
        """Sets the finish_reason of this CreateChatCompletionStreamResponseChoicesInner.

        The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.   # noqa: E501

        :param finish_reason: The finish_reason of this CreateChatCompletionStreamResponseChoicesInner.
        :type finish_reason: str
        """
        allowed_values = [None,"stop", "length", "tool_calls", "content_filter", "function_call"]  # noqa: E501
        if finish_reason not in allowed_values:
            raise ValueError(
                "Invalid value for `finish_reason` ({0}), must be one of {1}"
                .format(finish_reason, allowed_values)
            )

        self._finish_reason = finish_reason

    @property
    def index(self) -> int:
        """Gets the index of this CreateChatCompletionStreamResponseChoicesInner.

        The index of the choice in the list of choices.  # noqa: E501

        :return: The index of this CreateChatCompletionStreamResponseChoicesInner.
        :rtype: int
        """
        return self._index

    @index.setter
    def index(self, index: int):
        """Sets the index of this CreateChatCompletionStreamResponseChoicesInner.

        The index of the choice in the list of choices.  # noqa: E501

        :param index: The index of this CreateChatCompletionStreamResponseChoicesInner.
        :type index: int
        """
        if index is None:
            raise ValueError("Invalid value for `index`, must not be `None`")  # noqa: E501

        self._index = index
