vectoramp/lib.rs
1//! Official Rust client for the VectorAmp public API.
2//!
3//! Default API base URL: `https://api.vectoramp.com`. Authentication uses the
4//! `X-API-Key` header. The default transport is JSON over HTTPS with a small
5//! [`Transport`] trait so other transports (gRPC, mocks) can be plugged in.
6//!
7//! Public dataset creation always uses the SABLE index type; the SDK does not
8//! expose an index-type option.
9//!
10//! # Quick start
11//!
12//! ```no_run
13//! use vectoramp::Client;
14//!
15//! # async fn run() -> vectoramp::Result<()> {
16//! let client = Client::new(std::env::var("VECTORAMP_API_KEY").unwrap());
17//!
18//! // Only a name is required: embedding defaults to VectorAmp-Embedding-4B,
19//! // dim is inferred (2560), metric defaults to cosine, index is SABLE.
20//! let dataset = client.datasets().create("product-docs").await?;
21//!
22//! dataset.add_texts(vec!["VectorAmp is a high-performance vector database."]).await?;
23//!
24//! let answer = dataset.ask("What is VectorAmp?").await?;
25//! println!("{}", answer.answer);
26//! # Ok(())
27//! # }
28//! ```
29
30pub mod client;
31pub mod datasets;
32pub mod errors;
33pub mod ingestion;
34pub mod intelligence;
35pub mod schedules;
36pub mod secrets;
37pub mod sources;
38pub mod transport;
39pub mod types;
40
41pub use client::{Client, ClientBuilder};
42pub use datasets::{
43 AddTextsOptions, Dataset, DatasetService, Pagination, SearchInput, SearchOptions,
44 DEFAULT_PAGE_LIMIT, DEFAULT_SEARCH_TOP_K,
45};
46pub use errors::{ApiError, Error, Result};
47pub use ingestion::{DocumentListOptions, IngestFilesOptions, IngestionService};
48pub use intelligence::{AskOptions, AskStream, IntelligenceService, StreamEvent};
49pub use schedules::ScheduleService;
50pub use secrets::{OrgSecretService, OPENAI_API_KEY_SECRET_REF};
51pub use sources::{
52 ConfluenceSource, FileUploadSource, GcsSource, GenericSource, GitHubSource, GitLabSource,
53 GoogleDriveSource, IntoCreateSourceRequest, JiraSource, S3Source, WebSelectors, WebSource,
54};
55pub use transport::{Request, Response, Transport};
56pub use types::*;
57
58/// Default VectorAmp API base URL used when none is supplied to the builder.
59pub const DEFAULT_BASE_URL: &str = "https://api.vectoramp.com";
60
61/// User-agent string sent with every request.
62pub const USER_AGENT: &str = concat!("vectoramp-rust/", env!("CARGO_PKG_VERSION"));