File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
contributing/samples/skills_agent Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1717import pathlib
1818
1919from google .adk import Agent
20+ from google .adk .code_executors .unsafe_local_code_executor import UnsafeLocalCodeExecutor
2021from google .adk .skills import load_skill_from_dir
2122from google .adk .skills import models
2223from google .adk .tools .skill_toolset import SkillToolset
4445 pathlib .Path (__file__ ).parent / "skills" / "weather-skill"
4546)
4647
47- my_skill_toolset = SkillToolset (skills = [greeting_skill , weather_skill ])
48+ # WARNING: UnsafeLocalCodeExecutor has security concerns and should NOT
49+ # be used in production environments.
50+ my_skill_toolset = SkillToolset (
51+ skills = [greeting_skill , weather_skill ],
52+ code_executor = UnsafeLocalCodeExecutor (),
53+ )
4854
4955root_agent = Agent (
5056 model = "gemini-2.5-flash" ,
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ description: A skill that provides weather information based on reference data.
44---
55
66Step 1: Check 'references/weather_info.md' for the current weather.
7- Step 2: Provide the weather update to the user.
7+ Step 2: If humidity is requested, use run 'scripts/get_humidity.py' with the ` location ` argument.
8+ Step 3: Provide the update to the user.
Original file line number Diff line number Diff line change 1+ # Copyright 2026 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ import argparse
16+
17+
18+ def get_humidity (location : str ) -> str :
19+ """Fetch live humidity for a given location. (Simulated)"""
20+ print (f"Fetching live humidity for { location } ..." )
21+ return "45% (Simulated)"
22+
23+
24+ if __name__ == "__main__" :
25+ parser = argparse .ArgumentParser ()
26+ parser .add_argument ("--location" , type = str , default = "Mountain View" )
27+ args = parser .parse_args ()
28+
29+ print (get_humidity (args .location ))
You can’t perform that action at this time.
0 commit comments