Skip to content

refactor(alloydb): migrate batch processing notebook to genai SDK - #14537

Draft
XrossFox wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
XrossFox:vertex-to-genai-alloydb-notebook
Draft

refactor(alloydb): migrate batch processing notebook to genai SDK#14537
XrossFox wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
XrossFox:vertex-to-genai-alloydb-notebook

Conversation

@XrossFox

@XrossFox XrossFox commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Updates snippets in the embeddings_batch_processing.ipynb notebook to use the newer google-genai SDK.

Fixes b/540948497

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

Tested locally:

image

 Updates snippets in the `embeddings_batch_processing.ipynb` notebook to use the newer `google-genai` SDK.
@product-auto-label product-auto-label Bot added api: alloydb Issues related to the AlloyDB API. samples Issues that are directly related to samples. api: notebooks Issues related to the Agent Platform Workbench API. labels Aug 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the embedding batch processing notebook from the legacy vertexai SDK to the new google-genai SDK. The changes include updating dependencies, initializing a shared genai.Client, and refactoring the asynchronous embedding generation to use client.aio.models.embed_content. A potential runtime issue was identified where fallback logic references a non-existent embedding attribute on the response object, which could raise an AttributeError if embeddings is falsy.

Comment thread alloydb/notebooks/embeddings_batch_processing.ipynb
" ...\n",
" ]\n",
" where col1 and col2 are columns containing data to be embedded.\n",
" Raises:\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Raises still required due the line raise e 879

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, i'll add it back.

@Kef131 Kef131 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: alloydb Issues related to the AlloyDB API. api: notebooks Issues related to the Agent Platform Workbench API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants