Shell

class Shell(runtime: ShellRuntime, val defaultTimeoutSeconds: Double = 30.0, val maxOutputChars: Int, val approveCommands: Boolean = !runtime.isolated) : Capability(source)

Shell commands with the tools and output format of Pydantic AI Harness Shell: run_command (labelled [stdout] / [stderr], [exit code: N] on failure, the tail kept when longer than maxOutputChars), and background start_command / check_command / stop_command.

Parameters

approveCommands

ask the user before each command; defaults to on unless the runtime is isolated.

Constructors

Link copied to clipboard
constructor(runtime: ShellRuntime, defaultTimeoutSeconds: Double = 30.0, maxOutputChars: Int, approveCommands: Boolean = !runtime.isolated)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val instructions: String
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun close()

Stops every background command (call when the harness goes away).

Link copied to clipboard
open suspend fun context(): String?
Link copied to clipboard
suspend fun runCommand(command: String, timeoutSeconds: Double? = null): String
Link copied to clipboard
suspend fun startCommand(command: String): String
Link copied to clipboard
suspend fun stopCommand(id: String): String
Link copied to clipboard
open suspend override fun tools(): List<AgentTool>