Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Fix deployment config

Tomas Valenta7dc420978500
diff --git a/api-client/AgentConnection.ts b/api-client/AgentConnection.ts
index a42a552b8..af0a5bd96 100644
--- a/api-client/AgentConnection.ts
+++ b/api-client/AgentConnection.ts
@@ -68,7 +68,7 @@ export class AgentConnection {
}
}
- async start(config: ModelConfig, instructions: any) {
+ async start(config: ModelConfig & { templateID: string }, instructions: any) {
await this.rpc.call('start', { config, instructions })
this.opts.onStateChange(AgentRunState.Running)
}
diff --git a/api-service/app.py b/api-service/app.py
index 8335b0c3b..88daa5cdc 100644
--- a/api-service/app.py
+++ b/api-service/app.py
@@ -72,9 +72,6 @@ async def list_deployments():
async def create_agent_deployment(body: CreateDeploymentBody, project_id: str):
db_deployment = await db.get_deployment(project_id)
- # TODO: Fix hardcoded templateID
- body.config["templateID"] = "smol"
-
if db_deployment:
deployment = await deployment_manager.update_deployment(
db_deployment["id"],
diff --git a/api-service/json_rpc.py b/api-service/json_rpc.py
index 38837ca4a..fa1e5a839 100644
--- a/api-service/json_rpc.py
+++ b/api-service/json_rpc.py
@@ -37,8 +37,6 @@ class JsonRpcAgentConnection:
print(f"Calling {method} via JSONRPC")
match method:
case "start":
- # TODO: Fix hardcoded templateID
- params["config"]["templateID"] = "smol"
agent_factory = get_agent_factory_from_template(
params["config"]["templateID"]
)
diff --git a/components/Editor/Sidebar/Deploy.tsx b/components/Editor/Sidebar/Deploy.tsx
index a87d23216..b01028f72 100644
--- a/components/Editor/Sidebar/Deploy.tsx
+++ b/components/Editor/Sidebar/Deploy.tsx
@@ -21,25 +21,21 @@ export interface Props {
project: projects
}
-
-function getSnippet(hostname: string, deploymentId: string) {
+function getSnippet(hostname: string, deploymentID: string) {
return `curl --request POST \
- --url http://${hostname}/deployments/${deploymentId}/interactions \
+ --url http://${hostname}/deployments/${deploymentID}/interactions \
--data '{
"type": "start",
"data": {
- "instructions": {
- "Description": "Add Stripe Checkout",
- "RepoURL": "https://github.com/e2b-dev/test.git"
- }
+ "instructions": {}
}
}'`
}
-
function Deploy({ project }: Props) {
const [selectors] = useStateStore()
const modelConfig = selectors.use.getSelectedModelConfig()()
+ const templateID = selectors.use.templateID()
const [isDeploying, setIsDeploying] = useState(false)
const [creds] = useModelProviderArgs()
@@ -68,6 +64,7 @@ function Deploy({ project }: Props) {
provider: modelConfig.provider,
args: getModelArgs(modelConfig, creds) as any,
prompt: evaluatedPrompt,
+ templateID,
// TODO: Handle prompt references
// prompt_references: promptReferences,
} as any,
diff --git a/components/Editor/Sidebar/index.tsx b/components/Editor/Sidebar/index.tsx
index f3f233e94..1eedf2702 100644
--- a/components/Editor/Sidebar/index.tsx
+++ b/components/Editor/Sidebar/index.tsx
@@ -47,6 +47,12 @@ function Sidebar({
return
}
+ if (!templateID) {
+ console.error('Cannot get template ID')
+ return
+ }
+
+
const {
references: promptReferences,
prompt: evaluatedPrompt,
@@ -59,14 +65,13 @@ function Sidebar({
instructionsTransform,
)
-
await run(
{
name: modelConfig.name,
provider: modelConfig.provider,
args: getModelArgs(modelConfig, creds) as any,
prompt: evaluatedPrompt,
- // template_id: templateID,
+ templateID,
},
{
References: [
diff --git a/components/Editor/Template/SmolDeveloperTemplate/Instructions.tsx b/components/Editor/Template/SmolDeveloperTemplate/Instructions.tsx
index 59e5f4d90..3bc8147e1 100644
--- a/components/Editor/Template/SmolDeveloperTemplate/Instructions.tsx
+++ b/components/Editor/Template/SmolDeveloperTemplate/Instructions.tsx
@@ -25,7 +25,7 @@ function Instructions({ description, setDescription }: Props) {
">
<InstructionsEditor
referenceSearch={referenceSearch}
- title="Specify what should the Stripe dev do:"
+ title="Specify Smol developer prompt:"
placeholder=""
content={description}
onChange={setDescription}
diff --git a/hooks/useAgent.ts b/hooks/useAgent.ts
index 78a8acc3a..7a2fc0ec6 100644
--- a/hooks/useAgent.ts
+++ b/hooks/useAgent.ts
@@ -10,7 +10,7 @@ function useAgent(projectID: string) {
const [agentState, setAgentState] = useState<AgentRunState>()
const run = useCallback(async (
- config: ModelConfig,
+ config: ModelConfig & { templateID: string },
prompt: any,
) => {
const run = new AgentConnection(`${baseUrl}/dev/agent`, {