Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
commit
Vasek Mlejnskyf0ee3dfa9eba
diff --git a/api-service/app.py b/api-service/app.pyindex 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.pyindex 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.pyindex 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 LLMdiff --git a/api-service/codegen/prompt.py b/api-service/codegen/prompt.pyindex d60222f12..7843f6abf 100644--- a/api-service/codegen/prompt.py+++ b/api-service/codegen/prompt.py@@ -35,9 +35,9 @@ $INPUTObservation: 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.tsxindex 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?: stringdeploy: () => voiddeployedURL?: string | nulldeployStatus?: 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-4p-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.tsxindex 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 | undefineduseEffect(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.tsindex e7e39d062..f28cb5146 100644--- a/db/supabase.ts+++ b/db/supabase.ts@@ -14,6 +14,7 @@ export interface Database {created_at: stringid: stringlogs: Json[] | null+ logs_raw: string | nullproject_id: stringroute_id: stringstate: Database["public"]["Enums"]["deployment_state"] | null@@ -23,6 +24,7 @@ export interface Database {created_at?: stringid?: stringlogs?: Json[] | null+ logs_raw?: string | nullproject_id: stringroute_id: stringstate?: Database["public"]["Enums"]["deployment_state"] | null@@ -32,6 +34,7 @@ export interface Database {created_at?: stringid?: stringlogs?: Json[] | null+ logs_raw?: string | nullproject_id?: stringroute_id?: stringstate?: Database["public"]["Enums"]["deployment_state"] | nulldiff --git a/prisma/schema.prisma b/prisma/schema.prismaindex 9180a759b..2ee834961 100644--- a/prisma/schema.prisma+++ b/prisma/schema.prisma@@ -259,6 +259,7 @@ model deployments {route_id Stringstate deployment_state?url String?+ logs_raw String? @default("")projects projects @relation(fields: [project_id], references: [id], onDelete: NoAction, onUpdate: NoAction)@@schema("public")