Spaces:
Sleeping
Sleeping
Create tools.py
Browse files- app/agent/tools.py +12 -0
app/agent/tools.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
def read_file(path):
|
| 4 |
+
with open(path, "r") as f:
|
| 5 |
+
return f.read()
|
| 6 |
+
|
| 7 |
+
def write_file(path, content):
|
| 8 |
+
with open(path, "w") as f:
|
| 9 |
+
f.write(content)
|
| 10 |
+
|
| 11 |
+
def list_files(path="."):
|
| 12 |
+
return os.listdir(path)
|