AxCodeSession
Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L419
A persistent code execution session. Variables persist across execute() calls.
Methods
close()
close(): void;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L448
Returns
void
execute()
execute(code: string, options?: object): Promise<unknown>;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L420
Parameters
| Parameter | Type |
|---|---|
code | string |
options? | { reservedNames?: readonly string[]; signal?: AbortSignal; } |
options.reservedNames? | readonly string[] |
options.signal? | AbortSignal |
Returns
Promise<unknown>
executeWithStatus()?
optional executeWithStatus(code: string, options?: object): Promise<AxCodeExecutionResult>;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L432
Optional variant of execute() that also reports whether the resolved
value describes an error in the code. Implement it when the runtime
returns errors as readable text instead of rejecting (as AxJSRuntime
does for ReferenceError, TypeError, SyntaxError, …) so AxAgent tags
those turns as errors while the actor still reads the same text. Without
it, only rejected executions count as errors.
Parameters
| Parameter | Type |
|---|---|
code | string |
options? | { reservedNames?: readonly string[]; signal?: AbortSignal; } |
options.reservedNames? | readonly string[] |
options.signal? | AbortSignal |
Returns
Promise<AxCodeExecutionResult>
inspectGlobals()?
optional inspectGlobals(options?: object): Promise<string>;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L436
Parameters
| Parameter | Type |
|---|---|
options? | { reservedNames?: readonly string[]; signal?: AbortSignal; } |
options.reservedNames? | readonly string[] |
options.signal? | AbortSignal |
Returns
Promise<string>
patchGlobals()
patchGlobals(globals: Record<string, unknown>, options?: object): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L444
Parameters
| Parameter | Type |
|---|---|
globals | Record<string, unknown> |
options? | { signal?: AbortSignal; } |
options.signal? | AbortSignal |
Returns
Promise<void>
snapshotGlobals()?
optional snapshotGlobals(options?: object): Promise<AxCodeSessionSnapshot>;Defined in: https://github.com/ax-llm/ax/blob/f60ce12a5a7a0de6d7bf420400ca77934ea61504/src/ax/agent/rlm.ts#L440
Parameters
| Parameter | Type |
|---|---|
options? | { reservedNames?: readonly string[]; signal?: AbortSignal; } |
options.reservedNames? | readonly string[] |
options.signal? | AbortSignal |
Returns
Promise<AxCodeSessionSnapshot>