code interpreter
@e2b
E2B는 클라우드의 안전한 분리 된 샌드 박스에서 AI 생성 코드로 실행할 수있는 오픈 소스 인프라입니다. 샌드 박스를 시작하고 제어하려면 JavaScript SDK 또는 Python SDK를 사용하십시오.
JavaScript / TypeScript
npm i @e2b/code-interpreter
파이썬
pip install e2b-code-interpreter
E2B_API_KEY=e2b_***
JavaScript / TypeScript
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox . create ( )
await sbx . runCode ( 'x = 1' )
const execution = await sbx . runCode ( 'x+=1; x' )
console . log ( execution . text ) // outputs 2
파이썬
from e2b_code_interpreter import Sandbox
with Sandbox () as sandbox :
sandbox . run_code ( "x = 1" )
execution = sandbox . run_code ( "x+=1; x" )
print ( execution . text ) # outputs 2
E2B 문서를 방문하십시오.
다른 LLM 및 AI 프레임 워크의 예에서 영감을 얻으려면 요리 책을 방문하십시오.