sagax: perceive agents

Batteries-included agent evaluation framework and task execution engine in Rust. Composable and extensible.

Explore the docs

Define tasks in Rust

coding_task.rs

Rust
async fn coding_task(
    context: TaskContext,
    TaskConfig(config): TaskConfig<CodingConfig>,
    Extension(provider): Extension<dyn SandboxProvider>,
) -> Result<TaskResult, CodingTaskError> {
    let mut sandbox = provider
        .create(SandboxSpec::new(config.image_id.clone()))
        .await?;

    let output = sandbox
        .execute(CommandSpec::new(config.command.clone()))
        .await?;

    sandbox.stop().await?;
    sandbox.delete().await?;

    Ok(TaskResult {
        output: json!({
            "stdout": output.stdout,
        }),
    })
}

Execute

Terminal

$▌