From 213d1b3fd72d2572050402b6be25cad590a9cb95 Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 29 Jul 2024 17:26:36 +0800 Subject: refactor: demo agent (#81) --- agents/demo/tools.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'agents/demo/tools.py') diff --git a/agents/demo/tools.py b/agents/demo/tools.py index ec7ca2b..be8a773 100644 --- a/agents/demo/tools.py +++ b/agents/demo/tools.py @@ -1,11 +1,9 @@ -import os -import platform +import urllib.request -def get_sysinfo(): +def get_ipinfo(): """ - Get the system info + Get the ip info """ - return "\n".join([ - f"OS: {platform.system()}", - f"Arch: {platform.machine()}", - ]) \ No newline at end of file + with urllib.request.urlopen("https://httpbin.org/ip") as response: + data = response.read() + return data.decode('utf-8') -- cgit v1.2.3