From 5283c94b3e38ac05b705f7858a27b35cdbd3fa8c Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Wed, 5 Mar 2025 12:11:40 -0600 Subject: [PATCH] docs(generative_ai): Update Dynamic Retrieval for Grounding to include Mode --- generative_ai/grounding/requirements.txt | 2 +- generative_ai/grounding/web_example.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/generative_ai/grounding/requirements.txt b/generative_ai/grounding/requirements.txt index 49cebea8dc8..250437ef3ea 100644 --- a/generative_ai/grounding/requirements.txt +++ b/generative_ai/grounding/requirements.txt @@ -1 +1 @@ -google-cloud-aiplatform==1.78.0 +google-cloud-aiplatform==1.82.0 diff --git a/generative_ai/grounding/web_example.py b/generative_ai/grounding/web_example.py index 9c92a4a6faf..926dd6b3aee 100644 --- a/generative_ai/grounding/web_example.py +++ b/generative_ai/grounding/web_example.py @@ -40,6 +40,7 @@ def generate_text_with_grounding_web() -> GenerationResponse: grounding.GoogleSearchRetrieval( # Optional: For Dynamic Retrieval dynamic_retrieval_config=grounding.DynamicRetrievalConfig( + mode=grounding.DynamicRetrievalConfig.Mode.MODE_DYNAMIC, dynamic_threshold=0.7, ) ) @@ -54,7 +55,7 @@ def generate_text_with_grounding_web() -> GenerationResponse: ), ) - print(response.text) + print(response) # Example response: # The next total solar eclipse visible from the contiguous United States will be on **August 23, 2044**.