Documentation Index
Fetch the complete documentation index at: https://ppio.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
要在命令执行时流式输出结果,请在 JavaScript 中向 commands.run() 方法传递 onStdout、onStderr 回调,或在 Python 中向 commands.run() 方法传递 on_stdout、on_stderr 回调。
import { Sandbox } from 'ppio-sandbox/code-interpreter'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo hello; sleep 1; echo world', {
onStdout: (data) => {
console.log(data)
},
onStderr: (data) => {
console.log(data)
},
})
console.log(result)
await sandbox.kill()