Skip to content

agent_responses

Class info

Classes

Name Children Inherits
ArchiveSessionResponse
aclientp.schema.agent_responses
**UNSTABLE**: Response to ``session/archive``.
    AuthStatusResponse
    aclientp.schema.agent_responses
    **UNSTABLE**: Response to ``auth/status``.
      AuthenticateResponse
      aclientp.schema.agent_responses
      Response to authenticate method.
        CloseSessionResponse
        aclientp.schema.agent_responses
        Response from closing a session.
          CustomResponse
          aclientp.schema.agent_responses
          Response for custom/extension methods.
            DeleteSessionResponse
            aclientp.schema.agent_responses
            Response to ``session/delete``.
              ForkSessionResponse
              aclientp.schema.agent_responses
              **UNSTABLE**: Response from forking an existing session.
                InitializeResponse
                aclientp.schema.agent_responses
                Response from the initialize method.
                ListSessionsResponse
                aclientp.schema.agent_responses
                Response from listing sessions.
                  LoadSessionResponse
                  aclientp.schema.agent_responses
                  Response from loading an existing session.
                    LogoutResponse
                    aclientp.schema.agent_responses
                    Response to the ``logout`` method.
                      NewSessionResponse
                      aclientp.schema.agent_responses
                      Response from creating a new session.
                        PromptResponse
                        aclientp.schema.agent_responses
                        Response from processing a user prompt.
                          ResumeSessionResponse
                          aclientp.schema.agent_responses
                          Response from resuming an existing session.
                            SessionOptionsResponse
                            aclientp.schema.agent_responses
                            **UNSTABLE**: The modes and config options a session would start with.
                              SessionStatusResponse
                              aclientp.schema.agent_responses
                              **UNSTABLE**: Response to ``session/status``.
                                SetSessionConfigOptionResponse
                                aclientp.schema.agent_responses
                                Response to `session/set_config_option` method.
                                  SetSessionModeResponse
                                  aclientp.schema.agent_responses
                                  Response to `session/set_mode` method.
                                    SetSessionTitleResponse
                                    aclientp.schema.agent_responses
                                    **UNSTABLE**: Response to ``session/set_title``.
                                      UnarchiveSessionResponse
                                      aclientp.schema.agent_responses
                                      **UNSTABLE**: Response to ``session/unarchive``.

                                        🛈 DocStrings

                                        ArchiveSessionResponse

                                        Bases: Response

                                        UNSTABLE: Response to session/archive.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class ArchiveSessionResponse(Response):
                                            """**UNSTABLE**: Response to ``session/archive``."""
                                        

                                        AuthStatusResponse

                                        Bases: Response

                                        UNSTABLE: Response to auth/status.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class AuthStatusResponse(Response):
                                            """**UNSTABLE**: Response to ``auth/status``."""
                                        
                                            state: AuthState
                                            """Whether the agent can start sessions without the user signing in first."""
                                        
                                            accounts: Sequence[AuthAccount] = Field(default_factory=list)
                                            """The accounts the agent has configured, for display."""
                                        

                                        accounts class-attribute instance-attribute

                                        accounts: Sequence[AuthAccount] = Field(default_factory=list)
                                        

                                        The accounts the agent has configured, for display.

                                        state instance-attribute

                                        state: AuthState
                                        

                                        Whether the agent can start sessions without the user signing in first.

                                        AuthenticateResponse

                                        Bases: Response

                                        Response to authenticate method.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class AuthenticateResponse(Response):
                                            """Response to authenticate method."""
                                        

                                        CloseSessionResponse

                                        Bases: Response

                                        Response from closing a session.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class CloseSessionResponse(Response):
                                            """Response from closing a session."""
                                        

                                        CustomResponse

                                        Bases: Response

                                        Response for custom/extension methods.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class CustomResponse(Response):
                                            """Response for custom/extension methods."""
                                        
                                            data: dict[str, Any] | None = None
                                            """The method result data."""
                                        

                                        data class-attribute instance-attribute

                                        data: dict[str, Any] | None = None
                                        

                                        The method result data.

                                        DeleteSessionResponse

                                        Bases: Response

                                        Response to session/delete.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class DeleteSessionResponse(Response):
                                            """Response to ``session/delete``."""
                                        

                                        ForkSessionResponse

                                        Bases: Response

                                        UNSTABLE: Response from forking an existing session.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class ForkSessionResponse(Response):
                                            """**UNSTABLE**: Response from forking an existing session."""
                                        
                                            modes: SessionModeState | None = None
                                            """Initial mode state if supported by the Agent
                                        
                                            See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
                                            """
                                        
                                            session_id: str
                                            """Unique identifier for the newly created forked session."""
                                        
                                            config_options: Sequence[SessionConfigOption] | None = None
                                            """The full list of config options with updated values."""
                                        
                                            @classmethod
                                            def create(
                                                cls,
                                                session_id: str,
                                                config_options: Sequence[SessionConfigOption] | None = None,
                                                modes: Sequence[SessionMode] | None = None,
                                                current_mode: str | None = None,
                                            ) -> Self:
                                                """Create a response with the given session ID and config options."""
                                                return cls(
                                                    session_id=session_id,
                                                    config_options=config_options or [],
                                                    modes=_mode_state(modes, current_mode),
                                                )
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] | None = None
                                        

                                        The full list of config options with updated values.

                                        modes class-attribute instance-attribute

                                        modes: SessionModeState | None = None
                                        

                                        Initial mode state if supported by the Agent

                                        See protocol docs: Session Modes

                                        session_id instance-attribute

                                        session_id: str
                                        

                                        Unique identifier for the newly created forked session.

                                        create classmethod

                                        create(
                                            session_id: str,
                                            config_options: Sequence[SessionConfigOption] | None = None,
                                            modes: Sequence[SessionMode] | None = None,
                                            current_mode: str | None = None,
                                        ) -> Self
                                        

                                        Create a response with the given session ID and config options.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        @classmethod
                                        def create(
                                            cls,
                                            session_id: str,
                                            config_options: Sequence[SessionConfigOption] | None = None,
                                            modes: Sequence[SessionMode] | None = None,
                                            current_mode: str | None = None,
                                        ) -> Self:
                                            """Create a response with the given session ID and config options."""
                                            return cls(
                                                session_id=session_id,
                                                config_options=config_options or [],
                                                modes=_mode_state(modes, current_mode),
                                            )
                                        

                                        InitializeResponse

                                        Bases: Response

                                        Response from the initialize method.

                                        Contains the negotiated protocol version and agent capabilities.

                                        See protocol docs: Initialization

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class InitializeResponse(Response):
                                            """Response from the initialize method.
                                        
                                            Contains the negotiated protocol version and agent capabilities.
                                        
                                            See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
                                            """
                                        
                                            agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)
                                            """Capabilities supported by the agent."""
                                        
                                            agent_info: Implementation | None = None
                                            """Information about the Agent name and version sent to the Client.
                                        
                                        
                                            Note: in future versions of the protocol, this will be required."""
                                        
                                            auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)
                                            """Authentication methods supported by the agent."""
                                        
                                            protocol_version: int = Field(ge=0, le=65535)
                                            """The protocol version the client specified if supported by the agent.
                                        
                                            Or the latest protocol version supported by the agent.
                                            The client should disconnect, if it doesn't support this version.
                                            """
                                        
                                            @classmethod
                                            def create(
                                                cls,
                                                name: str,
                                                title: str,
                                                version: str,
                                                protocol_version: int,
                                                load_session: bool | None = False,
                                                http_mcp_servers: bool = False,
                                                sse_mcp_servers: bool = False,
                                                audio_prompts: bool = False,
                                                embedded_context_prompts: bool = False,
                                                image_prompts: bool = False,
                                                list_sessions: bool = False,
                                                resume_session: bool = False,
                                                close_session: bool = False,
                                                auth_methods: Sequence[AuthMethod] | None = None,
                                            ) -> Self:
                                                """Create an instance of AgentCapabilities.
                                        
                                                Args:
                                                    name: The name of the agent.
                                                    title: The title of the agent.
                                                    version: The version of the agent.
                                                    protocol_version: The protocol version of the agent.
                                                    load_session: Whether the agent supports `session/load`.
                                                    http_mcp_servers: Whether the agent supports HTTP MCP servers.
                                                    sse_mcp_servers: Whether the agent supports SSE MCP servers.
                                                    audio_prompts: Whether the agent supports audio prompts.
                                                    embedded_context_prompts: Whether the agent supports embedded context prompts.
                                                    image_prompts: Whether the agent supports image prompts.
                                                    list_sessions: Whether the agent supports `session/list`.
                                                    resume_session: Whether the agent supports `session/resume`.
                                                    close_session: Whether the agent supports `session/close`.
                                                    auth_methods: The authentication methods supported by the agent.
                                                """
                                                caps = AgentCapabilities.create(
                                                    load_session=load_session,
                                                    http_mcp_servers=http_mcp_servers,
                                                    sse_mcp_servers=sse_mcp_servers,
                                                    audio_prompts=audio_prompts,
                                                    embedded_context_prompts=embedded_context_prompts,
                                                    image_prompts=image_prompts,
                                                    list_sessions=list_sessions,
                                                    resume_session=resume_session,
                                                    close_session=close_session,
                                                )
                                                return cls(
                                                    agent_info=Implementation(name=name, title=title, version=version),
                                                    protocol_version=protocol_version,
                                                    agent_capabilities=caps,
                                                    auth_methods=auth_methods,
                                                )
                                        

                                        agent_capabilities class-attribute instance-attribute

                                        agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)
                                        

                                        Capabilities supported by the agent.

                                        agent_info class-attribute instance-attribute

                                        agent_info: Implementation | None = None
                                        

                                        Information about the Agent name and version sent to the Client.

                                        Note: in future versions of the protocol, this will be required.

                                        auth_methods class-attribute instance-attribute

                                        auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)
                                        

                                        Authentication methods supported by the agent.

                                        protocol_version class-attribute instance-attribute

                                        protocol_version: int = Field(ge=0, le=65535)
                                        

                                        The protocol version the client specified if supported by the agent.

                                        Or the latest protocol version supported by the agent. The client should disconnect, if it doesn't support this version.

                                        create classmethod

                                        create(
                                            name: str,
                                            title: str,
                                            version: str,
                                            protocol_version: int,
                                            load_session: bool | None = False,
                                            http_mcp_servers: bool = False,
                                            sse_mcp_servers: bool = False,
                                            audio_prompts: bool = False,
                                            embedded_context_prompts: bool = False,
                                            image_prompts: bool = False,
                                            list_sessions: bool = False,
                                            resume_session: bool = False,
                                            close_session: bool = False,
                                            auth_methods: Sequence[AuthMethod] | None = None,
                                        ) -> Self
                                        

                                        Create an instance of AgentCapabilities.

                                        Parameters:

                                        Name Type Description Default
                                        name str

                                        The name of the agent.

                                        required
                                        title str

                                        The title of the agent.

                                        required
                                        version str

                                        The version of the agent.

                                        required
                                        protocol_version int

                                        The protocol version of the agent.

                                        required
                                        load_session bool | None

                                        Whether the agent supports session/load.

                                        False
                                        http_mcp_servers bool

                                        Whether the agent supports HTTP MCP servers.

                                        False
                                        sse_mcp_servers bool

                                        Whether the agent supports SSE MCP servers.

                                        False
                                        audio_prompts bool

                                        Whether the agent supports audio prompts.

                                        False
                                        embedded_context_prompts bool

                                        Whether the agent supports embedded context prompts.

                                        False
                                        image_prompts bool

                                        Whether the agent supports image prompts.

                                        False
                                        list_sessions bool

                                        Whether the agent supports session/list.

                                        False
                                        resume_session bool

                                        Whether the agent supports session/resume.

                                        False
                                        close_session bool

                                        Whether the agent supports session/close.

                                        False
                                        auth_methods Sequence[AuthMethod] | None

                                        The authentication methods supported by the agent.

                                        None
                                        Source code in src/aclientp/schema/agent_responses.py
                                        @classmethod
                                        def create(
                                            cls,
                                            name: str,
                                            title: str,
                                            version: str,
                                            protocol_version: int,
                                            load_session: bool | None = False,
                                            http_mcp_servers: bool = False,
                                            sse_mcp_servers: bool = False,
                                            audio_prompts: bool = False,
                                            embedded_context_prompts: bool = False,
                                            image_prompts: bool = False,
                                            list_sessions: bool = False,
                                            resume_session: bool = False,
                                            close_session: bool = False,
                                            auth_methods: Sequence[AuthMethod] | None = None,
                                        ) -> Self:
                                            """Create an instance of AgentCapabilities.
                                        
                                            Args:
                                                name: The name of the agent.
                                                title: The title of the agent.
                                                version: The version of the agent.
                                                protocol_version: The protocol version of the agent.
                                                load_session: Whether the agent supports `session/load`.
                                                http_mcp_servers: Whether the agent supports HTTP MCP servers.
                                                sse_mcp_servers: Whether the agent supports SSE MCP servers.
                                                audio_prompts: Whether the agent supports audio prompts.
                                                embedded_context_prompts: Whether the agent supports embedded context prompts.
                                                image_prompts: Whether the agent supports image prompts.
                                                list_sessions: Whether the agent supports `session/list`.
                                                resume_session: Whether the agent supports `session/resume`.
                                                close_session: Whether the agent supports `session/close`.
                                                auth_methods: The authentication methods supported by the agent.
                                            """
                                            caps = AgentCapabilities.create(
                                                load_session=load_session,
                                                http_mcp_servers=http_mcp_servers,
                                                sse_mcp_servers=sse_mcp_servers,
                                                audio_prompts=audio_prompts,
                                                embedded_context_prompts=embedded_context_prompts,
                                                image_prompts=image_prompts,
                                                list_sessions=list_sessions,
                                                resume_session=resume_session,
                                                close_session=close_session,
                                            )
                                            return cls(
                                                agent_info=Implementation(name=name, title=title, version=version),
                                                protocol_version=protocol_version,
                                                agent_capabilities=caps,
                                                auth_methods=auth_methods,
                                            )
                                        

                                        ListSessionsResponse

                                        Bases: Response

                                        Response from listing sessions.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class ListSessionsResponse(Response):
                                            """Response from listing sessions."""
                                        
                                            next_cursor: str | None = None
                                            """Opaque cursor token. If present, pass this in the next request's cursor parameter
                                            to fetch the next page. If absent, there are no more results."""
                                        
                                            sessions: Sequence[SessionInfo] = Field(default_factory=list)
                                            """Array of session information objects."""
                                        

                                        next_cursor class-attribute instance-attribute

                                        next_cursor: str | None = None
                                        

                                        Opaque cursor token. If present, pass this in the next request's cursor parameter to fetch the next page. If absent, there are no more results.

                                        sessions class-attribute instance-attribute

                                        sessions: Sequence[SessionInfo] = Field(default_factory=list)
                                        

                                        Array of session information objects.

                                        LoadSessionResponse

                                        Bases: Response

                                        Response from loading an existing session.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class LoadSessionResponse(Response):
                                            """Response from loading an existing session."""
                                        
                                            modes: SessionModeState | None = None
                                            """Initial mode state if supported by the Agent
                                        
                                            See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
                                            """
                                        
                                            config_options: Sequence[SessionConfigOption] | None = None
                                            """The full list of config options with updated values."""
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] | None = None
                                        

                                        The full list of config options with updated values.

                                        modes class-attribute instance-attribute

                                        modes: SessionModeState | None = None
                                        

                                        Initial mode state if supported by the Agent

                                        See protocol docs: Session Modes

                                        LogoutResponse

                                        Bases: Response

                                        Response to the logout method.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class LogoutResponse(Response):
                                            """Response to the ``logout`` method."""
                                        

                                        NewSessionResponse

                                        Bases: Response

                                        Response from creating a new session.

                                        See protocol docs: Creating a Session

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class NewSessionResponse(Response):
                                            """Response from creating a new session.
                                        
                                            See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
                                            """
                                        
                                            modes: SessionModeState | None = None
                                            """Initial mode state if supported by the Agent
                                        
                                            See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
                                            """
                                        
                                            config_options: Sequence[SessionConfigOption] | None = None
                                            """**Configuration options for this session."""
                                        
                                            session_id: str
                                            """Unique identifier for the created session.
                                        
                                            Used in all subsequent requests for this conversation.
                                            """
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] | None = None
                                        

                                        **Configuration options for this session.

                                        modes class-attribute instance-attribute

                                        modes: SessionModeState | None = None
                                        

                                        Initial mode state if supported by the Agent

                                        See protocol docs: Session Modes

                                        session_id instance-attribute

                                        session_id: str
                                        

                                        Unique identifier for the created session.

                                        Used in all subsequent requests for this conversation.

                                        PromptResponse

                                        Bases: Response

                                        Response from processing a user prompt.

                                        See protocol docs: Check for Completion

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class PromptResponse(Response):
                                            """Response from processing a user prompt.
                                        
                                            See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
                                            """
                                        
                                            stop_reason: StopReason
                                            """Indicates why the agent stopped processing the turn."""
                                        
                                            usage: Usage | None = None
                                            """**UNSTABLE**: Token usage for this turn (optional)."""
                                        

                                        stop_reason instance-attribute

                                        stop_reason: StopReason
                                        

                                        Indicates why the agent stopped processing the turn.

                                        usage class-attribute instance-attribute

                                        usage: Usage | None = None
                                        

                                        UNSTABLE: Token usage for this turn (optional).

                                        ResumeSessionResponse

                                        Bases: Response

                                        Response from resuming an existing session.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class ResumeSessionResponse(Response):
                                            """Response from resuming an existing session."""
                                        
                                            modes: SessionModeState | None = None
                                            """Initial mode state if supported by the Agent
                                        
                                            See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
                                            """
                                        
                                            config_options: Sequence[SessionConfigOption] | None = None
                                            """The full list of config options with updated values."""
                                        
                                            @classmethod
                                            def create(
                                                cls,
                                                config_options: Sequence[SessionConfigOption] | None = None,
                                                modes: Sequence[SessionMode] | None = None,
                                                current_mode: str | None = None,
                                            ) -> Self:
                                                """Create a response with the given config options and modes."""
                                                return cls(config_options=config_options or [], modes=_mode_state(modes, current_mode))
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] | None = None
                                        

                                        The full list of config options with updated values.

                                        modes class-attribute instance-attribute

                                        modes: SessionModeState | None = None
                                        

                                        Initial mode state if supported by the Agent

                                        See protocol docs: Session Modes

                                        create classmethod

                                        create(
                                            config_options: Sequence[SessionConfigOption] | None = None,
                                            modes: Sequence[SessionMode] | None = None,
                                            current_mode: str | None = None,
                                        ) -> Self
                                        

                                        Create a response with the given config options and modes.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        @classmethod
                                        def create(
                                            cls,
                                            config_options: Sequence[SessionConfigOption] | None = None,
                                            modes: Sequence[SessionMode] | None = None,
                                            current_mode: str | None = None,
                                        ) -> Self:
                                            """Create a response with the given config options and modes."""
                                            return cls(config_options=config_options or [], modes=_mode_state(modes, current_mode))
                                        

                                        SessionOptionsResponse

                                        Bases: Response

                                        UNSTABLE: The modes and config options a session would start with.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class SessionOptionsResponse(Response):
                                            """**UNSTABLE**: The modes and config options a session would start with."""
                                        
                                            modes: SessionModeState | None = None
                                            """The mode state the session would start with, if the Agent supports modes."""
                                        
                                            config_options: Sequence[SessionConfigOption] | None = None
                                            """The config options the session would start with."""
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] | None = None
                                        

                                        The config options the session would start with.

                                        modes class-attribute instance-attribute

                                        modes: SessionModeState | None = None
                                        

                                        The mode state the session would start with, if the Agent supports modes.

                                        SessionStatusResponse

                                        Bases: Response

                                        UNSTABLE: Response to session/status.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class SessionStatusResponse(Response):
                                            """**UNSTABLE**: Response to ``session/status``."""
                                        
                                            status: SessionStatus
                                            """Whether the Agent has the session in memory."""
                                        

                                        status instance-attribute

                                        status: SessionStatus
                                        

                                        Whether the Agent has the session in memory.

                                        SetSessionConfigOptionResponse

                                        Bases: Response

                                        Response to session/set_config_option method.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class SetSessionConfigOptionResponse(Response):
                                            """Response to `session/set_config_option` method."""
                                        
                                            config_options: Sequence[SessionConfigOption] = []
                                            """The full list of config options with updated values."""
                                        

                                        config_options class-attribute instance-attribute

                                        config_options: Sequence[SessionConfigOption] = []
                                        

                                        The full list of config options with updated values.

                                        SetSessionModeResponse

                                        Bases: Response

                                        Response to session/set_mode method.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class SetSessionModeResponse(Response):
                                            """Response to `session/set_mode` method."""
                                        

                                        SetSessionTitleResponse

                                        Bases: Response

                                        UNSTABLE: Response to session/set_title.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class SetSessionTitleResponse(Response):
                                            """**UNSTABLE**: Response to ``session/set_title``."""
                                        
                                            title: str
                                            """The title the Agent stored."""
                                        

                                        title instance-attribute

                                        title: str
                                        

                                        The title the Agent stored.

                                        UnarchiveSessionResponse

                                        Bases: Response

                                        UNSTABLE: Response to session/unarchive.

                                        Source code in src/aclientp/schema/agent_responses.py
                                        class UnarchiveSessionResponse(Response):
                                            """**UNSTABLE**: Response to ``session/unarchive``."""