tensorlake 0.5.3

A Rust SDK for interacting with Tensorlake Cloud APIs.
Documentation

Tensorlake Cloud SDK

A Rust SDK for interacting with Tensorlake Cloud APIs. This SDK provides a high-level, ergonomic interface for managing applications, functions, and execution requests in the Tensorlake Cloud platform.

Quick Start

use tensorlake::{Sdk, applications::models::ListApplicationsRequest};

async fn example() -> Result<(), Box<dyn std::error::Error>> {
    // Create the SDK client
    let sdk = Sdk::new("https://api.tensorlake.ai", "your-api-key")?;

    // Get the applications client
    let apps_client = sdk.applications();

    // List applications in the default namespace
    let request = ListApplicationsRequest::builder()
        .namespace("default".to_string())
        .build()?;
    apps_client.list(&request).await?;
    Ok(())
}

Authentication

The SDK uses Bearer token authentication, either a Personal Access Token (PAT) or a Project API key. Provide your token when creating the SDK:

use tensorlake::Sdk;

let sdk = Sdk::new("https://api.tensorlake.ai", "your-token").unwrap();

Available Clients

Error Handling

The SDK provides detailed error types for different scenarios:

use tensorlake::{Sdk, applications::models::ListApplicationsRequest};

async fn example() -> Result<(), Box<dyn std::error::Error>> {
    let sdk = Sdk::new("https://api.tensorlake.ai", "your-api-key")?;
    let apps_client = sdk.applications();

    let request = ListApplicationsRequest::builder()
        .namespace("default".to_string())
        .build()?;
    match apps_client.list(&request).await {
        Ok(apps) => println!("Success: {:?}", apps.applications.len()),
        Err(e) => eprintln!("Error: {}", e),
    }
    Ok(())
}