Skip to content

update_chat

update_chat(
    agent_space_id: AgentSpaceIdentifier,
    execution_id: ResourceId,
    *,
    config_overrides: Optional[DevOpsAgentClientConfig] = None,
    summary: Optional[str] = None,
    archive_status: Optional[ChatArchiveStatus] = None,
    client_token: Optional[str] = None,
) -> UpdateChatResponse

Updates a chat execution. You can use this operation to change the chat execution's summary or to archive or unarchive it.

Archiving a chat execution hides it from the default chat list. Unarchiving a chat execution restores it to the default chat list.

Parameters:

  • agent_space_id (AgentSpaceIdentifier) –

    The unique identifier of the agent space that contains the chat execution to update.

  • execution_id (ResourceId) –

    The unique identifier of the chat execution to update.

  • summary (Optional[str], default: None ) –

    The new summary to set for the chat execution.

  • archive_status (Optional[ChatArchiveStatus], default: None ) –

    The archive status to set for the chat execution. Use this parameter to archive the chat execution, hiding it from the default chat list, or to unarchive it, restoring it to the default chat list.

  • client_token (Optional[str], default: None ) –

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.

Raises:

Source code in docs_src/capo_devops_agent/_services/dev_ops_agent.py
def update_chat(
    self,
    agent_space_id: "capo_devops_agent.types.agent_space_identifier.AgentSpaceIdentifier",
    execution_id: "capo_devops_agent.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[DevOpsAgentClientConfig] = None,
    summary: Optional[str] = None,
    archive_status: Optional[
        "capo_devops_agent.types.chat_archive_status.ChatArchiveStatus"
    ] = None,
    client_token: Optional[str] = None,
) -> "capo_devops_agent.types.update_chat_response.UpdateChatResponse":
    """<p>Updates a chat execution. You can use this operation to change the chat execution's summary or to archive or unarchive it.</p><p>Archiving a chat execution hides it from the default chat list. Unarchiving a chat execution restores it to the default chat list.</p>

    Args:
        agent_space_id: <p>The unique identifier of the agent space that contains the chat execution to update.</p>
        execution_id: <p>The unique identifier of the chat execution to update.</p>
        summary: <p>The new summary to set for the chat execution.</p>
        archive_status: <p>The archive status to set for the chat execution. Use this parameter to archive the chat execution, hiding it from the default chat list, or to unarchive it, restoring it to the default chat list.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.</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.update_chat_request.UpdateChatRequest]",
    ) -> OperationResponse[
        "capo_devops_agent.types.update_chat_response.UpdateChatResponse"
    ]:
        import capo_devops_agent._operations.dev_ops_agent.update_chat

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateChat")
    )
    input_: capo_devops_agent.types.update_chat_request.UpdateChatRequest = {
        "agent_space_id": agent_space_id,
        "execution_id": execution_id,
    }
    if summary is not None:
        input_["summary"] = summary
    if archive_status is not None:
        input_["archive_status"] = archive_status
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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