From b02462b0ff0194379dd8be0683fa4aef33627772 Mon Sep 17 00:00:00 2001 From: tbeyer-google Date: Mon, 13 Oct 2025 12:24:45 +0200 Subject: [PATCH 1/5] Update tools_google_search_with_txt.py to include example for exclude_domains --- genai/tools/tools_google_search_with_txt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genai/tools/tools_google_search_with_txt.py b/genai/tools/tools_google_search_with_txt.py index 2f650b01df9..e92282e4236 100644 --- a/genai/tools/tools_google_search_with_txt.py +++ b/genai/tools/tools_google_search_with_txt.py @@ -31,7 +31,7 @@ def generate_content() -> str: config=GenerateContentConfig( tools=[ # Use Google Search Tool - Tool(google_search=GoogleSearch()) + Tool(google_search=GoogleSearch(exclude_domains = [ "domain.com", "domain2.com" ])) ], ), ) From 34bdc849c0553208e1edd6b134d4e5a0d3067412 Mon Sep 17 00:00:00 2001 From: tbeyer-google Date: Mon, 13 Oct 2025 12:54:08 +0200 Subject: [PATCH 2/5] Update genai/tools/tools_google_search_with_txt.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- genai/tools/tools_google_search_with_txt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genai/tools/tools_google_search_with_txt.py b/genai/tools/tools_google_search_with_txt.py index e92282e4236..d17b7053c91 100644 --- a/genai/tools/tools_google_search_with_txt.py +++ b/genai/tools/tools_google_search_with_txt.py @@ -31,7 +31,7 @@ def generate_content() -> str: config=GenerateContentConfig( tools=[ # Use Google Search Tool - Tool(google_search=GoogleSearch(exclude_domains = [ "domain.com", "domain2.com" ])) + Tool(google_search=GoogleSearch(exclude_domains=["domain.com", "domain2.com"])) ], ), ) From 7e265cb8f726649fb1bc2fa328ea027b2afbae9d Mon Sep 17 00:00:00 2001 From: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Date: Tue, 14 Oct 2025 09:56:05 -0500 Subject: [PATCH 3/5] Update genai/tools/tools_google_search_with_txt.py --- genai/tools/tools_google_search_with_txt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/genai/tools/tools_google_search_with_txt.py b/genai/tools/tools_google_search_with_txt.py index d17b7053c91..4069071d0c3 100644 --- a/genai/tools/tools_google_search_with_txt.py +++ b/genai/tools/tools_google_search_with_txt.py @@ -31,7 +31,12 @@ def generate_content() -> str: config=GenerateContentConfig( tools=[ # Use Google Search Tool - Tool(google_search=GoogleSearch(exclude_domains=["domain.com", "domain2.com"])) + Tool( + google_search=GoogleSearch( + # Optional: Domains to exclude from results + exclude_domains=["domain.com", "domain2.com"] + ) + ) ], ), ) From 8e6505ca0043816e5fcf0d5143e6552882406188 Mon Sep 17 00:00:00 2001 From: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:00:36 -0500 Subject: [PATCH 4/5] Update requirements --- genai/tools/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genai/tools/requirements.txt b/genai/tools/requirements.txt index 13bc5aa5291..deb2c06047c 100644 --- a/genai/tools/requirements.txt +++ b/genai/tools/requirements.txt @@ -1,3 +1,3 @@ -google-genai==1.27.0 +google-genai>=1.43.0 # PIl is required for tools_code_execution_with_txt_img.py pillow==11.1.0 From bd1b44cc290f29651d2722e4e4b792bfaae1f8c6 Mon Sep 17 00:00:00 2001 From: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Date: Mon, 20 Oct 2025 09:56:05 -0500 Subject: [PATCH 5/5] Update genai/tools/requirements.txt Co-authored-by: Katie McLaughlin --- genai/tools/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genai/tools/requirements.txt b/genai/tools/requirements.txt index deb2c06047c..9f6fafbe8ec 100644 --- a/genai/tools/requirements.txt +++ b/genai/tools/requirements.txt @@ -1,3 +1,3 @@ -google-genai>=1.43.0 +google-genai==1.45.0 # PIl is required for tools_code_execution_with_txt_img.py pillow==11.1.0