qdrant_client/
builder_types.rs

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
use crate::qdrant::point_id::PointIdOptions;
use crate::qdrant::{PointId, Vector};

pub enum RecommendExample {
    PointId(PointId),
    Vector(Vector),
}

impl From<Vector> for RecommendExample {
    fn from(value: Vector) -> Self {
        Self::Vector(value)
    }
}

impl From<PointId> for RecommendExample {
    fn from(value: PointId) -> Self {
        Self::PointId(value)
    }
}

impl From<u64> for RecommendExample {
    fn from(value: u64) -> Self {
        Self::PointId(PointId {
            point_id_options: Some(PointIdOptions::Num(value)),
        })
    }
}

impl From<&str> for RecommendExample {
    fn from(value: &str) -> Self {
        Self::PointId(PointId {
            point_id_options: Some(PointIdOptions::Uuid(value.to_string())),
        })
    }
}

impl From<String> for RecommendExample {
    fn from(value: String) -> Self {
        Self::PointId(PointId {
            point_id_options: Some(PointIdOptions::Uuid(value)),
        })
    }
}

impl From<Vec<f32>> for RecommendExample {
    fn from(value: Vec<f32>) -> Self {
        Self::Vector(value.into())
    }
}