Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Fix import error [WIP]
Tomáš Valentaf1a328cedc5c
diff --git a/api-service/app.py b/api-service/app.pyindex dfa2cb90d..3c919887d 100644--- a/api-service/app.py+++ b/api-service/app.py@@ -7,7 +7,7 @@ from flask_cors import CORSfrom codegen.base import generate_req_handlerfrom codegen.db.base import Database, DeploymentState-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundurl = os.environ.get("SUPABASE_URL")key = os.environ.get("SUPABASE_KEY")diff --git a/api-service/codegen/base.py b/api-service/codegen/base.pyindex c6bc23649..314b91d00 100644--- a/api-service/codegen/base.py+++ b/api-service/codegen/base.py@@ -1,5 +1,5 @@from typing import List-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundfrom langchain.llms.openai import OpenAIChat, OpenAIfrom codegen.tools.documentation.tool import ReadDocumentationdiff --git a/api-service/codegen/tools/playground/main.py b/api-service/codegen/tools/playground/main.pyindex f30add333..3a2ea869b 100644--- a/api-service/codegen/tools/playground/main.py+++ b/api-service/codegen/tools/playground/main.py@@ -1,6 +1,6 @@from typing import Listfrom langchain.tools.base import BaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundfrom .tools.filesystem import PlaygroundFilesystemToolfrom .tools.dependencies import PlaygroundDependenciesTooldiff --git a/api-service/codegen/tools/playground/tools/base.py b/api-service/codegen/tools/playground/tools/base.pyindex 1531f0e87..366016743 100644--- a/api-service/codegen/tools/playground/tools/base.py+++ b/api-service/codegen/tools/playground/tools/base.py@@ -1,5 +1,5 @@from langchain.tools.base import BaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundclass PlaygroundBaseTool(BaseTool):def __init__(self, playground: NodeJSPlayground) -> None:diff --git a/api-service/codegen/tools/playground/tools/code.py b/api-service/codegen/tools/playground/tools/code.pyindex df910c752..5a2e03d9d 100644--- a/api-service/codegen/tools/playground/tools/code.py+++ b/api-service/codegen/tools/playground/tools/code.py@@ -1,5 +1,5 @@from .base import PlaygroundBaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundclass PlaygroundJavaScriptTool(PlaygroundBaseTool):diff --git a/api-service/codegen/tools/playground/tools/dependencies.py b/api-service/codegen/tools/playground/tools/dependencies.pyindex cb8e4d043..f162c3e2b 100644--- a/api-service/codegen/tools/playground/tools/dependencies.py+++ b/api-service/codegen/tools/playground/tools/dependencies.py@@ -1,5 +1,5 @@from .base import PlaygroundBaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundclass PlaygroundDependenciesTool(PlaygroundBaseTool):diff --git a/api-service/codegen/tools/playground/tools/filesystem.py b/api-service/codegen/tools/playground/tools/filesystem.pyindex 93a441cb0..3756902b0 100644--- a/api-service/codegen/tools/playground/tools/filesystem.py+++ b/api-service/codegen/tools/playground/tools/filesystem.py@@ -1,5 +1,5 @@from .base import PlaygroundBaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundclass PlaygroundFilesystemTool(PlaygroundBaseTool):diff --git a/api-service/codegen/tools/playground/tools/process.py b/api-service/codegen/tools/playground/tools/process.pyindex eaecd0b2c..ea71e4a17 100644--- a/api-service/codegen/tools/playground/tools/process.py+++ b/api-service/codegen/tools/playground/tools/process.py@@ -1,5 +1,5 @@from .base import PlaygroundBaseTool-from playground_client import NodeJSPlayground+from playground_client.playground import NodeJSPlaygroundclass PlaygroundProcessTool(PlaygroundBaseTool):diff --git a/api-service/playground_client/Makefile b/api-service/playground_client/Makefileindex 054727e5c..cacf965ac 100644--- a/api-service/playground_client/Makefile+++ b/api-service/playground_client/Makefile@@ -1,3 +1,9 @@generate:rm -rf ./openapi_client- npx @openapitools/openapi-generator-cli generate -i ../playground/swagger.json -g python-nextgen -o ./ --additional-properties=generateSourceCodeOnly=true --additional-properties=disallowAdditionalPropertiesIfNotPresent=false+ npx @openapitools/openapi-generator-cli generate \+ -i ../playground/swagger.json \+ -g python-nextgen \+ -o ./ \+ --additional-properties=generateSourceCodeOnly=true \+ --additional-properties=disallowAdditionalPropertiesIfNotPresent=false \+ --additional-properties=projectName=playground_clientdiff --git a/api-service/playground_client/__init__.py b/api-service/playground_client/__init__.pydeleted file mode 100644index 778a7ab01..000000000--- a/api-service/playground_client/__init__.py+++ /dev/null@@ -1 +0,0 @@-from .main import NodeJSPlaygrounddiff --git a/api-service/playground_client/openapi_client_README.md b/api-service/playground_client/openapi_client_README.mdindex a69c82b95..05ee4007a 100644--- a/api-service/playground_client/openapi_client_README.md+++ b/api-service/playground_client/openapi_client_README.md@@ -1,4 +1,4 @@-# openapi-client+# playground_clientNo description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)The `openapi_client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:@@ -24,7 +24,7 @@ To be able to use it, you will need these dependencies in your own package that## Getting Started-In your own code, to use this library to connect and interact with openapi-client,+In your own code, to use this library to connect and interact with playground_client,you can run the following:```pythondiff --git a/api-service/playground_client/main.py b/api-service/playground_client/playground.pysimilarity index 88%rename from api-service/playground_client/main.pyrename to api-service/playground_client/playground.pyindex 3123039a3..6af69987e 100644--- a/api-service/playground_client/main.py+++ b/api-service/playground_client/playground.py@@ -1,10 +1,10 @@-import openapi_client-from enum import Enumfrom typing import TypedDict, Union+from openapi_client import ApiClient, DefaultApi, Configuration+from openapi_client import CreateSessionParams, RunProcessParams, WriteFilesystemFileParams-configuration = openapi_client.Configuration(+configuration = Configuration(host="https://localhost:9001",)@@ -26,10 +26,10 @@ class CommandOutput(TypedDict):class Playground:def __init__(self, env_id: str):- self.client = openapi_client.ApiClient(configuration)- self.api = openapi_client.DefaultApi(self.client)+ self.client = ApiClient(configuration)+ self.api = DefaultApi(self.client)self.session = self.api.create_session(- openapi_client.CreateSessionParams(env_id)+ CreateSessionParams(env_id))self.is_closed = False@@ -44,7 +44,7 @@ class Playground:def run_command(self, cmd: str):result = self.api.run_process(- self.session.id, openapi_client.RunProcessParams(cmd)+ self.session.id, RunProcessParams(cmd))err_lines = [err.line for err in result.stderr]out_lines = [out.line for out in result.stdout]@@ -78,7 +78,7 @@ class Playground:def write_file(self, path: str, content: str):self.api.write_filesystem_file(- self.session.id, path, openapi_client.WriteFilesystemFileParams(content)+ self.session.id, path, WriteFilesystemFileParams(content))def make_dir(self, path: str):