Skip to content

Commit 0c67410

Browse files
GWealecopybara-github
authored andcommitted
fix(samples): widen numeric tool parameters to match their docstrings
Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 965383656
1 parent 5134c9b commit 0c67410

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • contributing/samples

contributing/samples/evaluation/home_automation_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_temperature(location: str) -> str:
6060
return f"{_TEMPERATURES[location]}"
6161

6262

63-
def set_temperature(location: str, temperature: int) -> str:
63+
def set_temperature(location: str, temperature: float) -> str:
6464
"""Sets the target temperature (Celsius) for a location.
6565
6666
Acceptable range is 18-30 Celsius. Do not call this tool with a value

contributing/samples/hitl/human_tool_confirmation/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
from google.genai import types
2222

2323

24-
def reimburse(amount: int, tool_context: ToolContext) -> dict[str, str]:
24+
def reimburse(amount: float, tool_context: ToolContext) -> dict[str, str]:
2525
"""Reimburse the employee for the given amount."""
2626
return {'status': 'ok'}
2727

2828

2929
async def confirmation_threshold(
30-
amount: int, tool_context: ToolContext
30+
amount: float, tool_context: ToolContext
3131
) -> bool:
3232
"""Returns true if the amount is greater than 1000."""
3333
return amount > 1000

contributing/samples/tools/hello_world_stream_fc_args/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from google.genai import types
1717

1818

19-
def concat_number_and_string(num: int, s: str) -> str:
19+
def concat_number_and_string(num: float, s: str) -> str:
2020
"""Concatenate a number and a string.
2121
2222
Args:

0 commit comments

Comments
 (0)