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

import typing

from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.app_api_v1schemas_meeting_buddy_topic_list_response import AppApiV1SchemasMeetingBuddyTopicListResponse
from ..types.speaker_embedding_list_response import SpeakerEmbeddingListResponse
from ..types.speaker_embedding_response import SpeakerEmbeddingResponse
from ..types.transcribe_now_response import TranscribeNowResponse
from .raw_client import AsyncRawMeetingBuddyNoteTakerClient, RawMeetingBuddyNoteTakerClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class MeetingBuddyNoteTakerClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyNoteTakerClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyNoteTakerClient
        """
        return self._raw_client

    def transcribe_now(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TranscribeNowResponse:
        """
        Trigger on-demand batch processing of the recording so far.

        Parameters
        ----------
        session_id : str

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

        Returns
        -------
        TranscribeNowResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_note_taker.transcribe_now(
            session_id="session_id",
        )
        """
        _response = self._raw_client.transcribe_now(session_id, request_options=request_options)
        return _response.data

    def list_speaker_embeddings(
        self, organization_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SpeakerEmbeddingListResponse:
        """
        List all registered speaker voice embeddings for an organization.

        Parameters
        ----------
        organization_id : str

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

        Returns
        -------
        SpeakerEmbeddingListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_note_taker.list_speaker_embeddings(
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.list_speaker_embeddings(organization_id, request_options=request_options)
        return _response.data

    def create_speaker_embedding(
        self,
        organization_id: str,
        *,
        audio_file: core.File,
        name: str,
        email: typing.Optional[str] = OMIT,
        user_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpeakerEmbeddingResponse:
        """
        Register a speaker's voice embedding for future meeting identification.

        Parameters
        ----------
        organization_id : str

        audio_file : core.File
            See core.File for more documentation

        name : str
            Display name for the speaker

        email : typing.Optional[str]
            Contact email (optional)

        user_id : typing.Optional[str]
            Link to Aitronos user ID (optional)

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

        Returns
        -------
        SpeakerEmbeddingResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_note_taker.create_speaker_embedding(
            organization_id="organization_id",
            name="name",
        )
        """
        _response = self._raw_client.create_speaker_embedding(
            organization_id,
            audio_file=audio_file,
            name=name,
            email=email,
            user_id=user_id,
            request_options=request_options,
        )
        return _response.data

    def delete_speaker_embedding(
        self, organization_id: str, embedding_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove a registered speaker embedding.

        Parameters
        ----------
        organization_id : str

        embedding_id : str

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

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_note_taker.delete_speaker_embedding(
            organization_id="organization_id",
            embedding_id="embedding_id",
        )
        """
        _response = self._raw_client.delete_speaker_embedding(
            organization_id, embedding_id, request_options=request_options
        )
        return _response.data

    def get_session_topics(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AppApiV1SchemasMeetingBuddyTopicListResponse:
        """
        Get topic segments detected during post-meeting processing.

        Parameters
        ----------
        session_id : str

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

        Returns
        -------
        AppApiV1SchemasMeetingBuddyTopicListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_note_taker.get_session_topics(
            session_id="session_id",
        )
        """
        _response = self._raw_client.get_session_topics(session_id, request_options=request_options)
        return _response.data


class AsyncMeetingBuddyNoteTakerClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyNoteTakerClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyNoteTakerClient
        """
        return self._raw_client

    async def transcribe_now(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TranscribeNowResponse:
        """
        Trigger on-demand batch processing of the recording so far.

        Parameters
        ----------
        session_id : str

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

        Returns
        -------
        TranscribeNowResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_note_taker.transcribe_now(
                session_id="session_id",
            )


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

    async def list_speaker_embeddings(
        self, organization_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SpeakerEmbeddingListResponse:
        """
        List all registered speaker voice embeddings for an organization.

        Parameters
        ----------
        organization_id : str

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

        Returns
        -------
        SpeakerEmbeddingListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_note_taker.list_speaker_embeddings(
                organization_id="organization_id",
            )


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

    async def create_speaker_embedding(
        self,
        organization_id: str,
        *,
        audio_file: core.File,
        name: str,
        email: typing.Optional[str] = OMIT,
        user_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpeakerEmbeddingResponse:
        """
        Register a speaker's voice embedding for future meeting identification.

        Parameters
        ----------
        organization_id : str

        audio_file : core.File
            See core.File for more documentation

        name : str
            Display name for the speaker

        email : typing.Optional[str]
            Contact email (optional)

        user_id : typing.Optional[str]
            Link to Aitronos user ID (optional)

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

        Returns
        -------
        SpeakerEmbeddingResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_note_taker.create_speaker_embedding(
                organization_id="organization_id",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_speaker_embedding(
            organization_id,
            audio_file=audio_file,
            name=name,
            email=email,
            user_id=user_id,
            request_options=request_options,
        )
        return _response.data

    async def delete_speaker_embedding(
        self, organization_id: str, embedding_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove a registered speaker embedding.

        Parameters
        ----------
        organization_id : str

        embedding_id : str

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_note_taker.delete_speaker_embedding(
                organization_id="organization_id",
                embedding_id="embedding_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete_speaker_embedding(
            organization_id, embedding_id, request_options=request_options
        )
        return _response.data

    async def get_session_topics(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AppApiV1SchemasMeetingBuddyTopicListResponse:
        """
        Get topic segments detected during post-meeting processing.

        Parameters
        ----------
        session_id : str

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

        Returns
        -------
        AppApiV1SchemasMeetingBuddyTopicListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.meeting_buddy_note_taker.get_session_topics(
                session_id="session_id",
            )


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