Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Merge branch 'main' into openai-integration

Tomas Valenta9fe804cd14f8
diff --cc packages/js-sdk/src/sandbox/index.ts
index a8a427c9d,894822321..289e69243
--- a/packages/js-sdk/src/sandbox/index.ts
+++ b/packages/js-sdk/src/sandbox/index.ts
@@@ -420,17 -425,18 +432,28 @@@ export class Sandbox extends SandboxCon
return `${protocol}://${hostname}${FILE_ROUTE}`
}
+ get actions() {
+ return [...this._actions.entries()]
+ }
+
+ get openai() {
+ return {
+ assistant: new Assistant(this),
+ } as const
+ }
+
- static async create(opts?: SandboxOpts) {
+ /**
+ * Creates a new Sandbox.
+ * @param optsOrID Sandbox options or Sandbox ID
+ * @returns New Sandbox
+ *
+ * @example
+ * ```ts
+ * const sandbox = await Sandbox.create()
+ * ```
+ */
+ static async create(optsOrID?: string | SandboxOpts) {
+ const opts = typeof optsOrID === 'string' ? { id: optsOrID } : optsOrID
return new Sandbox(opts)
._open({ timeout: opts?.timeout })
.then(async (sandbox) => {