qdrant_client/
builder_types.rs1use crate::qdrant::point_id::PointIdOptions;
2use crate::qdrant::{PointId, Vector};
3
4pub enum RecommendExample {
5 PointId(PointId),
6 Vector(Vector),
7}
8
9impl From<Vector> for RecommendExample {
10 fn from(value: Vector) -> Self {
11 Self::Vector(value)
12 }
13}
14
15impl From<PointId> for RecommendExample {
16 fn from(value: PointId) -> Self {
17 Self::PointId(value)
18 }
19}
20
21impl From<u64> for RecommendExample {
22 fn from(value: u64) -> Self {
23 Self::PointId(PointId {
24 point_id_options: Some(PointIdOptions::Num(value)),
25 })
26 }
27}
28
29impl From<&str> for RecommendExample {
30 fn from(value: &str) -> Self {
31 Self::PointId(PointId {
32 point_id_options: Some(PointIdOptions::Uuid(value.to_string())),
33 })
34 }
35}
36
37impl From<String> for RecommendExample {
38 fn from(value: String) -> Self {
39 Self::PointId(PointId {
40 point_id_options: Some(PointIdOptions::Uuid(value)),
41 })
42 }
43}
44
45impl From<Vec<f32>> for RecommendExample {
46 fn from(value: Vec<f32>) -> Self {
47 Self::Vector(value.into())
48 }
49}