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.assistant_object_tool_resources import \
    AssistantObjectToolResources  # noqa: E501
from timestep.api.openai.v1.models.assistant_object_tools_inner import \
    AssistantObjectToolsInner  # noqa: E501
from timestep.api.openai.v1.models.assistants_api_response_format_option import \
    AssistantsApiResponseFormatOption  # noqa: E501
from timestep.api.openai.v1.models.base_model import Model


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

    Do not edit the class manually.
    """

    def __init__(self, id=None, object=None, created_at=None, name=None, description=None, model=None, instructions=None, tools=[], tool_resources=None, metadata=None, temperature=1, top_p=1, response_format=None):  # noqa: E501
        """AssistantObject - a model defined in OpenAPI

        :param id: The id of this AssistantObject.  # noqa: E501
        :type id: str
        :param object: The object of this AssistantObject.  # noqa: E501
        :type object: str
        :param created_at: The created_at of this AssistantObject.  # noqa: E501
        :type created_at: int
        :param name: The name of this AssistantObject.  # noqa: E501
        :type name: str
        :param description: The description of this AssistantObject.  # noqa: E501
        :type description: str
        :param model: The model of this AssistantObject.  # noqa: E501
        :type model: str
        :param instructions: The instructions of this AssistantObject.  # noqa: E501
        :type instructions: str
        :param tools: The tools of this AssistantObject.  # noqa: E501
        :type tools: List[AssistantObjectToolsInner]
        :param tool_resources: The tool_resources of this AssistantObject.  # noqa: E501
        :type tool_resources: AssistantObjectToolResources
        :param metadata: The metadata of this AssistantObject.  # noqa: E501
        :type metadata: object
        :param temperature: The temperature of this AssistantObject.  # noqa: E501
        :type temperature: float
        :param top_p: The top_p of this AssistantObject.  # noqa: E501
        :type top_p: float
        :param response_format: The response_format of this AssistantObject.  # noqa: E501
        :type response_format: AssistantsApiResponseFormatOption
        """
        self.openapi_types = {
            'id': str,
            'object': str,
            'created_at': int,
            'name': str,
            'description': str,
            'model': str,
            'instructions': str,
            'tools': List[AssistantObjectToolsInner],
            'tool_resources': AssistantObjectToolResources,
            'metadata': object,
            'temperature': float,
            'top_p': float,
            'response_format': AssistantsApiResponseFormatOption
        }

        self.attribute_map = {
            'id': 'id',
            'object': 'object',
            'created_at': 'created_at',
            'name': 'name',
            'description': 'description',
            'model': 'model',
            'instructions': 'instructions',
            'tools': 'tools',
            'tool_resources': 'tool_resources',
            'metadata': 'metadata',
            'temperature': 'temperature',
            'top_p': 'top_p',
            'response_format': 'response_format'
        }

        self._id = id
        self._object = object
        self._created_at = created_at
        self._name = name
        self._description = description
        self._model = model
        self._instructions = instructions
        self._tools = tools
        self._tool_resources = tool_resources
        self._metadata = metadata
        self._temperature = temperature
        self._top_p = top_p
        self._response_format = response_format

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

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

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

        The identifier, which can be referenced in API endpoints.  # noqa: E501

        :return: The id of this AssistantObject.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id: str):
        """Sets the id of this AssistantObject.

        The identifier, which can be referenced in API endpoints.  # noqa: E501

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

        self._id = id

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

        The object type, which is always `assistant`.  # noqa: E501

        :return: The object of this AssistantObject.
        :rtype: str
        """
        return self._object

    @object.setter
    def object(self, object: str):
        """Sets the object of this AssistantObject.

        The object type, which is always `assistant`.  # noqa: E501

        :param object: The object of this AssistantObject.
        :type object: str
        """
        allowed_values = ["assistant"]  # noqa: E501
        if object not in allowed_values:
            raise ValueError(
                "Invalid value for `object` ({0}), must be one of {1}"
                .format(object, allowed_values)
            )

        self._object = object

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

        The Unix timestamp (in seconds) for when the assistant was created.  # noqa: E501

        :return: The created_at of this AssistantObject.
        :rtype: int
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at: int):
        """Sets the created_at of this AssistantObject.

        The Unix timestamp (in seconds) for when the assistant was created.  # noqa: E501

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

        self._created_at = created_at

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

        The name of the assistant. The maximum length is 256 characters.   # noqa: E501

        :return: The name of this AssistantObject.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name: str):
        """Sets the name of this AssistantObject.

        The name of the assistant. The maximum length is 256 characters.   # noqa: E501

        :param name: The name of this AssistantObject.
        :type name: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if name is not None and len(name) > 256:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `256`")  # noqa: E501

        self._name = name

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

        The description of the assistant. The maximum length is 512 characters.   # noqa: E501

        :return: The description of this AssistantObject.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description: str):
        """Sets the description of this AssistantObject.

        The description of the assistant. The maximum length is 512 characters.   # noqa: E501

        :param description: The description of this AssistantObject.
        :type description: str
        """
        if description is None:
            raise ValueError("Invalid value for `description`, must not be `None`")  # noqa: E501
        if description is not None and len(description) > 512:
            raise ValueError("Invalid value for `description`, length must be less than or equal to `512`")  # noqa: E501

        self._description = description

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

        ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.   # noqa: E501

        :return: The model of this AssistantObject.
        :rtype: str
        """
        return self._model

    @model.setter
    def model(self, model: str):
        """Sets the model of this AssistantObject.

        ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.   # noqa: E501

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

        self._model = model

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

        The system instructions that the assistant uses. The maximum length is 256,000 characters.   # noqa: E501

        :return: The instructions of this AssistantObject.
        :rtype: str
        """
        return self._instructions

    @instructions.setter
    def instructions(self, instructions: str):
        """Sets the instructions of this AssistantObject.

        The system instructions that the assistant uses. The maximum length is 256,000 characters.   # noqa: E501

        :param instructions: The instructions of this AssistantObject.
        :type instructions: str
        """
        if instructions is None:
            raise ValueError("Invalid value for `instructions`, must not be `None`")  # noqa: E501
        if instructions is not None and len(instructions) > 256000:
            raise ValueError("Invalid value for `instructions`, length must be less than or equal to `256000`")  # noqa: E501

        self._instructions = instructions

    @property
    def tools(self) -> List[AssistantObjectToolsInner]:
        """Gets the tools of this AssistantObject.

        A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.   # noqa: E501

        :return: The tools of this AssistantObject.
        :rtype: List[AssistantObjectToolsInner]
        """
        return self._tools

    @tools.setter
    def tools(self, tools: List[AssistantObjectToolsInner]):
        """Sets the tools of this AssistantObject.

        A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.   # noqa: E501

        :param tools: The tools of this AssistantObject.
        :type tools: List[AssistantObjectToolsInner]
        """
        if tools is None:
            raise ValueError("Invalid value for `tools`, must not be `None`")  # noqa: E501
        if tools is not None and len(tools) > 128:
            raise ValueError("Invalid value for `tools`, number of items must be less than or equal to `128`")  # noqa: E501

        self._tools = tools

    @property
    def tool_resources(self) -> AssistantObjectToolResources:
        """Gets the tool_resources of this AssistantObject.


        :return: The tool_resources of this AssistantObject.
        :rtype: AssistantObjectToolResources
        """
        return self._tool_resources

    @tool_resources.setter
    def tool_resources(self, tool_resources: AssistantObjectToolResources):
        """Sets the tool_resources of this AssistantObject.


        :param tool_resources: The tool_resources of this AssistantObject.
        :type tool_resources: AssistantObjectToolResources
        """

        self._tool_resources = tool_resources

    @property
    def metadata(self) -> object:
        """Gets the metadata of this AssistantObject.

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

        :return: The metadata of this AssistantObject.
        :rtype: object
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata: object):
        """Sets the metadata of this AssistantObject.

        Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.   # noqa: E501

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

        self._metadata = metadata

    @property
    def temperature(self) -> float:
        """Gets the temperature of this AssistantObject.

        What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.   # noqa: E501

        :return: The temperature of this AssistantObject.
        :rtype: float
        """
        return self._temperature

    @temperature.setter
    def temperature(self, temperature: float):
        """Sets the temperature of this AssistantObject.

        What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.   # noqa: E501

        :param temperature: The temperature of this AssistantObject.
        :type temperature: float
        """
        if temperature is not None and temperature > 2:  # noqa: E501
            raise ValueError("Invalid value for `temperature`, must be a value less than or equal to `2`")  # noqa: E501
        if temperature is not None and temperature < 0:  # noqa: E501
            raise ValueError("Invalid value for `temperature`, must be a value greater than or equal to `0`")  # noqa: E501

        self._temperature = temperature

    @property
    def top_p(self) -> float:
        """Gets the top_p of this AssistantObject.

        An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.  We generally recommend altering this or temperature but not both.   # noqa: E501

        :return: The top_p of this AssistantObject.
        :rtype: float
        """
        return self._top_p

    @top_p.setter
    def top_p(self, top_p: float):
        """Sets the top_p of this AssistantObject.

        An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.  We generally recommend altering this or temperature but not both.   # noqa: E501

        :param top_p: The top_p of this AssistantObject.
        :type top_p: float
        """
        if top_p is not None and top_p > 1:  # noqa: E501
            raise ValueError("Invalid value for `top_p`, must be a value less than or equal to `1`")  # noqa: E501
        if top_p is not None and top_p < 0:  # noqa: E501
            raise ValueError("Invalid value for `top_p`, must be a value greater than or equal to `0`")  # noqa: E501

        self._top_p = top_p

    @property
    def response_format(self) -> AssistantsApiResponseFormatOption:
        """Gets the response_format of this AssistantObject.


        :return: The response_format of this AssistantObject.
        :rtype: AssistantsApiResponseFormatOption
        """
        return self._response_format

    @response_format.setter
    def response_format(self, response_format: AssistantsApiResponseFormatOption):
        """Sets the response_format of this AssistantObject.


        :param response_format: The response_format of this AssistantObject.
        :type response_format: AssistantsApiResponseFormatOption
        """

        self._response_format = response_format
