Skip to content

repl

diapason.tools.repl

Persistent Python REPL tool — maintains state across calls within a session.

Unlike CodeInterpreterTool (which runs each snippet in a fresh subprocess), this tool keeps variables, functions, and imports alive across invocations within the same session.

ReplTool

Bases: BaseTool

Persistent Python REPL with session management.

Parameters

timeout: Maximum execution time in seconds per call. max_output: Maximum characters of captured output. max_sessions: Maximum concurrent sessions (LRU eviction).

close()

Release all REPL worker processes.