# This file was auto-generated by Fern from our API Definition.

import typing

from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ....core.request_options import RequestOptions
from ....types.get_model_v1response import GetModelV1Response
from ....types.list_models_v1response import ListModelsV1Response
from .raw_client import AsyncRawModelsClient, RawModelsClient


class ModelsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawModelsClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawModelsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawModelsClient
        """
        return self._raw_client

    def list(
        self, *, include_outdated: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> ListModelsV1Response:
        """
        Returns metadata on all the latest public models. To retrieve custom models, use Get Project Models.

        Parameters
        ----------
        include_outdated : typing.Optional[bool]
            returns non-latest versions of models

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ListModelsV1Response
            A list of models

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.models.list(
            include_outdated=True,
        )
        """
        _response = self._raw_client.list(include_outdated=include_outdated, request_options=request_options)
        return _response.data

    def get(self, model_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetModelV1Response:
        """
        Returns metadata for a specific public model

        Parameters
        ----------
        model_id : str
            The specific UUID of the model

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetModelV1Response
            A model object that can be either STT or TTS

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.models.get(
            model_id="af6e9977-99f6-4d8f-b6f5-dfdf6fb6e291",
        )
        """
        _response = self._raw_client.get(model_id, request_options=request_options)
        return _response.data


class AsyncModelsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawModelsClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawModelsClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawModelsClient
        """
        return self._raw_client

    async def list(
        self, *, include_outdated: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> ListModelsV1Response:
        """
        Returns metadata on all the latest public models. To retrieve custom models, use Get Project Models.

        Parameters
        ----------
        include_outdated : typing.Optional[bool]
            returns non-latest versions of models

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ListModelsV1Response
            A list of models

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.models.list(
                include_outdated=True,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list(include_outdated=include_outdated, request_options=request_options)
        return _response.data

    async def get(
        self, model_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetModelV1Response:
        """
        Returns metadata for a specific public model

        Parameters
        ----------
        model_id : str
            The specific UUID of the model

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        GetModelV1Response
            A model object that can be either STT or TTS

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.models.get(
                model_id="af6e9977-99f6-4d8f-b6f5-dfdf6fb6e291",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(model_id, request_options=request_options)
        return _response.data
