Skip to content

armgit / E2B

Public Imported from GitHub
0

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

commit

Vasek Mlejnskyf0ee3dfa9eba
diff --git a/api-service/app.py b/api-service/app.py
index 9582d3e21..b8d60708a 100644
--- a/api-service/app.py
+++ b/api-service/app.py
@@ -67,6 +67,7 @@ def generate():
)
# Generate the code
+ print("Generating...", flush=True)
cg.generate(
run_id=run_id,
route=route,
diff --git a/api-service/codegen/agent/base.py b/api-service/codegen/agent/base.py
index 4153c937e..5ad0cfcc3 100644
--- a/api-service/codegen/agent/base.py
+++ b/api-service/codegen/agent/base.py
@@ -64,9 +64,7 @@ class CodegenAgent(ChatAgent):
# follow the format.
return (
MALFORMED_ANSWER,
- """I just tried to parse your last reponse and received this error:
- {e}
- Reminder, that you should follow the format I told you!""",
+ f"Wrong format! Follow the format! Reminder to ALWAYS use the exact the action `Final Answer` when you know the final answer. I just tried to parse your last reponse and received this error:\n{e}Reminder, that you should follow the format I told you!",
)
# TODO: I think this is buggy. I haven't really had a chance to properly test it and debug the model's behavior.
print(f"====== Got exception '{str(e)}'\n text:\n{text}")
diff --git a/api-service/codegen/codegen.py b/api-service/codegen/codegen.py
index 5b5420ce8..48664adb4 100644
--- a/api-service/codegen/codegen.py
+++ b/api-service/codegen/codegen.py
@@ -182,7 +182,7 @@ class Codegen(BaseModel):
*playground_tools,
AskHuman(callback_manager=callback_manager),
WriteCodeToFile(callback_manager=callback_manager),
- DeployCode(callback_manager=callback_manager),
+ # DeployCode(callback_manager=callback_manager),
]
# Create the LLM
diff --git a/api-service/codegen/prompt.py b/api-service/codegen/prompt.py
index d60222f12..7843f6abf 100644
--- a/api-service/codegen/prompt.py
+++ b/api-service/codegen/prompt.py
@@ -35,9 +35,9 @@ $INPUT
Observation: the result of the action
... (this Thought/Action/Observation can repeat N times)
Thought: I now know the final server code and can show it.
-Final Answer: the final server code"""
+Final Answer: the final answer"""
-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 server code."""
+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."""
HUMAN_INSTRUCTIONS_PREFIX = [
{
@@ -76,7 +76,6 @@ HUMAN_INSTRUCTIONS_SUFFIX = [
"Generate the full required server code and make sure it starts without any errors.",
"Test that the generated server from the previous step behaves as is required by making mock `curl` requests to the server.",
"Once all works without any bugs and errors, write the code to the file.",
- "Deploy the code.",
- """Thought: Here is the plan of what I will do based on the instructions I got:
-1.""",
+ # "Deploy the code.",
+ "Thought: Here is the plan of what I will do based on the instructions I got:\n1.",
]
diff --git a/components/Editor/Logs/index.tsx b/components/Editor/Logs/index.tsx
index af2d60278..20ad3669c 100644
--- a/components/Editor/Logs/index.tsx
+++ b/components/Editor/Logs/index.tsx
@@ -3,8 +3,8 @@ import {
// useState,
useCallback,
} from 'react'
-import ReactMarkdown from 'react-markdown'
import hljs from 'highlight.js'
+import ReactMarkdown from 'react-markdown'
import { deployment_state } from '@prisma/client'
import { Log } from 'db/types'
@@ -17,6 +17,7 @@ import DeployButton from './DeployButton'
export interface Props {
logs?: Log[]
+ logsRaw?: string
deploy: () => void
deployedURL?: string | null
deployStatus?: deployment_state | null
@@ -25,6 +26,7 @@ export interface Props {
function Logs({
logs,
+ logsRaw,
deploy,
deployedURL,
deployStatus,
@@ -218,11 +220,16 @@ function Logs({
space-y-4
p-4
">
- {logs?.map((l, i) =>
+ {logsRaw &&
+ <ReactMarkdown>
+ {logsRaw}
+ </ReactMarkdown>
+ }
+ {/* {logs?.map((l, i) =>
<ReactMarkdown key={i}>
{l}
</ReactMarkdown>
- )}
+ )} */}
</div>
</div>
</Sidebar>
diff --git a/components/Editor/index.tsx b/components/Editor/index.tsx
index d1bc00c75..96ba72ca8 100644
--- a/components/Editor/index.tsx
+++ b/components/Editor/index.tsx
@@ -81,6 +81,7 @@ function Editor({ project }: Props) {
const deployment = useLatestDeployment(project, selectedRoute)
const logs = deployment?.logs as Log[] | undefined
+ const logsRaw = deployment?.logs_raw as string | undefined
useEffect(function resetInitializing() {
if (!deployment) return
@@ -222,6 +223,7 @@ function Editor({ project }: Props) {
deployStatus={deployment?.state}
isInitializingDeploy={isInitializingDeploy}
logs={logs}
+ logsRaw={logsRaw}
deploy={deploy}
deployedURL={deployment?.url}
/>
diff --git a/db/supabase.ts b/db/supabase.ts
index e7e39d062..f28cb5146 100644
--- a/db/supabase.ts
+++ b/db/supabase.ts
@@ -14,6 +14,7 @@ export interface Database {
created_at: string
id: string
logs: Json[] | null
+ logs_raw: string | null
project_id: string
route_id: string
state: Database["public"]["Enums"]["deployment_state"] | null
@@ -23,6 +24,7 @@ export interface Database {
created_at?: string
id?: string
logs?: Json[] | null
+ logs_raw?: string | null
project_id: string
route_id: string
state?: Database["public"]["Enums"]["deployment_state"] | null
@@ -32,6 +34,7 @@ export interface Database {
created_at?: string
id?: string
logs?: Json[] | null
+ logs_raw?: string | null
project_id?: string
route_id?: string
state?: Database["public"]["Enums"]["deployment_state"] | null
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 9180a759b..2ee834961 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -259,6 +259,7 @@ model deployments {
route_id String
state deployment_state?
url String?
+ logs_raw String? @default("")
projects projects @relation(fields: [project_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
@@schema("public")