| 73 | 'tools if you want to run dangerous code.') |
| 74 | |
| 75 | async def _get_tools_inner(self): |
| 76 | tools = { |
| 77 | 'file_system': [ |
| 78 | Tool( |
| 79 | tool_name='create_directory', |
| 80 | server_name='file_system', |
| 81 | description='Create a directory', |
| 82 | parameters={ |
| 83 | 'type': 'object', |
| 84 | 'properties': { |
| 85 | 'path': { |
| 86 | 'type': |
| 87 | 'string', |
| 88 | 'description': |
| 89 | 'The relative path of the directory to create', |
| 90 | } |
| 91 | }, |
| 92 | 'required': ['path'], |
| 93 | 'additionalProperties': False |
| 94 | }), |
| 95 | Tool( |
| 96 | tool_name='write_file', |
| 97 | server_name='file_system', |
| 98 | description='Write content into a file', |
| 99 | parameters={ |
| 100 | 'type': 'object', |
| 101 | 'properties': { |
| 102 | 'path': { |
| 103 | 'type': 'string', |
| 104 | 'description': 'The relative path of the file', |
| 105 | }, |
| 106 | 'content': { |
| 107 | 'type': 'string', |
| 108 | 'description': 'The content of the file', |
| 109 | }, |
| 110 | }, |
| 111 | 'required': ['path', 'content'], |
| 112 | 'additionalProperties': False |
| 113 | }), |
| 114 | Tool( |
| 115 | tool_name='read_abbreviation_file', |
| 116 | server_name='file_system', |
| 117 | description= |
| 118 | 'Read the abbreviation content of file(s). If the information is not enough, ' |
| 119 | 'read the original file by `read_file`', |
| 120 | parameters={ |
| 121 | 'type': 'object', |
| 122 | 'properties': { |
| 123 | 'paths': { |
| 124 | 'type': |
| 125 | 'array', |
| 126 | 'items': { |
| 127 | 'type': 'string' |
| 128 | }, |
| 129 | 'description': |
| 130 | 'List of relative file path(s) to read, format: {"paths": ["file1", "file2"]}"]}', |
| 131 | }, |
| 132 | }, |