Skip to content

create_chat

create_chat(
    agent_space_id: AgentSpaceIdentifier,
    *,
    config_overrides: Optional[DevOpsAgentClientConfig] = None,
    user_id: Optional[ResourceId] = None,
    user_type: Optional[UserType] = None,
) -> CreateChatResponse

Creates a new chat execution in the specified agent space

Parameters:

  • agent_space_id (AgentSpaceIdentifier) –

    The unique identifier for the agent space where the chat will be created.

  • user_id (Optional[ResourceId], default: None ) –

    The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.

  • user_type (Optional[UserType], default: None ) –

    The authentication type of the user

Raises:

Source code in docs_src/capo_devops_agent/_services/dev_ops_agent.py
def create_chat(
    self,
    agent_space_id: "capo_devops_agent.types.agent_space_identifier.AgentSpaceIdentifier",
    *,
    config_overrides: Optional[DevOpsAgentClientConfig] = None,
    user_id: Optional["capo_devops_agent.types.resource_id.ResourceId"] = None,
    user_type: Optional["capo_devops_agent.types.user_type.UserType"] = None,
) -> "capo_devops_agent.types.create_chat_response.CreateChatResponse":
    """<p>Creates a new chat execution in the specified agent space</p>

    Args:
        agent_space_id: <p>The unique identifier for the agent space where the chat will be created.</p>
        user_id: <p>The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
        user_type: <p>The authentication type of the user</p>

    Raises:
        capo_devops_agent.errors.access_denied_exception.AccessDeniedException: <p>Access to the requested resource is denied due to insufficient permissions.</p>
        capo_devops_agent.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_devops_agent.errors.content_size_exceeded_exception.ContentSizeExceededException: <p>This exception is thrown when the content size exceeds the allowed limit.</p>
        capo_devops_agent.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when an unexpected error occurs in the processing of a request.</p>
        capo_devops_agent.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters provided in the request are invalid.</p>
        capo_devops_agent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_devops_agent.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed the service quota limit.</p>
        capo_devops_agent.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please slow down and try again.</p>
        capo_devops_agent.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_devops_agent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_devops_agent.types.create_chat_request.CreateChatRequest]",
    ) -> OperationResponse[
        "capo_devops_agent.types.create_chat_response.CreateChatResponse"
    ]:
        import capo_devops_agent._operations.dev_ops_agent.create_chat

        output, http_response = (
            capo_devops_agent._operations.dev_ops_agent.create_chat.create_chat(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateChat")
    )
    input_: capo_devops_agent.types.create_chat_request.CreateChatRequest = {
        "agent_space_id": agent_space_id
    }
    if user_id is not None:
        input_["user_id"] = user_id
    if user_type is not None:
        input_["user_type"] = user_type

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output