Skip to content

Commit d9157b4

Browse files
committed
feat(genai): Add region tags
1 parent 728c47d commit d9157b4

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

genai/tools/tools_code_exec_with_txt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def generate_content() -> str:
17-
# [START genai_function_calling_code_execution]
17+
# [START googlegenaisdk_tools_code_exec_with_txt]
1818
from google import genai
1919
from google.genai.types import Tool, ToolCodeExecution, GenerateContentConfig
2020

@@ -41,7 +41,7 @@ def generate_content() -> str:
4141
# code='...' language='PYTHON'
4242
# outcome='OUTCOME_OK' output='Lower Palindrome: 6666\nHigher Palindrome: 6776\nNearest Palindrome to 6765: 6776\n'
4343

44-
# [END genai_function_calling_code_execution]
44+
# [END googlegenaisdk_tools_code_exec_with_txt]
4545
return str(response.candidates[0].content.parts)
4646

4747

genai/tools/tools_code_exec_with_txt_local_img.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def generate_content() -> GenerateContentResponse:
19-
# [START googlegenaisdk_tools_code_execution_with_txt_local_img]
19+
# [START googlegenaisdk_tools_code_exec_with_txt_local_img]
2020
from PIL import Image
2121
from google import genai
2222
from google.genai.types import Tool, ToolCodeExecution, GenerateContentConfig
@@ -67,7 +67,7 @@ def generate_content() -> GenerateContentResponse:
6767
# ...
6868
# # Outcome:
6969
# outcome=<Outcome.OUTCOME_OK: 'OUTCOME_OK'> output='Win percentage when switching: 65.90%\nWin percentage when not switching: 34.10%\n'
70-
# [END tools_code_execution_with_txt_local_img]
70+
# [END googlegenaisdk_tools_code_exec_with_txt_local_img]
7171
return response
7272

7373

genai/tools/tools_func_def_with_txt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def generate_content() -> str:
17-
# [START genai_function_calling_direct_code]
17+
# [START googlegenaisdk_tools_func_def_with_txt]
1818
from google import genai
1919
from google.genai.types import GenerateContentConfig
2020

@@ -43,7 +43,7 @@ def get_current_weather(location: str) -> str:
4343
print(response.text)
4444
# Example response:
4545
# The weather in Boston is sunny.
46-
# [END genai_function_calling_direct_code]
46+
# [END googlegenaisdk_tools_func_def_with_txt]
4747
return response.text
4848

4949

genai/tools/tools_func_desc_with_txt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def generate_content() -> str:
17-
# [START genai_function_calling01]
17+
# [START googlegenaisdk_tools_func_desc_with_txt]
1818
from google import genai
1919
from google.genai.types import FunctionDeclaration, Tool, GenerateContentConfig
2020

@@ -83,7 +83,7 @@ def generate_content() -> str:
8383
# },
8484
# )]
8585

86-
# [END genai_function_calling01]
86+
# [END googlegenaisdk_tools_func_desc_with_txt]
8787
return str(response.candidates[0].content.parts[0].function_call)
8888

8989

genai/tools/tools_google_search_with_txt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515

1616
def generate_content() -> str:
17+
# [START googlegenaisdk_tools_google_search_with_txt]
1718
from google import genai
1819
from google.genai.types import Tool, GenerateContentConfig, GoogleSearch
1920

@@ -33,6 +34,7 @@ def generate_content() -> str:
3334
print(response.candidates[0].content.parts[0].text)
3435
# Example response:
3536
# 'The next total solar eclipse in the United States will occur on ...'
37+
# [END googlegenaisdk_tools_google_search_with_txt]
3638
return response.candidates[0].content.parts[0].text
3739

3840

0 commit comments

Comments
 (0)