A reference to a JavaScript runtime.
API
describe
() => stringDescribes the runtime to the LLM.
Example:
const description = runtime.describe();
functions
[...RuntimeFunctionRef<any, any>[]]The functions that are available in the runtime.
run
(code: string, abortSignal: AbortSignal) => Promise<any>Run JavaScript code in the runtime.
Example:
const result = await runtime.run('return 1 + 1;', AbortSignal.timeout(1000));
timeout
numberThe timeout for the runtime.