Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

commit

Vasek Mlejnsky165f7d019c80
diff --git a/api-service/codegen/agent/base.py b/api-service/codegen/agent/base.py
index 5dfa95f59..eecde37d0 100644
--- a/api-service/codegen/agent/base.py
+++ b/api-service/codegen/agent/base.py
@@ -50,8 +50,8 @@ class CodegenAgent(ChatAgent):
print(f"====== Got exception '{str(e)}'\n text:\n{text}")
# input = response["action_input"]
return (
- "InvalidTool",
f"[{text[:50]}...]",
+ "",
# f"You are not following the response format as I told you. I just ran your response via json.loads and received this error\n{str(e)}\nPlease try again and change your response.",
)
# raise ValueError(f"Could not parse LLM output: {text}")
diff --git a/api-service/codegen/prompt.py b/api-service/codegen/prompt.py
index c59444314..deacf6901 100644
--- a/api-service/codegen/prompt.py
+++ b/api-service/codegen/prompt.py
@@ -36,6 +36,23 @@ Final Answer: the final server code"""
SUFFIX = """Begin! Reminder to NEVER use tools you don't have access to and ALWAYS use the exact the action `OutputFinalCode` when you know the final server code."""
HUMAN_INSTRUCTIONS_PREFIX = [
+ {
+ "variables": ["method"],
+ "content": """Use this starting template:
+```
+import express from 'express';
+const app = express();
+const port = 3000;
+
+app.use(express.json())
+
+// TODO: Implement the {0} handlers here
+
+app.listen(port, () => {{
+ console.log(`Server listening on port ${{port}}`)
+}})
+```""",
+ },
{
"variables": ["method"],
"content": """The HTTP request handler is of type {0}""",
@@ -44,7 +61,6 @@ HUMAN_INSTRUCTIONS_PREFIX = [
"variables": ["route"],
"content": """The request handler MUST be on the route `{0}`""",
},
- # """The request handler must be on the route `{route}`""",
]
HUMAN_INSTRUCTIONS_SUFFIX = [