Skip to content

Commit

Permalink
Fix path when creating a new kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed May 23, 2024
1 parent 89c3bf9 commit d9c22d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/khaki-ghosts-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@e2b/code-interpreter-python": patch
"@e2b/code-interpreter": patch
---

Fix path when creating new kernel
4 changes: 2 additions & 2 deletions js/src/code-interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Kernels {
}

export interface CreateKernelProps {
cwd: string
path: string
kernelName?: string
}

Expand Down Expand Up @@ -147,7 +147,7 @@ export class JupyterExtension {
cwd: string = '/home/user',
kernelName?: string
): Promise<string> {
const data: CreateKernelProps = { cwd }
const data: CreateKernelProps = { path: cwd }
if (kernelName) {
data.kernelName = kernelName
}
Expand Down
2 changes: 1 addition & 1 deletion python/e2b_code_interpreter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def create_kernel(
:param timeout: Timeout for the kernel creation request.
:return: Kernel id of the created kernel
"""
data = {"cwd": cwd}
data = {"path": cwd}
if kernel_name:
data["kernel_name"] = kernel_name
logger.debug(f"Creating kernel with data: {data}")
Expand Down
4 changes: 2 additions & 2 deletions python/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
with CodeInterpreter() as sandbox:
result = sandbox.notebook.exec_cell(code)

print(result.result.formats())
print(len(result.display_data))
print(result.results[0].formats())
print(len(result.results))

0 comments on commit d9c22d1

Please sign in to comment.