Skip to content

Commit 4ce5e00

Browse files
Create system_info.py
1 parent 1d3b03c commit 4ce5e00

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

mini_agent/system_info.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import psutil, platform, json
2+
3+
def get_system_info():
4+
return {
5+
"os": platform.system(),
6+
"cpu": platform.processor(),
7+
"cores": psutil.cpu_count(logical=False),
8+
"threads": psutil.cpu_count(logical=True),
9+
"ram_gb": round(psutil.virtual_memory().total / 1e9, 2),
10+
"battery": psutil.sensors_battery().percent if psutil.sensors_battery() else None,
11+
"net": psutil.net_if_addrs()
12+
}
13+
14+
if __name__ == "__main__":
15+
print(json.dumps(get_system_info(), indent=2))

0 commit comments

Comments
 (0)