hashbrown

RuntimeRef

A reference to a JavaScript runtime.

API

describe
() => string

Describes 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
number

The timeout for the runtime.