1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Copyright (c) 2026 vectorless developers
// SPDX-License-Identifier: Apache-2.0
//! High-level client API for document indexing and retrieval.
//!
//! This module provides the main entry point for using vectorless:
//! - [`Engine`] — The main client for indexing and querying documents
//! - [`EngineBuilder`] — Builder pattern for client configuration
//! - [`IndexContext`] — Unified input for document indexing
//! - [`QueryContext`] — Unified input for document queries
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use vectorless::client::{EngineBuilder, IndexContext, QueryContext};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a client with default settings
//! let client = EngineBuilder::new()
//! .with_key("sk-...")
//! .with_model("gpt-4o")
//! .build()
//! .await?;
//!
//! // Index a document
//! let result = client.index(IndexContext::from_path("./document.md")).await?;
//! let doc_id = result.doc_id().unwrap();
//!
//! // Query the document
//! let result = client.query(
//! QueryContext::new("What is this?").with_doc_ids(vec![doc_id.to_string()])
//! ).await?;
//! if let Some(item) = result.single() {
//! println!("{}", item.content);
//! }
//!
//! // List all documents
//! for doc in client.list().await? {
//! println!("{}: {}", doc.id, doc.name);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Events and Progress
//!
//! Monitor operation progress with events:
//!
//! ```rust,no_run
//! # use vectorless::client::{EngineBuilder, EventEmitter, IndexEvent};
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let events = EventEmitter::new()
//! .on_index(|e| match e {
//! IndexEvent::Complete { doc_id } => println!("Indexed: {}", doc_id),
//! _ => {}
//! });
//!
//! let client = EngineBuilder::new()
//! .with_events(events)
//! .build()
//! .await?;
//! # Ok(())
//! # }
//! ```
pub
// ============================================================
// Main Types
// ============================================================
pub use ;
pub use Engine;
// ============================================================
// Context Types
// ============================================================
pub use IndexContext;
pub use QueryContext;
// ============================================================
// Result & Info Types
// ============================================================
pub use ;
// ============================================================
// Parser Types (needed for IndexContext::from_content)
// ============================================================
pub use crateDocumentFormat;