Rust SDK for AevovOP - Decentralized AI Platform built on PocketBase.
Add to your Cargo.toml:
[dependencies]
aevovop-rust = "1.0.0"
tokio = { version = "1.0", features = ["full"] }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(())
}- ✅ 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
let client = AevovOPClient::new("http://localhost:8090");// Login
client.auth("user@example.com", "password").await?;
// Check auth status
if client.is_authenticated() {
println!("Authenticated!");
}
// Logout
client.logout();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);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);let validation = client.validate_pattern(&ValidationRequest {
pattern_id: "pattern-id".to_string(),
pattern: Some(pattern_object),
options: None,
}).await?;
println!("Valid: {}", validation.is_valid);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);if let Some(trace) = client.get_reasoning_trace(&session_id).await? {
for step in trace.steps {
println!("{}. {}", step.step_number, step.description);
}
}See the examples/ directory for complete examples:
cargo run --example basic# Build
cargo build
# Run tests
cargo test
# Run example
cargo run --example basic
# Build docs
cargo doc --openMIT License - See LICENSE file for details.