File tree Expand file tree Collapse file tree
contributing/samples/local_environment_skill Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616from google .adk import Agent
1717from google .adk .environment import LocalEnvironment
18- from google .adk .tools .base_tool import BaseTool
1918from google .adk .tools .environment import EnvironmentToolset
20- from google .genai import types
21-
22-
23- class GetTimezoneTool (BaseTool ):
24- """A tool to get the timezone for a given location."""
25-
26- def __init__ (self ):
27- super ().__init__ (
28- name = "get_timezone" ,
29- description = "Returns the timezone for a given location." ,
30- )
31-
32- def _get_declaration (self ) -> types .FunctionDeclaration | None :
33- return types .FunctionDeclaration (
34- name = self .name ,
35- description = self .description ,
36- parameters_json_schema = {
37- "type" : "object" ,
38- "properties" : {
39- "location" : {
40- "type" : "string" ,
41- "description" : "The location to get the timezone for." ,
42- },
43- },
44- "required" : ["location" ],
45- },
46- )
47-
48- async def run_async (self , * , args : dict , tool_context ) -> str :
49- return f"The timezone for { args ['location' ]} is UTC+00:00."
5019
5120
5221def get_wind_speed (location : str ) -> str :
@@ -89,7 +58,6 @@ def get_wind_speed(location: str) -> str:
8958 working_dir = pathlib .Path (__file__ ).parent
9059 ),
9160 ),
92- GetTimezoneTool (),
9361 get_wind_speed ,
9462 ],
9563)
Original file line number Diff line number Diff line change 11---
22name : weather-skill
33description : A skill that provides weather information based on reference data.
4- metadata :
5- adk_additional_tools :
6- - get_wind_speed
74---
85
96Step 1: Check 'references/weather_info.md' for the current weather.
You can’t perform that action at this time.
0 commit comments