diff options
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, } |
