aboutsummaryrefslogtreecommitdiffstats
path: root/agents/demo/tools.py
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-29 17:26:36 +0800
committerGitHub <noreply@github.com>2024-07-29 17:26:36 +0800
commit213d1b3fd72d2572050402b6be25cad590a9cb95 (patch)
treec153a8ededeeb1bb1326e9edbb193685a4198b8b /agents/demo/tools.py
parent226228dfa45aa075f1a74b07885407d9dba6017f (diff)
downloadllm-functions-docker-213d1b3fd72d2572050402b6be25cad590a9cb95.tar.gz
refactor: demo agent (#81)
Diffstat (limited to 'agents/demo/tools.py')
-rw-r--r--agents/demo/tools.py14
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')