# 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.system_tools_list_response import SystemToolsListResponse
from .raw_client import AsyncRawToolsClient, RawToolsClient


class ToolsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawToolsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawToolsClient
        """
        return self._raw_client

    def list_system_tools(
        self,
        *,
        include_capabilities: typing.Optional[bool] = None,
        category: typing.Optional[str] = None,
        model_compatibility: typing.Optional[str] = None,
        visible_in_ui: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SystemToolsListResponse:
        """
        List available built-in Freddy AI system tools.

        Supports both authentication methods:
        - Bearer token: Use Authorization header with user token
        - API key: Use X-API-Key header with organization API key

        Query Parameters:
            include_capabilities: Include detailed tool capabilities (default: True)
            category: Filter tools by category (search, computation, generation, automation, analysis)
            model_compatibility: Filter by model type compatibility (text, vision, voice, multimodal)
            visible_in_ui: Filter by UI visibility (true = only UI-visible tools, false = only hidden tools, null = all)

        Returns:
            SystemToolsListResponse with list of tools and total count

        Parameters
        ----------
        include_capabilities : typing.Optional[bool]

        category : typing.Optional[str]

        model_compatibility : typing.Optional[str]

        visible_in_ui : typing.Optional[bool]

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

        Returns
        -------
        SystemToolsListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.tools.list_system_tools()
        """
        _response = self._raw_client.list_system_tools(
            include_capabilities=include_capabilities,
            category=category,
            model_compatibility=model_compatibility,
            visible_in_ui=visible_in_ui,
            request_options=request_options,
        )
        return _response.data


class AsyncToolsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawToolsClient
        """
        return self._raw_client

    async def list_system_tools(
        self,
        *,
        include_capabilities: typing.Optional[bool] = None,
        category: typing.Optional[str] = None,
        model_compatibility: typing.Optional[str] = None,
        visible_in_ui: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SystemToolsListResponse:
        """
        List available built-in Freddy AI system tools.

        Supports both authentication methods:
        - Bearer token: Use Authorization header with user token
        - API key: Use X-API-Key header with organization API key

        Query Parameters:
            include_capabilities: Include detailed tool capabilities (default: True)
            category: Filter tools by category (search, computation, generation, automation, analysis)
            model_compatibility: Filter by model type compatibility (text, vision, voice, multimodal)
            visible_in_ui: Filter by UI visibility (true = only UI-visible tools, false = only hidden tools, null = all)

        Returns:
            SystemToolsListResponse with list of tools and total count

        Parameters
        ----------
        include_capabilities : typing.Optional[bool]

        category : typing.Optional[str]

        model_compatibility : typing.Optional[str]

        visible_in_ui : typing.Optional[bool]

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

        Returns
        -------
        SystemToolsListResponse
            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.tools.list_system_tools()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_system_tools(
            include_capabilities=include_capabilities,
            category=category,
            model_compatibility=model_compatibility,
            visible_in_ui=visible_in_ui,
            request_options=request_options,
        )
        return _response.data
