Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Fix tool factories; Add fs and process tools
Tomas Valenta20b13d23fcd1
diff --git a/api-service/codegen/tools/playground/main.py b/api-service/codegen/tools/playground/main.pyindex 7f179ac75..559a1aaf8 100644--- a/api-service/codegen/tools/playground/main.py+++ b/api-service/codegen/tools/playground/main.py@@ -31,8 +31,8 @@ def create_playground_tools(for tools in (tool_factory(playground=playground, mock=mock)for tool_factory in [- # create_filesystem_tools,- # create_process_tools,+ create_filesystem_tools,+ create_process_tools,create_code_tools,])diff --git a/api-service/codegen/tools/playground/tools/code.py b/api-service/codegen/tools/playground/tools/code.pyindex 086183691..3c4a340de 100644--- a/api-service/codegen/tools/playground/tools/code.py+++ b/api-service/codegen/tools/playground/tools/code.py@@ -9,7 +9,7 @@ def extract_code(code: str):return code.strip().strip("`").strip()-def create_code_tools(playground: NodeJSPlayground, mock: MockRequestFactory):+def create_code_tools(playground: NodeJSPlayground, mock: MockRequestFactory, **kwargs):# Ensure that the function is a generator even if no tools are yieldedyield from ()@@ -70,8 +70,6 @@ def create_code_tools(playground: NodeJSPlayground, mock: MockRequestFactory):request_result = encode_command_output(request_output)server_result = encode_command_output(server_output)- return (- f"Curl result:\n{request_result}\nCode execution result:\n{server_result}"- )+ return f"Curl output:\n{request_result}\nServer output:\n{server_result}"yield curl_javascript_serverdiff --git a/api-service/codegen/tools/playground/tools/filesystem.py b/api-service/codegen/tools/playground/tools/filesystem.pyindex 6d41d482c..08115faa2 100644--- a/api-service/codegen/tools/playground/tools/filesystem.py+++ b/api-service/codegen/tools/playground/tools/filesystem.py@@ -14,7 +14,7 @@ def encode_directory_listing(entries: List[EntryInfo]) -> str:)-def create_filesystem_tools(playground: NodeJSPlayground):+def create_filesystem_tools(playground: NodeJSPlayground, **kwargs):# Ensure that the function is a generator even if no tools are yieldedyield from ()diff --git a/api-service/codegen/tools/playground/tools/process.py b/api-service/codegen/tools/playground/tools/process.pyindex 56717a073..014b4d203 100644--- a/api-service/codegen/tools/playground/tools/process.py+++ b/api-service/codegen/tools/playground/tools/process.py@@ -28,7 +28,7 @@ def encode_command_output(response: ProcessResponse, only_errors: bool = False)return result-def create_process_tools(playground: NodeJSPlayground):+def create_process_tools(playground: NodeJSPlayground, **kwargs):# Ensure that the function is a generator even if no tools are yieldedyield from ()