Skip to content

RAG SDK rejects bare numeric resource IDs assigned by the Vertex AI API #6442

@urmzd

Description

@urmzd

Environment details

  • OS type and version: macOS
  • Python version: 3.13
  • google-cloud-aiplatform version: 1.x (current main)

Steps to reproduce

  1. Create a RAG corpus via the Vertex AI API (the API assigns a numeric ID like 1234567890)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions