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

from __future__ import annotations

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .raw_client import AsyncRawAgentClient, RawAgentClient

if typing.TYPE_CHECKING:
    from .v1.client import AsyncV1Client, V1Client


class AgentClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAgentClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._v1: typing.Optional[V1Client] = None

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

        Returns
        -------
        RawAgentClient
        """
        return self._raw_client

    @property
    def v1(self):
        if self._v1 is None:
            from .v1.client import V1Client  # noqa: E402

            self._v1 = V1Client(client_wrapper=self._client_wrapper)
        return self._v1


class AsyncAgentClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAgentClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._v1: typing.Optional[AsyncV1Client] = None

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

        Returns
        -------
        AsyncRawAgentClient
        """
        return self._raw_client

    @property
    def v1(self):
        if self._v1 is None:
            from .v1.client import AsyncV1Client  # noqa: E402

            self._v1 = AsyncV1Client(client_wrapper=self._client_wrapper)
        return self._v1
