# 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.live_config_response import LiveConfigResponse
from ..types.live_interaction_list_response import LiveInteractionListResponse
from ..types.live_message_response import LiveMessageResponse
from .raw_client import AsyncRawMeetingBuddyLiveIntelligenceClient, RawMeetingBuddyLiveIntelligenceClient

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


class MeetingBuddyLiveIntelligenceClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyLiveIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyLiveIntelligenceClient
        """
        return self._raw_client

    def list_live_interactions(
        self,
        session_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveInteractionListResponse:
        """
        List all live intelligence interactions for a session.

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

        limit : typing.Optional[int]

        offset : typing.Optional[int]

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

        Returns
        -------
        LiveInteractionListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_live_intelligence.list_live_interactions(
            session_id="session_id",
        )
        """
        _response = self._raw_client.list_live_interactions(
            session_id, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def update_live_config(
        self,
        session_id: str,
        *,
        live_intelligence_enabled: typing.Optional[bool] = OMIT,
        live_response_model: typing.Optional[str] = OMIT,
        trigger_patterns: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveConfigResponse:
        """
        Enable/disable live intelligence and configure model for a session.

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

        live_intelligence_enabled : typing.Optional[bool]
            Enable or disable live intelligence

        live_response_model : typing.Optional[str]
            Override model for live responses

        trigger_patterns : typing.Optional[typing.Sequence[str]]
            Custom trigger patterns (e.g., ['@{name}', 'Hey {name}'])

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

        Returns
        -------
        LiveConfigResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_live_intelligence.update_live_config(
            session_id="session_id",
        )
        """
        _response = self._raw_client.update_live_config(
            session_id,
            live_intelligence_enabled=live_intelligence_enabled,
            live_response_model=live_response_model,
            trigger_patterns=trigger_patterns,
            request_options=request_options,
        )
        return _response.data

    def send_live_message(
        self,
        session_id: str,
        *,
        message: str,
        sender: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveMessageResponse:
        """
        Send a message to the meeting bot via API (alternative to voice/chat trigger).

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

        message : str
            Message text

        sender : typing.Optional[str]
            Sender identifier

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

        Returns
        -------
        LiveMessageResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_live_intelligence.send_live_message(
            session_id="session_id",
            message="message",
        )
        """
        _response = self._raw_client.send_live_message(
            session_id, message=message, sender=sender, request_options=request_options
        )
        return _response.data

    def stream_live_interactions(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Any:
        """
        SSE stream of live interactions as they happen.

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

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

        Returns
        -------
        typing.Any
            Successful Response

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

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


class AsyncMeetingBuddyLiveIntelligenceClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyLiveIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyLiveIntelligenceClient
        """
        return self._raw_client

    async def list_live_interactions(
        self,
        session_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveInteractionListResponse:
        """
        List all live intelligence interactions for a session.

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

        limit : typing.Optional[int]

        offset : typing.Optional[int]

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

        Returns
        -------
        LiveInteractionListResponse
            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_live_intelligence.list_live_interactions(
                session_id="session_id",
            )


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

    async def update_live_config(
        self,
        session_id: str,
        *,
        live_intelligence_enabled: typing.Optional[bool] = OMIT,
        live_response_model: typing.Optional[str] = OMIT,
        trigger_patterns: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveConfigResponse:
        """
        Enable/disable live intelligence and configure model for a session.

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

        live_intelligence_enabled : typing.Optional[bool]
            Enable or disable live intelligence

        live_response_model : typing.Optional[str]
            Override model for live responses

        trigger_patterns : typing.Optional[typing.Sequence[str]]
            Custom trigger patterns (e.g., ['@{name}', 'Hey {name}'])

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

        Returns
        -------
        LiveConfigResponse
            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_live_intelligence.update_live_config(
                session_id="session_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_live_config(
            session_id,
            live_intelligence_enabled=live_intelligence_enabled,
            live_response_model=live_response_model,
            trigger_patterns=trigger_patterns,
            request_options=request_options,
        )
        return _response.data

    async def send_live_message(
        self,
        session_id: str,
        *,
        message: str,
        sender: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> LiveMessageResponse:
        """
        Send a message to the meeting bot via API (alternative to voice/chat trigger).

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

        message : str
            Message text

        sender : typing.Optional[str]
            Sender identifier

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

        Returns
        -------
        LiveMessageResponse
            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_live_intelligence.send_live_message(
                session_id="session_id",
                message="message",
            )


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

    async def stream_live_interactions(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Any:
        """
        SSE stream of live interactions as they happen.

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

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

        Returns
        -------
        typing.Any
            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_live_intelligence.stream_live_interactions(
                session_id="session_id",
            )


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