code interpreter
@e2b
E2B เป็นโครงสร้างพื้นฐานโอเพ่นซอร์สที่ช่วยให้คุณเรียกใช้รหัส Ai-Generated ในกล่องทรายที่แยกได้อย่างปลอดภัยในคลาวด์ ในการเริ่มต้นและควบคุม Sandboxes ให้ใช้ 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
เยี่ยมชมตำราอาหารของเราเพื่อรับแรงบันดาลใจจากตัวอย่างที่มีกรอบ LLMs และ AI ที่แตกต่างกัน