Skip to content

armgit / E2B

Public Imported from GitHub
0

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

commit

Vasek Mlejnskyd6fdf61f68ca
diff --git a/api-service/codegen/codegen.py b/api-service/codegen/codegen.py
index 335a6e59d..9ef7dbcee 100644
--- a/api-service/codegen/codegen.py
+++ b/api-service/codegen/codegen.py
@@ -94,7 +94,6 @@ class Codegen(BaseModel):
callback_manager = AsyncCallbackManager(
[
StreamingStdOutCallbackHandler(),
- # CustomCallbackHandler(database=database),
]
)
@@ -104,6 +103,7 @@ class Codegen(BaseModel):
# Create the LLM
llm = ChatOpenAI(
+ model_name="gpt-4",
streaming=True,
temperature=0,
max_tokens=2056,
diff --git a/api-service/codegen/prompt.py b/api-service/codegen/prompt.py
index 8b36d231e..69ac634c4 100644
--- a/api-service/codegen/prompt.py
+++ b/api-service/codegen/prompt.py
@@ -1,8 +1,6 @@
# - ALWAYS use `import` to import packages.
# - Make sure any code you generate is JSON escaped.
SYSTEM_PREFIX = """You are an AI JavaScript developer assistant.
-- NEVER deploy code before you run it and are sure it is working.
-- NEVER perform unsecure operations like disabling SSL certificates and similar.
- You are building an Express server that handles REST API.
- The `express` package is already installed.
- Follow the user's instructions carefully & to the letter.
@@ -10,7 +8,7 @@ SYSTEM_PREFIX = """You are an AI JavaScript developer assistant.
- You have access to the following tools:"""
SYSTEM_FORMAT_INSTRUCTIONS = """"The way you use the tools is by specifying a XML snippet.
-Specifically, this XML snippet MUST have a `<action tool="$TOOL_NAME">$INPUT</action>` element with the name of the tool in the `tool` attribute and input for the tool inside the XML tag.
+The XML snippet MUST have a `<action tool="$TOOL_NAME">$INPUT</action>` element with the name of the tool in the `tool` attribute and input for the tool inside the XML tag.
Here is an example of a valid XML code snippet:
<action tool="$TOOL_NAME">
@@ -31,21 +29,22 @@ Observation: the result of the action
Thought: I now know the final server code and can show it.
Final Answer: the final answer"""
-SYSTEM_SUFFIX = """Begin! Reminder to NEVER use tools you don't have access. Reminder to ALWAYS use the exact the action `Final Answer` when you know the final answer."""
+# SYSTEM_SUFFIX = """Begin! Reminder to NEVER use tools you don't have access. Reminder to ALWAYS use the exact the action `Final Answer` when you know the final answer."""
+SYSTEM_SUFFIX = ""
HUMAN_INSTRUCTIONS_PREFIX = [
{
"variables": ["description"],
"content": """The handler you are building should do the following: {0}""",
},
- {
- "variables": [],
- "content": """Do not try to come up with solutions and code if you do not know. Instead, use the tool `AskHuman` to ask for help.""",
- },
- {
- "variables": [],
- "content": """If you think there might be multiple paths forward, use the tool `LetHumanChoose` to choose from them.""",
- },
+ # {
+ # "variables": [],
+ # "content": """Do not try to come up with solutions and code if you do not know. Instead, use the tool `AskHuman` to ask for help.""",
+ # },
+ # {
+ # "variables": [],
+ # "content": """If you think there might be multiple paths forward, use the tool `LetHumanChoose` to choose from them.""",
+ # },
{
"variables": ["request_body"],
"content": """The incoming request body is JSON that looks like this:\n{0}""",
@@ -80,11 +79,11 @@ app.listen(port, async () => {{
},
{
"variables": [],
- "content": """ALWAYS test that the generated server works as required by making mock `curl` requests to the server""",
+ "content": """Always test that the generated server works without bugs and errors as required by running the code and making mock `curl` requests to the server""",
},
{
"variables": [],
- "content": """Generate the full required server code and and make sure it runs without any errors""",
+ "content": """Generate the full required server code""",
},
]
diff --git a/api-service/poetry.lock b/api-service/poetry.lock
index 50ea562cc..9b82cb0cc 100644
--- a/api-service/poetry.lock
+++ b/api-service/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand.
[[package]]
name = "aenum"
@@ -485,6 +485,18 @@ files = [
{file = "frozenlist-1.3.3.tar.gz", hash = "sha256:58bcc55721e8a90b88332d6cd441261ebb22342e238296bb330968952fbb3a6a"},
]
+[[package]]
+name = "geojson"
+version = "2.5.0"
+description = "Python bindings and utilities for GeoJSON"
+category = "main"
+optional = false
+python-versions = "*"
+files = [
+ {file = "geojson-2.5.0-py2.py3-none-any.whl", hash = "sha256:ccbd13368dd728f4e4f13ffe6aaf725b6e802c692ba0dde628be475040c534ba"},
+ {file = "geojson-2.5.0.tar.gz", hash = "sha256:6e4bb7ace4226a45d9c8c8b1348b3fc43540658359f93c3f7e03efa9f15f658a"},
+]
+
[[package]]
name = "greenlet"
version = "2.0.2"
@@ -833,14 +845,14 @@ i18n = ["Babel (>=2.7)"]
[[package]]
name = "langchain"
-version = "0.0.117"
+version = "0.0.125"
description = "Building applications with LLMs through composability"
category = "main"
optional = false
python-versions = ">=3.8.1,<4.0"
files = [
- {file = "langchain-0.0.117-py3-none-any.whl", hash = "sha256:5f0c206e84fb19ba30d06aeab43f5b37893455aed0a971bf7eb5c05ff2a0e367"},
- {file = "langchain-0.0.117.tar.gz", hash = "sha256:e21cfb84d109f786fafac53dd669c963fd658d5c8d9e7a9566679161a598ec73"},
+ {file = "langchain-0.0.125-py3-none-any.whl", hash = "sha256:678cf9d6b0d2b48fab574b5e6faa3bf6e9d249847f3956cf0970c7d48724ec43"},
+ {file = "langchain-0.0.125.tar.gz", hash = "sha256:af54d190bd0ae8cab633c1b6a652c76aae685d6eb27ff39d3f9b24d27ba9f1af"},
]
[package.dependencies]
@@ -848,13 +860,14 @@ aiohttp = ">=3.8.3,<4.0.0"
dataclasses-json = ">=0.5.7,<0.6.0"
numpy = ">=1,<2"
pydantic = ">=1,<2"
+pyowm = ">=3.3.0,<4.0.0"
PyYAML = ">=5.4.1"
requests = ">=2,<3"
SQLAlchemy = ">=1,<2"
tenacity = ">=8.1.0,<9.0.0"
[package.extras]
-all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.2,<0.3.0)", "beautifulsoup4 (>=4,<5)", "cohere (>=3,<4)", "deeplake (>=3.2.9,<4.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pypdf (>=3.4.0,<4.0.0)", "qdrant-client (>=1.0.4,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"]
+all = ["aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.2.2,<0.3.0)", "beautifulsoup4 (>=4,<5)", "cohere (>=3,<4)", "deeplake (>=3.2.9,<4.0.0)", "elasticsearch (>=8,<9)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-search-results (>=2,<3)", "huggingface_hub (>=0,<1)", "jina (>=3.14,<4.0)", "jinja2 (>=3,<4)", "manifest-ml (>=0.0.1,<0.0.2)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "opensearch-py (>=2.0.0,<3.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pypdf (>=3.4.0,<4.0.0)", "qdrant-client (>=1.0.4,<2.0.0)", "redis (>=4,<5)", "sentence-transformers (>=2,<3)", "spacy (>=3,<4)", "tensorflow-text (>=2.11.0,<3.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<2)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"]
llms = ["anthropic (>=0.2.2,<0.3.0)", "cohere (>=3,<4)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "torch (>=1,<2)", "transformers (>=4,<5)"]
[[package]]
@@ -1314,6 +1327,39 @@ typing-extensions = ">=4.2.0"
dotenv = ["python-dotenv (>=0.10.4)"]
email = ["email-validator (>=1.0.3)"]
+[[package]]
+name = "pyowm"
+version = "3.3.0"
+description = "A Python wrapper around OpenWeatherMap web APIs"
+category = "main"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "pyowm-3.3.0-py3-none-any.whl", hash = "sha256:86463108e7613171531ba306040b43c972b3fc0b0acf73b12c50910cdd2107ab"},
+ {file = "pyowm-3.3.0.tar.gz", hash = "sha256:8196f77c91eac680676ed5ee484aae8a165408055e3e2b28025cbf60b8681e03"},
+]
+
+[package.dependencies]
+geojson = ">=2.3.0,<3"
+PySocks = ">=1.7.1,<2"
+requests = [
+ {version = ">=2.20.0,<3"},
+ {version = "*", extras = ["socks"]},
+]
+
+[[package]]
+name = "pysocks"
+version = "1.7.1"
+description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information."
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+files = [
+ {file = "PySocks-1.7.1-py27-none-any.whl", hash = "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299"},
+ {file = "PySocks-1.7.1-py3-none-any.whl", hash = "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5"},
+ {file = "PySocks-1.7.1.tar.gz", hash = "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"},
+]
+
[[package]]
name = "pytest"
version = "7.2.2"
@@ -1477,6 +1523,7 @@ files = [
certifi = ">=2017.4.17"
charset-normalizer = ">=2,<4"
idna = ">=2.5,<4"
+PySocks = {version = ">=1.5.6,<1.5.7 || >1.5.7", optional = true, markers = "extra == \"socks\""}
urllib3 = ">=1.21.1,<1.27"
[package.extras]
@@ -1594,7 +1641,7 @@ files = [
]
[package.dependencies]
-greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"}
+greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and platform_machine == \"aarch64\" or python_version >= \"3\" and platform_machine == \"ppc64le\" or python_version >= \"3\" and platform_machine == \"x86_64\" or python_version >= \"3\" and platform_machine == \"amd64\" or python_version >= \"3\" and platform_machine == \"AMD64\" or python_version >= \"3\" and platform_machine == \"win32\" or python_version >= \"3\" and platform_machine == \"WIN32\""}
[package.extras]
aiomysql = ["aiomysql", "greenlet (!=0.4.17)"]
@@ -2060,4 +2107,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more
[metadata]
lock-version = "2.0"
python-versions = ">=3.8.1,<4.0"
-content-hash = "2c4501c79c7fe98c9c632b6bb25bcaaef95d5e772438dcd27668881bfaba6018"
+content-hash = "97c5da7d63df25da7fe91aa861e90e2b9d38b91a64b19092388f688c5a06600c"
diff --git a/api-service/pyproject.toml b/api-service/pyproject.toml
index f048c236c..49be9e640 100644
--- a/api-service/pyproject.toml
+++ b/api-service/pyproject.toml
@@ -7,7 +7,7 @@ authors = ["Devbook <[email protected]>"]
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
gunicorn = "^20.1.0"
-langchain = "^0.0.117"
+langchain = "^0.0.125"
python-dateutil = "^2.8.2"
urllib3 = "^1.26.14"
pydantic = "^1.10.6"
diff --git a/components/Editor/Sidebar/Logs/index.tsx b/components/Editor/Sidebar/Logs/index.tsx
index ec794bae3..a6cbb86c3 100644
--- a/components/Editor/Sidebar/Logs/index.tsx
+++ b/components/Editor/Sidebar/Logs/index.tsx
@@ -78,7 +78,7 @@ function Logs({
pr-4
">
<Text
- text="Logs"
+ text="Agent"
size={Text.size.S2}
className="
uppercase
diff --git a/components/Editor/index.tsx b/components/Editor/index.tsx
index 6a8f97ed4..f38342aac 100644
--- a/components/Editor/index.tsx
+++ b/components/Editor/index.tsx
@@ -37,8 +37,8 @@ function Editor({ project }: Props) {
}
})
}
-
- const [sizes, setSizes] = useLocalStorage('project-board-splitter-sizes', [60, 40])
+
+ const [sizes, setSizes] = useLocalStorage('project-board-splitter-sizes', [50, 50])
const handleResize = useCallback((_: number, newSizes: number[]) => {
setSizes(newSizes)
if (ref.current) {
@@ -72,9 +72,9 @@ function Editor({ project }: Props) {
<div
ref={ref}
className="
- flex
- flex-col
- flex-1
+ flex
+ flex-col
+ flex-1
">
<Routes
routes={routes}
diff --git a/package.json b/package.json
index 382937598..5babfe08f 100644
--- a/package.json
+++ b/package.json
@@ -24,11 +24,11 @@
"@supabase/auth-helpers-nextjs": "^0.5.5",
"@supabase/auth-helpers-react": "^0.3.1",
"@supabase/supabase-js": "^2.10.0",
+ "@tiptap/core": "^2.0.0-beta.220",
"@tiptap/extension-bullet-list": "^2.0.0-beta.220",
"@tiptap/extension-code-block": "^2.0.0-beta.220",
"@tiptap/extension-list-item": "^2.0.0-beta.220",
"@tiptap/extension-ordered-list": "^2.0.0-beta.220",
- "@tiptap/core": "^2.0.0-beta.220",
"@tiptap/extension-placeholder": "^2.0.0-beta.220",
"@tiptap/pm": "^2.0.0-beta.220",
"@tiptap/react": "^2.0.0-beta.220",