Skip to content

Agent

Sub classes

Name Children Inherits
ClientSideConnection
aclientp.client.connection
Client-side connection.
    TestAgent
    aclientp.agent.implementations.testing
    Test agent implementation for ACP testing.
      MockAgent
      aclientp.agent.implementations.debug_server.mock_agent
      Mock ACP agent for debug server.

        Base classes

        Name Children Inherits
        Protocol
        typing
        Base class for protocol classes.

        ⋔ Inheritance diagram

        graph TD
          95970860128304["protocol.Agent"]
          95970836711072["typing.Protocol"]
          95970835676112["typing.Generic"]
          125067848591872["builtins.object"]
          95970836711072 --> 95970860128304
          95970835676112 --> 95970836711072
          125067848591872 --> 95970835676112

        🛈 DocStrings

        Bases: Protocol

        Base agent interface for ACP.

        Methods with a default body are optional and gated by a capability the agent advertises. Their defaults reject the call with method not found.

        Source code in src/aclientp/agent/protocol.py
        @runtime_checkable
        class Agent(Protocol):
            """Base agent interface for ACP.
        
            Methods with a default body are optional and gated by a capability the agent
            advertises. Their defaults reject the call with ``method not found``.
            """
        
            async def initialize(self, params: InitializeRequest) -> InitializeResponse: ...
        
            async def new_session(self, params: NewSessionRequest) -> NewSessionResponse: ...
        
            async def prompt(self, params: PromptRequest) -> PromptResponse: ...
        
            async def cancel(self, params: CancelNotification) -> None: ...
        
            async def load_session(self, params: LoadSessionRequest) -> LoadSessionResponse: ...
        
            async def list_sessions(self, params: ListSessionsRequest) -> ListSessionsResponse: ...
        
            async def fork_session(self, params: ForkSessionRequest) -> ForkSessionResponse: ...
        
            async def resume_session(self, params: ResumeSessionRequest) -> ResumeSessionResponse: ...
        
            async def close_session(self, params: CloseSessionRequest) -> CloseSessionResponse: ...
        
            async def authenticate(self, params: AuthenticateRequest) -> AuthenticateResponse | None: ...
        
            async def logout(self, params: LogoutRequest) -> LogoutResponse | None: ...
        
            async def set_session_mode(
                self, params: SetSessionModeRequest
            ) -> SetSessionModeResponse | None: ...
        
            async def set_session_config_option(
                self, params: SetSessionConfigOptionRequest
            ) -> SetSessionConfigOptionResponse | None: ...
        
            async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]: ...
        
            async def ext_notification(self, method: str, params: dict[str, Any]) -> None: ...
        
            async def delete_session(self, params: DeleteSessionRequest) -> DeleteSessionResponse:
                raise RequestError.method_not_found("session/delete")
        
            async def archive_session(self, params: ArchiveSessionRequest) -> ArchiveSessionResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("session/archive")
        
            async def unarchive_session(self, params: UnarchiveSessionRequest) -> UnarchiveSessionResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("session/unarchive")
        
            async def session_status(self, params: SessionStatusRequest) -> SessionStatusResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("session/status")
        
            async def session_options(self, params: SessionOptionsRequest) -> SessionOptionsResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("session/options")
        
            async def set_session_title(self, params: SetSessionTitleRequest) -> SetSessionTitleResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("session/set_title")
        
            async def auth_status(self, params: AuthStatusRequest) -> AuthStatusResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("auth/status")
        
            async def list_providers(self, params: ListProvidersRequest) -> ListProvidersResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("providers/list")
        
            async def set_provider(self, params: SetProviderRequest) -> SetProviderResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("providers/set")
        
            async def disable_provider(self, params: DisableProviderRequest) -> DisableProviderResponse:
                """**UNSTABLE**."""
                raise RequestError.method_not_found("providers/disable")
        
            async def mcp_message(self, params: MessageMcpRequest) -> MessageMcpResponse:
                """**UNSTABLE**: Inner MCP request to an ``acp`` MCP server the agent declared."""
                raise RequestError.method_not_found("mcp/message")
        
            async def mcp_notification(self, params: MessageMcpNotification) -> None:
                """**UNSTABLE**: Inner MCP notification for an ``acp`` MCP server the agent declared."""
                return
        

        archive_session async

        archive_session(params: ArchiveSessionRequest) -> ArchiveSessionResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def archive_session(self, params: ArchiveSessionRequest) -> ArchiveSessionResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("session/archive")
        

        auth_status async

        auth_status(params: AuthStatusRequest) -> AuthStatusResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def auth_status(self, params: AuthStatusRequest) -> AuthStatusResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("auth/status")
        

        disable_provider async

        disable_provider(params: DisableProviderRequest) -> DisableProviderResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def disable_provider(self, params: DisableProviderRequest) -> DisableProviderResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("providers/disable")
        

        list_providers async

        list_providers(params: ListProvidersRequest) -> ListProvidersResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def list_providers(self, params: ListProvidersRequest) -> ListProvidersResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("providers/list")
        

        mcp_message async

        mcp_message(params: MessageMcpRequest) -> MessageMcpResponse
        

        UNSTABLE: Inner MCP request to an acp MCP server the agent declared.

        Source code in src/aclientp/agent/protocol.py
        async def mcp_message(self, params: MessageMcpRequest) -> MessageMcpResponse:
            """**UNSTABLE**: Inner MCP request to an ``acp`` MCP server the agent declared."""
            raise RequestError.method_not_found("mcp/message")
        

        mcp_notification async

        mcp_notification(params: MessageMcpNotification) -> None
        

        UNSTABLE: Inner MCP notification for an acp MCP server the agent declared.

        Source code in src/aclientp/agent/protocol.py
        async def mcp_notification(self, params: MessageMcpNotification) -> None:
            """**UNSTABLE**: Inner MCP notification for an ``acp`` MCP server the agent declared."""
            return
        

        session_options async

        session_options(params: SessionOptionsRequest) -> SessionOptionsResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def session_options(self, params: SessionOptionsRequest) -> SessionOptionsResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("session/options")
        

        session_status async

        session_status(params: SessionStatusRequest) -> SessionStatusResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def session_status(self, params: SessionStatusRequest) -> SessionStatusResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("session/status")
        

        set_provider async

        set_provider(params: SetProviderRequest) -> SetProviderResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def set_provider(self, params: SetProviderRequest) -> SetProviderResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("providers/set")
        

        set_session_title async

        set_session_title(params: SetSessionTitleRequest) -> SetSessionTitleResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def set_session_title(self, params: SetSessionTitleRequest) -> SetSessionTitleResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("session/set_title")
        

        unarchive_session async

        unarchive_session(params: UnarchiveSessionRequest) -> UnarchiveSessionResponse
        

        UNSTABLE.

        Source code in src/aclientp/agent/protocol.py
        async def unarchive_session(self, params: UnarchiveSessionRequest) -> UnarchiveSessionResponse:
            """**UNSTABLE**."""
            raise RequestError.method_not_found("session/unarchive")
        

        :fa-brands-github: Show source on GitHub