Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Enable overriding the CodeInterpreter template in JS SDK
Tomas Valentaf60fdb71663b
diff --git a/.changeset/thin-turtles-fry.md b/.changeset/thin-turtles-fry.mdnew file mode 100644index 000000000..8ce31f6ef--- /dev/null+++ b/.changeset/thin-turtles-fry.md@@ -0,0 +1,5 @@+---+"@e2b/sdk": patch+---++Enable overriding template in CodeInterpreterdiff --git a/packages/js-sdk/src/templates/dataAnalysis.ts b/packages/js-sdk/src/templates/dataAnalysis.tsindex 3668cdfb6..f63ca52bc 100644--- a/packages/js-sdk/src/templates/dataAnalysis.ts+++ b/packages/js-sdk/src/templates/dataAnalysis.ts@@ -27,8 +27,8 @@ export class DataAnalysis extends Sandbox {* @internal* @access protected*/- constructor(opts: Omit<SandboxOpts, 'template'>) {- super({ template: DataAnalysis.template, ...opts })+ constructor(opts: SandboxOpts) {+ super({ template: opts.template || DataAnalysis.template, ...opts })}/**@@ -41,8 +41,8 @@ export class DataAnalysis extends Sandbox {* @param opts Sandbox options* @returns New Sandbox*/- static override async create(opts: Omit<SandboxOpts, 'template'>): Promise<DataAnalysis>;- static override async create(opts?: Omit<SandboxOpts, 'template'>) {+ static override async create(opts: SandboxOpts): Promise<DataAnalysis>;+ static override async create(opts?: SandboxOpts) {const sandbox = new DataAnalysis({ ...opts ? opts : {} })await sandbox._open({ timeout: opts?.timeout })