Environment details
- OS type and version: macOS
- Python version: 3.13
google-cloud-aiplatform version: 1.x (current main)
Steps to reproduce
- Create a RAG corpus via the Vertex AI API (the API assigns a numeric ID like
1234567890)
- Call
rag.get_corpus("1234567890") with that bare numeric ID
Code example
from vertexai.preview import rag
# The API assigns numeric IDs to corpora. Passing one back raises ValueError:
corpus = rag.get_corpus("1234567890")
Stack trace
ValueError: name must be of the format
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` or `{rag_corpus}`
Root cause: _VALID_RESOURCE_NAME_REGEX in _gapic_utils.py is [a-z][a-zA-Z0-9._-]{0,127} — requires the first character to be a lowercase letter, so purely numeric IDs fail the match.
Environment details
google-cloud-aiplatformversion: 1.x (current main)Steps to reproduce
1234567890)rag.get_corpus("1234567890")with that bare numeric IDCode example
Stack trace
Root cause:
_VALID_RESOURCE_NAME_REGEXin_gapic_utils.pyis[a-z][a-zA-Z0-9._-]{0,127}— requires the first character to be a lowercase letter, so purely numeric IDs fail the match.