code-interpreter
code-interpreter copied to clipboard
Import dependency to execute code
How to execute the code with sandbox of the imported package?
For example:
Hi @404notfoundyc-L are you asking how to install a dependency inside a sandbox?
I'm not sure from what app is the UI you shared - that's not from us so not sure how they're handling it
Hi @404notfoundyc-L are you asking how to install a dependency inside a sandbox?
I'm not sure from what app is the UI you shared - that's not from us so not sure how they're handling it
yes, I want to know how to install a dependency inside a sandbox. As the image I provided shows, I want to be able to customize and install some third-party dependencies to run the code.
@404notfoundyc-L check out custom sandboxes. You can create your own custom sandbox with dependencies preinstalled. The other option is to install dependencies dynamically during runtime. You can do that by starting any process inside the sandbox (docs)
JS/TS
await sandbox.process.startAndWait("npm i ...")
Python
sandbox.process.start_and_wait("npm i ...")
Hey @404notfoundyc-L, were you able to use the custom dependencies with your project?
Hey @404notfoundyc-L, were you able to use the custom dependencies with your project?
yes, I install custom dependency with sandbox.process successfully. Thank you!