We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09e274c commit a27a31bCopy full SHA for a27a31b
generative_ai/grounding/web_example.py
@@ -36,7 +36,14 @@ def generate_text_with_grounding_web() -> GenerationResponse:
36
model = GenerativeModel("gemini-1.5-flash-001")
37
38
# Use Google Search for grounding
39
- tool = Tool.from_google_search_retrieval(grounding.GoogleSearchRetrieval())
+ tool = Tool.from_google_search_retrieval(
40
+ grounding.GoogleSearchRetrieval(
41
+ # Optional: For Dynamic Retrieval
42
+ dynamic_retrieval_config=grounding.DynamicRetrievalConfig(
43
+ dynamic_threshold=0.7,
44
+ )
45
46
47
48
prompt = "When is the next total solar eclipse in US?"
49
response = model.generate_content(
0 commit comments