diff options
| author | CaptainJack2491 <jayrupnakawala@gmail.com> | 2025-11-16 20:25:08 +0000 |
|---|---|---|
| committer | CaptainJack2491 <jayrupnakawala@gmail.com> | 2025-11-16 20:25:08 +0000 |
| commit | a57ab036dfeed7bc7e0ef0f7da033c1301e12d1f (patch) | |
| tree | 840d72a2c5e0b62e00d5f2783de5cc08f2d1d578 /src/agents/03-logs/tools.py | |
| parent | 66924c7d481032e999d12aa7bf1a803f8b7b4d4f (diff) | |
added more tools
Diffstat (limited to 'src/agents/03-logs/tools.py')
| -rw-r--r-- | src/agents/03-logs/tools.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/agents/03-logs/tools.py b/src/agents/03-logs/tools.py index 9726cae..084af55 100644 --- a/src/agents/03-logs/tools.py +++ b/src/agents/03-logs/tools.py @@ -28,6 +28,21 @@ def create_file(file_path, content): """ return vfs_instance.create_file(file_path, content) +def read_file(file_path): + """ + Read the content of a file. + :param file_path: The path to the file to read. + :return: The content of the file. + """ + return vfs_instance.read_file(file_path) + +def delete_file(file_path): + """ + Delete a file. + :param file_path: The path to the file to delete. + """ + return vfs_instance.delete_file(file_path) + tools = [ { "type": "function", @@ -71,6 +86,34 @@ tools = [ "required": ["file_path", "content"], }, } + }, + { + "type": "function", + "function": { + "name": "read_file", + "description": "Read the content of a file.", + "parameters": { + "type": "object", + "properties": { + "file_path": {"type": "string", "description": "The path to the file to read."}, + }, + "required": ["file_path"], + }, + } + }, + { + "type": "function", + "function": { + "name": "delete_file", + "description": "Delete a file.", + "parameters": { + "type": "object", + "properties": { + "file_path": {"type": "string", "description": "The path to the file to delete."}, + }, + "required": ["file_path"], + }, + } } ] @@ -78,4 +121,6 @@ available_functions = { "check_username": check_username, "list_files": list_files, "create_file": create_file, + "read_file": read_file, + "delete_file": delete_file, } |
