Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Pass the `verbose` param

Vasek Mlejnsky8e6c454fba75
diff --git a/api-service/cf-worker-template/index.js b/api-service/cf-worker-template/index.js
index 7332064c6..507b15d8d 100644
--- a/api-service/cf-worker-template/index.js
+++ b/api-service/cf-worker-template/index.js
@@ -1 +1,31 @@
-async function handlepostRequest(req, env) { const requestBody = req.json(); const botAccessToken = env.SLACK_BOT_ACCESS_TOKEN; const SlackREST = require('@sagi.io/workers-slack'); const SlackAPI = new SlackREST({ botAccessToken }); const data = { channel: 'general', text: `User '${requestBody.email}' selected pricing '${requestBody.selectedPricing.type}' for $${requestBody.selectedPricing.cost}` }; const result = await SlackAPI.chat.postMessage(data); return new Response('Ok', { status: 200 }); }
\ No newline at end of file
+import { Router } from 'itty-router'
+
+const router = Router()
+
+async function handlepostRequest(req, env) {
+ // DO NOT USE `process.env` TO ACCES ENVIRONMENT VARIABLES. Instead, you access environment variables through the `env` parameter like this: `const myEnv = env.MY_ENV`.
+ // You have access to the following environment variables:
+ // const SLACK_BOT_ACCESS_TOKEN = `env.SLACK_BOT_ACCESS_TOKEN`
+
+
+ // The incoming request content-type is application/json. Make sure to correctly retrieve it.
+ const requestBody = req.json()
+ const botAccessToken = env.SLACK_BOT_ACCESS_TOKEN;
+ const SlackREST = require('@sagi.io/workers-slack')
+ const SlackAPI = new SlackREST({ botAccessToken })
+
+ const data = {
+ channel: 'general',
+ text: `User '${requestBody.email}' selected pricing '${requestBody.selectedPricing.type}' for $${requestBody.selectedPricing.cost}`
+ }
+ const result = await SlackAPI.chat.postMessage(data)
+
+ return new Response('Ok', { status: 200 })
+}
+
+router.post('/', handlepostRequest)
+router.get('*', () => new Response('Not found', { status: 404 }))
+
+export default {
+ fetch: router.handle
+}
\ No newline at end of file
diff --git a/api-service/codegen/js_agent/agent.py b/api-service/codegen/js_agent/agent.py
index f1b63d471..05e84308f 100644
--- a/api-service/codegen/js_agent/agent.py
+++ b/api-service/codegen/js_agent/agent.py
@@ -29,6 +29,7 @@ def create_js_agent(
prompt = ZeroShotAgent.create_prompt(tools=tools, prefix=prefix)
llm_chain = LLMChain(
llm=llm,
+ verbose=verbose,
prompt=prompt,
callback_manager=callback_manager,
)