diff options
Diffstat (limited to 'agents/demo/tools.py')
| -rw-r--r-- | agents/demo/tools.py | 14 |
1 files changed, 6 insertions, 8 deletions
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') |
