Method: projects.locations.ragCorpora.delete

Deletes a RagCorpus.

Endpoint

delete https://aiplatform.googleapis.com/v1beta1/{name}

Path parameters

name string

Required. The name of the RagCorpus resource to be deleted. Format: projects/{project}/locations/{location}/ragCorpora/{ragCorpus}

Query parameters

force boolean

Optional. If set to true, any RagFiles in this RagCorpus will also be deleted. Otherwise, the request will only work if the RagCorpus has no RagFiles.

Request body

The request body must be empty.

Example request

Python


from vertexai.preview import rag
import vertexai

# TODO(developer): Update and un-comment below lines
# PROJECT_ID = "your-project-id"
# corpus_name = "projects/{PROJECT_ID}/locations/us-central1/ragCorpora/{rag_corpus_id}"

# Initialize Vertex AI API once per session
vertexai.init(project=PROJECT_ID, location="us-central1")

rag.delete_corpus(name=corpus_name)
print(f"Corpus {corpus_name} deleted.")
# Example response:
# Successfully deleted the RagCorpus.
# Corpus projects/[PROJECT_ID]/locations/us-central1/ragCorpora/123456789012345 deleted.

Response body

If successful, the response body contains an instance of Operation.