Skip to main content
The TaskForceAI Rust SDK provides a strictly typed, high-performance interface for our platform. The package README is the canonical reference for configuration fields, task helpers, SSE streaming, and version-specific examples. This page is intentionally lightweight so the detailed reference only lives in one place.

Canonical Reference

Installation

Install with cargo:
cargo add taskforceai-sdk

Quick Start

use taskforceai_sdk::{TaskForceAI, TaskForceAIOptions};

#[tokio::main]
async fn main() {
    let client = TaskForceAI::new(TaskForceAIOptions {
        api_key: Some("your-api-key-here".to_string()),
        ..Default::default()
    })
    .expect("failed to create client");

    let status = client
        .run_task("Analyze this repository", None, None, None)
        .await
        .expect("task failed");

    if let Some(result) = status.result {
        println!("Result: {}", result);
    }
}

Streaming

use futures_util::StreamExt;

let mut stream = client
    .run_task_stream("Long running task", None)
    .await?;

while let Some(status) = stream.next().await {
    match status {
        Ok(update) => println!("Status: {:?}", update.status),
        Err(error) => eprintln!("Error: {}", error),
    }
}