Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

AevovOP Rust SDK

Rust SDK for AevovOP - Decentralized AI Platform built on PocketBase.

Installation

Add to your Cargo.toml:

[dependencies]
aevovop-rust = "1.0.0"
tokio = { version = "1.0", features = ["full"] }

Quick Start

use aevovop_rust::*;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Initialize client
    let client = AevovOPClient::new("http://localhost:8090");

    // Extract patterns
    let patterns = client.extract_patterns(&ExtractionRequest {
        text: "Machine learning transforms AI with neural networks".to_string(),
        strategy: "hybrid".to_string(),
        model: None,
        options: None,
    }).await?;

    // Execute inference
    let result = client.execute_inference(&InferenceRequest {
        model_id: "default".to_string(),
        query: "What is machine learning?".to_string(),
        context: None,
        max_tokens: None,
        stream: None,
    }).await?;

    println!("{}", result.response);

    Ok(())
}

Features

  • Pattern Extraction - Extract patterns using multiple strategies
  • Pattern Validation - Validate pattern quality
  • Pattern Search - Search patterns with filters
  • AI Inference - Local inference with explainability
  • Type Safety - Full Rust type safety and error handling
  • Async/Await - Built on tokio for async operations

API Reference

Client Initialization

let client = AevovOPClient::new("http://localhost:8090");

Authentication

// Login
client.auth("user@example.com", "password").await?;

// Check auth status
if client.is_authenticated() {
    println!("Authenticated!");
}

// Logout
client.logout();

Pattern Extraction

let result = client.extract_patterns(&ExtractionRequest {
    text: "Your text here".to_string(),
    strategy: "hybrid".to_string(), // keyword, semantic, structural, hybrid
    model: None,
    options: None,
}).await?;

println!("{:?}", result.patterns);

Pattern Search

let results = client.search_patterns(&SearchRequest {
    query: "machine learning".to_string(),
    category: Some("nlp".to_string()),
    min_confidence: Some(0.5),
    limit: Some(10),
    offset: None,
}).await?;

println!("{:?}", results.patterns);

Pattern Validation

let validation = client.validate_pattern(&ValidationRequest {
    pattern_id: "pattern-id".to_string(),
    pattern: Some(pattern_object),
    options: None,
}).await?;

println!("Valid: {}", validation.is_valid);

AI Inference

let inference = client.execute_inference(&InferenceRequest {
    model_id: "default".to_string(),
    query: "What is AI?".to_string(),
    context: None,
    max_tokens: None,
    stream: None,
}).await?;

println!("Response: {}", inference.response);
println!("Confidence: {}", inference.confidence);

Reasoning Trace

if let Some(trace) = client.get_reasoning_trace(&session_id).await? {
    for step in trace.steps {
        println!("{}. {}", step.step_number, step.description);
    }
}

Examples

See the examples/ directory for complete examples:

cargo run --example basic

Development

# Build
cargo build

# Run tests
cargo test

# Run example
cargo run --example basic

# Build docs
cargo doc --open

License

MIT License - See LICENSE file for details.

Links