Content-Length: 216139 | pFad | http://github.com/googleapis/python-aiplatform/issues/5286

18 gRPC Metadata not being passed in VertexRagDataServiceClient when polling for LRO · Issue #5286 · googleapis/python-aiplatform · GitHub
Skip to content

gRPC Metadata not being passed in VertexRagDataServiceClient when polling for LRO #5286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BalasubramanyamEvani opened this issue May 1, 2025 · 0 comments
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.

Comments

@BalasubramanyamEvani
Copy link

Environment details

  • OS type and version: macOS Sonoma Version 14.3.1
  • Python version: Python 3.12.9
  • pip version: pip 25.1
  • google-cloud-aiplatform version: 1.91.0

Steps to reproduce

  1. Do vertex.init with custom metadata
  2. Create RAG Corpus

Code example

def create_rag_corpus(
    display_name: str,
    description: str,
    embedding_model: str,
) -> rag.RagCorpus:
    embedding_model_config = rag.EmbeddingModelConfig(publisher_model=embedding_model)
    corpus = rag.create_corpus(
        display_name=display_name,
        description=description,
        embedding_model_config=embedding_model_config,
    )
    return corpus

vertexai_metadata = [
    ("client-id", CLIENT_ID),
    ("client-secret", CLIENT_SECRET),
    ("user-agent", "test"),
]

# Initialize vertexai with the correct configuration
vertexai.init(
    project=GOOGLE_CLOUD_PROJECT,
    location=GOOGLE_CLOUD_LOCATION,
    request_metadata=vertexai_metadata,
    api_endpoint="http://url.com",
    api_transport="rest",
)

Issue

While initializing Vertex AI with custom metadata, necessary for routing API calls through a proxy, I noticed that although the RAG corpus is created successfully, it appears to get stuck when polling for the status of the creation request.

Reason

This seems to be due to how the Operation future is currently being constructed in VertexRagDataServiceClient. At the moment, the gRPC metadata isn't being passed into the following code:

response = gac_operation.from_gapic(
    response,
    self._transport.operations_client,
    vertex_rag_data.RagCorpus,
    metadata_type=vertex_rag_data_service.CreateRagCorpusOperationMetadata,
)

Resolution

A small tweak here resolves the issue nicely:

response = gac_operation.from_gapic(
    response,
    self._transport.operations_client,
    vertex_rag_data.RagCorpus,
    grpc_metadata=metadata, # Added
    metadata_type=vertex_rag_data_service.CreateRagCorpusOperationMetadata,
)

A similar fix would be needed for other VertexRagDataServiceClient operations like delete_rag_corpus, update_rag_corpus, etc.

I’d be happy to open a PR with the changes, if the changes seems fine.

Thanks!

@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/python-aiplatform/issues/5286

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy