Skip to main content

vectorizer_sdk/rpc/
mod.rs

1//! VectorizerRPC client — length-prefixed MessagePack over raw TCP.
2//!
3//! The wire spec at `docs/specs/VECTORIZER_RPC.md` (in the parent
4//! Vectorizer repo) is the byte-level contract. Framing, multiplexing and
5//! the value model come from `thunder-rpc` — the same crate the server runs
6//! — so a v1 server and a v1 SDK client cannot drift apart.
7//!
8//! ## Quick start
9//!
10//! ```no_run
11//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
12//! use vectorizer_sdk::rpc::{RpcClient, HelloPayload};
13//!
14//! let client = RpcClient::connect("127.0.0.1:15503").await?;
15//! client.hello(HelloPayload::new("vectorizer-sdk-rust/3.6.0")).await?;
16//! let pong = client.ping().await?;
17//! assert_eq!(pong, "PONG");
18//! # Ok(())
19//! # }
20//! ```
21//!
22//! ## Layout
23//!
24//! - [`types`]    — `Request`, `Response`, `VectorizerValue` (Thunder's).
25//! - [`client`]   — `RpcClient`: connect, hello, call, ping, close, plus
26//!   `protocol_config()`, the client half of the server's wire config.
27//! - [`commands`] — typed wrappers for the v1 command catalog.
28//! - [`pool`]     — minimal `RpcPool` for reusing connections.
29//! - [`endpoint`] — `parse_endpoint(url)` for the canonical
30//!   `vectorizer://host[:port]` URL scheme.
31
32pub mod client;
33pub mod commands;
34pub mod endpoint;
35pub mod pool;
36pub mod types;
37
38pub use client::{
39    DEFAULT_RPC_PORT, HelloPayload, HelloResponse, RpcClient, RpcClientError, protocol_config,
40};
41pub use commands::{
42    AdminStats, AdminStatus, AnswerPlanResult, AnswerPlanSection, ApiKeyCreated, AuthMeResult,
43    BatchDeleteResult, BatchInsertResult, BatchItemResult, BatchSearchResult, BatchUpdateResult,
44    BulkUpdateMetadataRpcResult, CleanupEmptyResult, CollectionInfo, CompressBullet, CopyRpcResult,
45    CreateCollectionResult, DeleteByFilterRpcResult, DiscoverEdgesForNodeResult,
46    DiscoverEdgesResult, DiscoverResult, DiscoveryChunk, EmbedResult, ExpandQueriesResult,
47    GraphDiscoveryStatus, MoveRpcResult, RebalanceStatus, RefreshTokenResult, RenderPromptResult,
48    ReplicationConfigureResult, RotatedApiKey, SearchExplainResult, SearchHit, SearchTrace,
49    SetExpiryResult, SlowQueryConfigResult, ValidatePasswordResult, VectorListResult,
50    VectorWriteResult,
51};
52pub use endpoint::{Endpoint, ParseError, parse_endpoint};
53pub use pool::RpcPool;
54pub use types::{Request, Response, VectorizerValue};