Expand description
Code mode: a tool through which the model runs a short Python program
whose functions are the session’s own tools, each call governed like a
direct call. See Live::code_mode.
Structs§
- Code
Function - A function a program can call: a tool of the session, by name.
- Code
Limits - Bounds on one program.
- Code
Mode - The code tool of a session: its name, the tools a program can call, its limits and the sandbox it runs in. See the module docs.
- InProcess
- Runs programs in Monty on a blocking thread of this process.
- Monty
Pool - Runs programs in a pool of Monty worker processes.
- Program
- A program running in a sandbox, suspended at a call or finished. See
CodeMode::start. - Unavailable
- A sandbox that refuses every program: the default when this crate is
built without the
code-modefeature.
Enums§
- Suspension
- Where a program has stopped: at a call to one of its functions, or at its end.
Constants§
- DEFAULT_
TOOL - The default name of the code tool.
Traits§
- Code
Sandbox - Runs programs: Python source with the given functions defined as globals.
- Execution
- A program suspended at a call. Dropping it cancels the program.
Functions§
- arguments
- Name a call’s arguments for
declaration: positional values in stub order, then the keywords. The errors are Python’s, for the program. - parameters
- The parameters of
declarationin stub order: required ones first, in the order the declaration requires them, then the optional ones. - python_
stub - The Python stub for
declaration: its signature and a docstring with the tool’s description, its parameters’ descriptions and, when known, what it returns. - without_
redefinitions sourcewithout its own stand-ins for the session’sfunctions.