Expand description
§ZeroEntropy Rust SDK
Rust client library for the ZeroEntropy API.
§Quick Start
use zeroentropy_community::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create client from environment variable ZEROENTROPY_API_KEY
    let client = Client::from_env()?;
    // Create a collection
    client.collections().add("my_collection").await?;
    // Add a document
    client.documents().add_text(
        "my_collection",
        "doc1.txt",
        "This is a test document",
        None,
    ).await?;
    // Search documents
    let results = client.queries().top_snippets(
        "my_collection",
        "test",
        10,
        None,
        None,
        None,
        None,
    ).await?;
    println!("Found {} results", results.results.len());
    Ok(())
}Structs§
- Client
- ZeroEntropy API client
- ClientBuilder 
- Builder for constructing a ZeroEntropy client with custom options
- CollectionList Response 
- Response from get collection list
- CollectionResponse 
- Response from collection add/delete
- Collections
- Collections resource for managing document collections
- DocumentInfo 
- Document information
- DocumentInfo List Response 
- Response from get document info list
- DocumentInfo Response 
- Response from get document info
- DocumentResponse 
- Response from document add/update/delete
- DocumentResult 
- Query result for top documents
- Documents
- Documents resource for managing documents in collections
- Models
- Models resource for reranking operations
- PageInfo 
- Page information
- PageInfo Response 
- Response from get page info
- PageResult 
- Query result for top pages
- Queries
- Queries resource for searching documents
- RerankDocument 
- Document for reranking
- RerankResponse 
- Response from rerank endpoint
- RerankResult 
- Rerank result
- SnippetResult 
- Query result for top snippets
- StatusResponse 
- Response from status endpoint
- TopDocumentsResponse 
- Response from top documents query
- TopPagesResponse 
- Response from top pages query
- TopSnippetsResponse 
- Response from top snippets query
Enums§
- DocumentContent 
- Document content types
- Error
- Error types for the ZeroEntropy SDK
- IndexStatus 
- Index status for documents
- LatencyMode 
- Latency mode for queries
- MetadataValue 
- Metadata values can be strings or arrays of strings