diff --git a/samples/agent/adk/contact_lookup/tools.py b/samples/agent/adk/contact_lookup/tools.py index 56c9e15e..77630a0b 100644 --- a/samples/agent/adk/contact_lookup/tools.py +++ b/samples/agent/adk/contact_lookup/tools.py @@ -34,7 +34,7 @@ def get_contact_info(name: str, tool_context: ToolContext, department: str = "") try: script_dir = os.path.dirname(__file__) file_path = os.path.join(script_dir, "contact_data.json") - with open(file_path) as f: + with open(file_path, encoding="utf-8") as f: contact_data_str = f.read() if base_url := tool_context.state.get("base_url"): contact_data_str = contact_data_str.replace("http://localhost:10002", base_url) diff --git a/samples/agent/adk/restaurant_finder/tools.py b/samples/agent/adk/restaurant_finder/tools.py index 6a6dd453..7dc081fa 100644 --- a/samples/agent/adk/restaurant_finder/tools.py +++ b/samples/agent/adk/restaurant_finder/tools.py @@ -34,7 +34,7 @@ def get_restaurants(cuisine: str, location: str, tool_context: ToolContext, cou try: script_dir = os.path.dirname(__file__) file_path = os.path.join(script_dir, "restaurant_data.json") - with open(file_path) as f: + with open(file_path, encoding="utf-8") as f: restaurant_data_str = f.read() if base_url := tool_context.state.get("base_url"): restaurant_data_str = restaurant_data_str.replace("http://localhost:10002", base_url)