#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DenseVectorConfig {
#[prost(uint64, tag = "1")]
pub size: u64,
#[prost(enumeration = "Distance", tag = "2")]
pub distance: i32,
#[prost(bool, tag = "3")]
pub multivector: bool,
#[prost(enumeration = "PrecisionTier", optional, tag = "4")]
pub precision_tier: ::core::option::Option<i32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SparseVectorConfig {
#[prost(bool, tag = "1")]
pub use_idf: bool,
#[prost(enumeration = "PrecisionTier", optional, tag = "2")]
pub precision_tier: ::core::option::Option<i32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeywordIndex {
#[prost(message, optional, tag = "1")]
pub prefix: ::core::option::Option<KeywordPrefixParams>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeywordPrefixParams {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IntegerIndex {
#[prost(bool, optional, tag = "1")]
pub lookup: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "2")]
pub range: ::core::option::Option<bool>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FloatIndex {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UuidIndex {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DatetimeIndex {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopwordsSet {
#[prost(string, repeated, tag = "1")]
pub languages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub custom: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnowballParams {
#[prost(string, tag = "1")]
pub language: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisabledStemmer {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StemmingAlgorithm {
#[prost(oneof = "stemming_algorithm::StemmingParams", tags = "1, 2")]
pub stemming_params: ::core::option::Option<stemming_algorithm::StemmingParams>,
}
pub mod stemming_algorithm {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum StemmingParams {
#[prost(message, tag = "1")]
Snowball(super::SnowballParams),
#[prost(message, tag = "2")]
Disabled(super::DisabledStemmer),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TextIndex {
#[prost(enumeration = "Tokenizer", optional, tag = "1")]
pub tokenizer: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "2")]
pub lowercase: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "3")]
pub phrase_matching: ::core::option::Option<bool>,
#[prost(uint64, optional, tag = "4")]
pub min_token_len: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub max_token_len: ::core::option::Option<u64>,
#[prost(bool, optional, tag = "6")]
pub ascii_folding: ::core::option::Option<bool>,
#[prost(message, optional, tag = "7")]
pub stopwords: ::core::option::Option<StopwordsSet>,
#[prost(message, optional, tag = "8")]
pub stemmer: ::core::option::Option<StemmingAlgorithm>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeoIndex {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BoolIndex {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PayloadIndexConfig {
#[prost(oneof = "payload_index_config::Index", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
pub index: ::core::option::Option<payload_index_config::Index>,
}
pub mod payload_index_config {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Index {
#[prost(message, tag = "1")]
Keyword(super::KeywordIndex),
#[prost(message, tag = "2")]
Integer(super::IntegerIndex),
#[prost(message, tag = "3")]
Float(super::FloatIndex),
#[prost(message, tag = "4")]
Uuid(super::UuidIndex),
#[prost(message, tag = "5")]
Datetime(super::DatetimeIndex),
#[prost(message, tag = "6")]
Text(super::TextIndex),
#[prost(message, tag = "7")]
Geo(super::GeoIndex),
#[prost(message, tag = "8")]
Bool(super::BoolIndex),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CollectionConfig {
#[prost(map = "string, message", tag = "1")]
pub dense_vectors: ::std::collections::HashMap<
::prost::alloc::string::String,
DenseVectorConfig,
>,
#[prost(map = "string, message", tag = "2")]
pub sparse_vectors: ::std::collections::HashMap<
::prost::alloc::string::String,
SparseVectorConfig,
>,
#[prost(map = "string, message", tag = "3")]
pub payload_indexes: ::std::collections::HashMap<
::prost::alloc::string::String,
PayloadIndexConfig,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCollectionRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<CollectionConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCollectionResponse {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub result: ::prost::alloc::string::String,
#[prost(double, tag = "3")]
pub time: f64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCollectionRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteCollectionResponse {
#[prost(bool, tag = "1")]
pub deleted: bool,
#[prost(double, tag = "2")]
pub time: f64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCollectionRequest {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCollectionResponse {
#[prost(bool, tag = "1")]
pub exists: bool,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<CollectionConfig>,
#[prost(uint64, optional, tag = "3")]
pub point_count: ::core::option::Option<u64>,
#[prost(double, tag = "4")]
pub time: f64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCollectionsRequest {
#[prost(uint32, optional, tag = "1")]
pub limit: ::core::option::Option<u32>,
#[prost(string, optional, tag = "2")]
pub offset_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CollectionSummary {
#[prost(string, tag = "1")]
pub collection_name: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub point_count: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCollectionsResponse {
#[prost(message, repeated, tag = "1")]
pub collections: ::prost::alloc::vec::Vec<CollectionSummary>,
#[prost(string, optional, tag = "2")]
pub next_offset_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(double, tag = "3")]
pub time: f64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Distance {
Unspecified = 0,
Cosine = 1,
Euclid = 2,
Dot = 3,
Manhattan = 4,
}
impl Distance {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DISTANCE_UNSPECIFIED",
Self::Cosine => "COSINE",
Self::Euclid => "EUCLID",
Self::Dot => "DOT",
Self::Manhattan => "MANHATTAN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DISTANCE_UNSPECIFIED" => Some(Self::Unspecified),
"COSINE" => Some(Self::Cosine),
"EUCLID" => Some(Self::Euclid),
"DOT" => Some(Self::Dot),
"MANHATTAN" => Some(Self::Manhattan),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PrecisionTier {
Unspecified = 0,
Low = 1,
Medium = 2,
High = 3,
Full = 4,
}
impl PrecisionTier {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PRECISION_TIER_UNSPECIFIED",
Self::Low => "LOW",
Self::Medium => "MEDIUM",
Self::High => "HIGH",
Self::Full => "FULL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRECISION_TIER_UNSPECIFIED" => Some(Self::Unspecified),
"LOW" => Some(Self::Low),
"MEDIUM" => Some(Self::Medium),
"HIGH" => Some(Self::High),
"FULL" => Some(Self::Full),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Tokenizer {
Unspecified = 0,
Prefix = 1,
Whitespace = 2,
Word = 3,
Multilingual = 4,
}
impl Tokenizer {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TOKENIZER_UNSPECIFIED",
Self::Prefix => "PREFIX",
Self::Whitespace => "WHITESPACE",
Self::Word => "WORD",
Self::Multilingual => "MULTILINGUAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TOKENIZER_UNSPECIFIED" => Some(Self::Unspecified),
"PREFIX" => Some(Self::Prefix),
"WHITESPACE" => Some(Self::Whitespace),
"WORD" => Some(Self::Word),
"MULTILINGUAL" => Some(Self::Multilingual),
_ => None,
}
}
}
pub mod collections_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct CollectionsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CollectionsServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CollectionsServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> CollectionsServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
CollectionsServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_collection(
&mut self,
request: impl tonic::IntoRequest<super::CreateCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::CreateCollectionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.serverless.CollectionsService/CreateCollection",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.serverless.CollectionsService",
"CreateCollection",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_collection(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteCollectionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.serverless.CollectionsService/DeleteCollection",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.serverless.CollectionsService",
"DeleteCollection",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_collection(
&mut self,
request: impl tonic::IntoRequest<super::GetCollectionRequest>,
) -> std::result::Result<
tonic::Response<super::GetCollectionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.serverless.CollectionsService/GetCollection",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.serverless.CollectionsService",
"GetCollection",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_collections(
&mut self,
request: impl tonic::IntoRequest<super::ListCollectionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCollectionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/qdrant.serverless.CollectionsService/ListCollections",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"qdrant.serverless.CollectionsService",
"ListCollections",
),
);
self.inner.unary(req, path, codec).await
}
}
}