Repository navigation
fix(generative_ai): update models, SDK configs, and RAG region across chat_completions, rag, and model_garden - #14681
Merged
Merged
Conversation
… chat_completions, rag, and model_garden Problem: Several samples in generative_ai/chat_completions, generative_ai/rag, and generative_ai/model_garden were failing due to retired model versions, outdated SDK imports/configurations, and regional tier defaults: 1. generative_ai/chat_completions samples referenced retired Gemini 1.5 models on regional endpoints and constructed single-turn tool-call conversations without appending the assistant tool_calls message. 2. generative_ai/model_garden Anthropic Claude samples referenced retired claude-3-5-sonnet-v2@20241022 and pinned an older anthropic[vertex] dependency. 3. generative_ai/rag samples referenced retired text-embedding-004 and gemini-2.0-flash-001 models, used outdated google.genai imports or non-existent client.files/client.corpora methods, passed both gcs_source and google_drive_source simultaneously in ImportRagFilesConfig (violating the API oneof constraint), omitted api_auth in Pinecone/Weaviate corpus creation configs, and defaulted to us-central1 (where Spanner-backed Basic tier requires allowlisting for new projects). Solution: - generative_ai/chat_completions (9 files): Update all OpenAI-compatible Vertex AI samples to use google/gemini-3.8-flash on the global endpoint, fix the two-turn function calling conversation flow in basic and config samples, and update test assertions in chat_completions_test.py. - generative_ai/model_garden (4 files): Update Claude samples from claude-3-5-sonnet-v2@20241022 to claude-sonnet-4-6 and bump anthropic[vertex] to 2.2.0. - generative_ai/rag (20 files): - Unify all RAG Engine samples on the unrestricted GA region us-east5 with a reference comment to the RAG Engine supported-regions documentation. - Update embedding model references from text-embedding-004 to text-embedding-005 and generation model references to gemini-3.8-flash. - Fix SDK methods (client.rag.delete_corpus, client.rag.get_corpus, client.rag.delete_file, client.rag.get_file, client.rag.list_files, client.rag.upload_file), genai_types imports, and ImportRagFilesConfig GCS source configuration. - Wire ApiAuth into RagVectorDbConfig in Pinecone and Weaviate corpus creation samples, and move rag_embedding_model_config inside RagVectorDbConfig in create_corpus_weaviate_example.py. - Update generative_ai/rag/requirements.txt to google-cloud-aiplatform==2.6.0 and google-genai==2.29.0.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates various generative AI examples across chat completions, model garden, and RAG modules to use new locations (such as "global" and "us-east5"), updates model references, and bumps dependency versions in requirements files. The review feedback highlights critical issues where several of the newly specified model names (such as "google/gemini-3.8-flash" and "claude-sonnet-4-6") and package dependency versions (such as "anthropic[vertex]==2.2.0", "google-cloud-aiplatform==2.6.0", and "google-genai==2.29.0") do not actually exist. It is recommended to use valid, existing model names and package versions to prevent runtime and installation failures.
holtskinner
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates samples across
generative_ai/chat_completions,generative_ai/rag, andgenerative_ai/model_gardento use current model versions, valid SDK methods/configs, and an unrestricted RAG Engine region:generative_ai/chat_completions(9 files):google/gemini-3.8-flashon theglobalendpoint.chat_completions_function_calling_basic.pyandchat_completions_function_calling_config.pyso the assistant'stool_callsmessage is included prior to thetoolresponse message.chat_completions_test.pyassertions for non-empty responses and tool call outputs.generative_ai/model_garden(4 files):claude_3_streaming_example.py,claude_3_tool_example.py,claude_3_unary_example.py) from retiredclaude-3-5-sonnet-v2@20241022toclaude-sonnet-4-6.anthropic[vertex]inrequirements.txtto2.2.0.generative_ai/rag(20 files):us-east5(see RAG Engine supported regions). Note: an alternative when using restricted regions such asus-central1is switchingRagEngineConfigtoServerlessmode.text-embedding-004totext-embedding-005and generation model references ingenerate_content_example.pyandquickstart_example.pytogemini-3.8-flash(via theglobalgenai.Client).agentplatformRAG SDK method calls (client.rag.delete_corpus,client.rag.get_corpus,client.rag.delete_file,client.rag.get_file,client.rag.list_files,client.rag.upload_file) andgoogle.genai.typesimports.import_files_example.pyandimport_files_async_example.pyto configuregcs_sourceinImportRagFilesConfig(which enforces a mutually exclusiveoneofacross data sources) and clarifies the function docstrings.api_authintoRagVectorDbConfigincreate_corpus_pinecone_example.pyandcreate_corpus_weaviate_example.py, and movesrag_embedding_model_configinsideRagVectorDbConfigincreate_corpus_weaviate_example.py.generative_ai/rag/requirements.txttogoogle-cloud-aiplatform==2.6.0andgoogle-genai==2.29.0.