# 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.activity_log_response import ActivityLogResponse
from ..types.session_chat_history_response import SessionChatHistoryResponse
from .raw_client import AsyncRawMeetingBuddyChatClient, RawMeetingBuddyChatClient

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


class MeetingBuddyChatClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyChatClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyChatClient
        """
        return self._raw_client

    def get_meeting_buddy_activity_log(
        self,
        session_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        category: typing.Optional[str] = None,
        severity: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActivityLogResponse:
        """
        Returns a chronological activity log for a session, showing every lifecycle event, status change, error, and more.

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

        limit : typing.Optional[int]
            Max entries to return

        offset : typing.Optional[int]
            Number of entries to skip

        category : typing.Optional[str]
            Filter by event category

        severity : typing.Optional[str]
            Filter by severity

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

        Returns
        -------
        ActivityLogResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_chat.get_meeting_buddy_activity_log(
            session_id="session_id",
        )
        """
        _response = self._raw_client.get_meeting_buddy_activity_log(
            session_id,
            limit=limit,
            offset=offset,
            category=category,
            severity=severity,
            request_options=request_options,
        )
        return _response.data

    def chat_with_meeting_session(
        self,
        session_id: str,
        *,
        message: str,
        thread_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Ask questions about a completed meeting session. Returns a streaming SSE response with the AI's answer.

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

        message : str
            Chat message

        thread_id : typing.Optional[str]
            Existing chat thread ID

        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_chat.chat_with_meeting_session(
            session_id="session_id",
            message="message",
        )
        """
        _response = self._raw_client.chat_with_meeting_session(
            session_id, message=message, thread_id=thread_id, request_options=request_options
        )
        return _response.data

    def get_meeting_buddy_chat_history(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SessionChatHistoryResponse:
        """
        Returns the full chat history for a meeting session.

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

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

        Returns
        -------
        SessionChatHistoryResponse
            Successful Response

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

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


class AsyncMeetingBuddyChatClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyChatClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyChatClient
        """
        return self._raw_client

    async def get_meeting_buddy_activity_log(
        self,
        session_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        category: typing.Optional[str] = None,
        severity: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActivityLogResponse:
        """
        Returns a chronological activity log for a session, showing every lifecycle event, status change, error, and more.

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

        limit : typing.Optional[int]
            Max entries to return

        offset : typing.Optional[int]
            Number of entries to skip

        category : typing.Optional[str]
            Filter by event category

        severity : typing.Optional[str]
            Filter by severity

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

        Returns
        -------
        ActivityLogResponse
            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_chat.get_meeting_buddy_activity_log(
                session_id="session_id",
            )


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

    async def chat_with_meeting_session(
        self,
        session_id: str,
        *,
        message: str,
        thread_id: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Ask questions about a completed meeting session. Returns a streaming SSE response with the AI's answer.

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

        message : str
            Chat message

        thread_id : typing.Optional[str]
            Existing chat thread ID

        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_chat.chat_with_meeting_session(
                session_id="session_id",
                message="message",
            )


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

    async def get_meeting_buddy_chat_history(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> SessionChatHistoryResponse:
        """
        Returns the full chat history for a meeting session.

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

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

        Returns
        -------
        SessionChatHistoryResponse
            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_chat.get_meeting_buddy_chat_history(
                session_id="session_id",
            )


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