# 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.app_api_v1schemas_meeting_buddy_search_topic_list_response import (
    AppApiV1SchemasMeetingBuddySearchTopicListResponse,
)
from ..types.search_filters import SearchFilters
from ..types.search_response import SearchResponse
from .raw_client import AsyncRawMeetingBuddyKnowledgeClient, RawMeetingBuddyKnowledgeClient

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


class MeetingBuddyKnowledgeClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyKnowledgeClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyKnowledgeClient
        """
        return self._raw_client

    def search_meetings(
        self,
        *,
        query: str,
        filters: typing.Optional[SearchFilters] = OMIT,
        limit: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SearchResponse:
        """
        Semantic search across meeting intelligence for the organization.

        Searches executive summaries, decisions, and action items.
        Regular users see only their own sessions; org admins see all.

        Parameters
        ----------
        query : str

        filters : typing.Optional[SearchFilters]

        limit : typing.Optional[int]

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

        Returns
        -------
        SearchResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_knowledge.search_meetings(
            query="query",
        )
        """
        _response = self._raw_client.search_meetings(
            query=query, filters=filters, limit=limit, request_options=request_options
        )
        return _response.data

    def list_topics(
        self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> AppApiV1SchemasMeetingBuddySearchTopicListResponse:
        """
        List extracted topics with meeting counts.

        Aggregates key topics from all meeting intelligence records.
        Regular users see topics from their own sessions; org admins see all.

        Parameters
        ----------
        limit : typing.Optional[int]

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

        Returns
        -------
        AppApiV1SchemasMeetingBuddySearchTopicListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_knowledge.list_topics()
        """
        _response = self._raw_client.list_topics(limit=limit, request_options=request_options)
        return _response.data


class AsyncMeetingBuddyKnowledgeClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyKnowledgeClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyKnowledgeClient
        """
        return self._raw_client

    async def search_meetings(
        self,
        *,
        query: str,
        filters: typing.Optional[SearchFilters] = OMIT,
        limit: typing.Optional[int] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SearchResponse:
        """
        Semantic search across meeting intelligence for the organization.

        Searches executive summaries, decisions, and action items.
        Regular users see only their own sessions; org admins see all.

        Parameters
        ----------
        query : str

        filters : typing.Optional[SearchFilters]

        limit : typing.Optional[int]

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

        Returns
        -------
        SearchResponse
            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_knowledge.search_meetings(
                query="query",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.search_meetings(
            query=query, filters=filters, limit=limit, request_options=request_options
        )
        return _response.data

    async def list_topics(
        self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> AppApiV1SchemasMeetingBuddySearchTopicListResponse:
        """
        List extracted topics with meeting counts.

        Aggregates key topics from all meeting intelligence records.
        Regular users see topics from their own sessions; org admins see all.

        Parameters
        ----------
        limit : typing.Optional[int]

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

        Returns
        -------
        AppApiV1SchemasMeetingBuddySearchTopicListResponse
            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_knowledge.list_topics()


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