code interpreter
@e2b
E2B هي بنية تحتية مفتوحة المصدر تتيح لك الركض إلى الكود الذي تم إنشاؤه بواسطة الذكاء الاصطناعى في صناديق رملية معزولة آمنة في السحابة. للبدء والتحكم في صناديق رملية ، استخدم 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 المختلفة وأطر منظمة العفو الدولية.