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

import typing

from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.active_agent_response import ActiveAgentResponse
from ..types.agent import Agent
from ..types.async_interaction_accepted_response import AsyncInteractionAcceptedResponse
from ..types.delete_agent_response import DeleteAgentResponse
from ..types.incoming_message import IncomingMessage
from ..types.upsert_agent_response import UpsertAgentResponse
from .raw_client import AsyncRawAgentsClient, RawAgentsClient

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


class AgentsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAgentsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAgentsClient
        """
        return self._raw_client

    def interact(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Iterator[typing.Optional[typing.Any]]:
        """
        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Yields
        ------
        typing.Iterator[typing.Optional[typing.Any]]
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        response = client.agents.interact(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
        )
        for chunk in response:
            yield chunk
        """
        with self._raw_client.interact(
            agent_id,
            messages=messages,
            session_id=session_id,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        ) as r:
            yield from r.data

    def interact_sync(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.interact_sync(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
        )
        """
        _response = self._raw_client.interact_sync(
            agent_id,
            messages=messages,
            session_id=session_id,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        )
        return _response.data

    def interact_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Iterator[typing.Optional[typing.Any]]:
        """
        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Yields
        ------
        typing.Iterator[typing.Optional[typing.Any]]
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        response = client.agents.interact_with_session(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
        )
        for chunk in response:
            yield chunk
        """
        with self._raw_client.interact_with_session(
            agent_id,
            session_id,
            messages=messages,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        ) as r:
            yield from r.data

    def interact_sync_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.interact_sync_with_session(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
        )
        """
        _response = self._raw_client.interact_sync_with_session(
            agent_id,
            session_id,
            messages=messages,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        )
        return _response.data

    def interact_async(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        callback_url: str,
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncInteractionAcceptedResponse:
        """
        Dedicated handler for async agent interactions exposed via the SDK.

        Requires callback_url and always returns 202 with session_id + events_url.

        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        callback_url : str
            Callback URL that Scout will POST to when the interaction completes. The request is signed with HMAC-SHA256 using the organization's secret key.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

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

        Returns
        -------
        AsyncInteractionAcceptedResponse
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.interact_async(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
            callback_url="callback_url",
        )
        """
        _response = self._raw_client.interact_async(
            agent_id,
            messages=messages,
            callback_url=callback_url,
            session_id=session_id,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    def interact_async_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        callback_url: str,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncInteractionAcceptedResponse:
        """
        Dedicated handler for async agent interactions exposed via the SDK.

        Requires callback_url and always returns 202 with session_id + events_url.

        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        callback_url : str
            Callback URL that Scout will POST to when the interaction completes. The request is signed with HMAC-SHA256 using the organization's secret key.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

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

        Returns
        -------
        AsyncInteractionAcceptedResponse
            Successful Response

        Examples
        --------
        from scoutos import IncomingMessage, Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.interact_async_with_session(
            agent_id="agent_id",
            session_id="session_id",
            messages=[
                IncomingMessage(
                    content="content",
                )
            ],
            callback_url="callback_url",
        )
        """
        _response = self._raw_client.interact_async_with_session(
            agent_id,
            session_id,
            messages=messages,
            callback_url=callback_url,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Agent]:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[Agent]
            Successful Response

        Examples
        --------
        from scoutos import Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.list()
        """
        _response = self._raw_client.list(request_options=request_options)
        return _response.data

    def upsert(
        self,
        *,
        agent: str,
        revision: str,
        agent_id: typing.Optional[str] = OMIT,
        activate: typing.Optional[bool] = OMIT,
        agent_image: typing.Optional[core.File] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpsertAgentResponse:
        """
        Parameters
        ----------
        agent : str

        revision : str

        agent_id : typing.Optional[str]

        activate : typing.Optional[bool]

        agent_image : typing.Optional[core.File]
            See core.File for more documentation

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

        Returns
        -------
        UpsertAgentResponse
            Successful Response

        Examples
        --------
        from scoutos import Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.upsert(
            agent="agent",
            revision="revision",
        )
        """
        _response = self._raw_client.upsert(
            agent=agent,
            revision=revision,
            agent_id=agent_id,
            activate=activate,
            agent_image=agent_image,
            request_options=request_options,
        )
        return _response.data

    def get(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ActiveAgentResponse:
        """
        Retrieve an agent and its active revision by agent_id.
        Verifies that the agent belongs to the actor's organization.

        Parameters
        ----------
        agent_id : str

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

        Returns
        -------
        ActiveAgentResponse
            Successful Response

        Examples
        --------
        from scoutos import Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.get(
            agent_id="agent_id",
        )
        """
        _response = self._raw_client.get(agent_id, request_options=request_options)
        return _response.data

    def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeleteAgentResponse:
        """
        Parameters
        ----------
        agent_id : str

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

        Returns
        -------
        DeleteAgentResponse
            Successful Response

        Examples
        --------
        from scoutos import Scout

        client = Scout(
            api_key="YOUR_API_KEY",
        )
        client.agents.delete(
            agent_id="agent_id",
        )
        """
        _response = self._raw_client.delete(agent_id, request_options=request_options)
        return _response.data


class AsyncAgentsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAgentsClient
        """
        return self._raw_client

    async def interact(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.AsyncIterator[typing.Optional[typing.Any]]:
        """
        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Yields
        ------
        typing.AsyncIterator[typing.Optional[typing.Any]]
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            response = await client.agents.interact(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
            )
            async for chunk in response:
                yield chunk


        asyncio.run(main())
        """
        async with self._raw_client.interact(
            agent_id,
            messages=messages,
            session_id=session_id,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        ) as r:
            async for _chunk in r.data:
                yield _chunk

    async def interact_sync(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.interact_sync(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.interact_sync(
            agent_id,
            messages=messages,
            session_id=session_id,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        )
        return _response.data

    async def interact_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.AsyncIterator[typing.Optional[typing.Any]]:
        """
        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Yields
        ------
        typing.AsyncIterator[typing.Optional[typing.Any]]
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            response = await client.agents.interact_with_session(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
            )
            async for chunk in response:
                yield chunk


        asyncio.run(main())
        """
        async with self._raw_client.interact_with_session(
            agent_id,
            session_id,
            messages=messages,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        ) as r:
            async for _chunk in r.data:
                yield _chunk

    async def interact_sync_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        callback_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

        callback_url : typing.Optional[str]
            Optional callback URL. If provided, the interaction runs asynchronously and the response returns 202 with session_id + events_url.

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.interact_sync_with_session(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.interact_sync_with_session(
            agent_id,
            session_id,
            messages=messages,
            metadata=metadata,
            callback_url=callback_url,
            request_options=request_options,
        )
        return _response.data

    async def interact_async(
        self,
        agent_id: str,
        *,
        messages: typing.Sequence[IncomingMessage],
        callback_url: str,
        session_id: typing.Optional[str] = None,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncInteractionAcceptedResponse:
        """
        Dedicated handler for async agent interactions exposed via the SDK.

        Requires callback_url and always returns 202 with session_id + events_url.

        Parameters
        ----------
        agent_id : str

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        callback_url : str
            Callback URL that Scout will POST to when the interaction completes. The request is signed with HMAC-SHA256 using the organization's secret key.

        session_id : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

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

        Returns
        -------
        AsyncInteractionAcceptedResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.interact_async(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
                callback_url="callback_url",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.interact_async(
            agent_id,
            messages=messages,
            callback_url=callback_url,
            session_id=session_id,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    async def interact_async_with_session(
        self,
        agent_id: str,
        session_id: typing.Optional[str],
        *,
        messages: typing.Sequence[IncomingMessage],
        callback_url: str,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncInteractionAcceptedResponse:
        """
        Dedicated handler for async agent interactions exposed via the SDK.

        Requires callback_url and always returns 202 with session_id + events_url.

        Parameters
        ----------
        agent_id : str

        session_id : typing.Optional[str]

        messages : typing.Sequence[IncomingMessage]
            List of incoming user messages and drive file references.

        callback_url : str
            Callback URL that Scout will POST to when the interaction completes. The request is signed with HMAC-SHA256 using the organization's secret key.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata (e.g., salesforce_session)

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

        Returns
        -------
        AsyncInteractionAcceptedResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout, IncomingMessage

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.interact_async_with_session(
                agent_id="agent_id",
                session_id="session_id",
                messages=[
                    IncomingMessage(
                        content="content",
                    )
                ],
                callback_url="callback_url",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.interact_async_with_session(
            agent_id,
            session_id,
            messages=messages,
            callback_url=callback_url,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Agent]:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[Agent]
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.list()


        asyncio.run(main())
        """
        _response = await self._raw_client.list(request_options=request_options)
        return _response.data

    async def upsert(
        self,
        *,
        agent: str,
        revision: str,
        agent_id: typing.Optional[str] = OMIT,
        activate: typing.Optional[bool] = OMIT,
        agent_image: typing.Optional[core.File] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpsertAgentResponse:
        """
        Parameters
        ----------
        agent : str

        revision : str

        agent_id : typing.Optional[str]

        activate : typing.Optional[bool]

        agent_image : typing.Optional[core.File]
            See core.File for more documentation

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

        Returns
        -------
        UpsertAgentResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.upsert(
                agent="agent",
                revision="revision",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.upsert(
            agent=agent,
            revision=revision,
            agent_id=agent_id,
            activate=activate,
            agent_image=agent_image,
            request_options=request_options,
        )
        return _response.data

    async def get(
        self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ActiveAgentResponse:
        """
        Retrieve an agent and its active revision by agent_id.
        Verifies that the agent belongs to the actor's organization.

        Parameters
        ----------
        agent_id : str

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

        Returns
        -------
        ActiveAgentResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.get(
                agent_id="agent_id",
            )


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

    async def delete(
        self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteAgentResponse:
        """
        Parameters
        ----------
        agent_id : str

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

        Returns
        -------
        DeleteAgentResponse
            Successful Response

        Examples
        --------
        import asyncio

        from scoutos import AsyncScout

        client = AsyncScout(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.agents.delete(
                agent_id="agent_id",
            )


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