1use serde::Serialize;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct TeachingContext {
6 pub embedding_model_id: String,
7 pub active_profile_id: Option<i64>,
8 pub record: bool,
11}
12
13#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
15pub struct LearningAcknowledgement {
16 pub generation: u64,
17 pub event_ids: Vec<i64>,
18 pub message_key: String,
19}
20
21#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
23pub struct FaceLearningStatus {
24 pub enabled: bool,
26 pub generation: u64,
27 pub trained_generation: u64,
28 pub status: String,
29 pub last_profile_id: Option<i64>,
30 pub last_candidate: Option<String>,
34 pub last_error: Option<String>,
35 pub feedback_needed: Option<String>,
38 pub pending_questions: usize,
39 pub active_profile: Option<ActiveProfile>,
42 pub summary: String,
45}
46
47impl FaceLearningStatus {
48 pub fn turned_off(self) -> Self {
50 Self {
51 enabled: false,
52 summary: "Learning: off for this library.".to_owned(),
53 ..self
54 }
55 }
56}
57
58#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
59pub struct ActiveProfile {
60 pub profile_id: i64,
61 pub stage: String,
62}
63
64#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
66pub struct TrainedProfileSummary {
67 pub profile_id: i64,
68 pub model_kind: String,
69 pub promoted: bool,
70}
71
72#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
75pub struct QuestionAnswerOutcome {
76 pub status: String,
77 pub acknowledgement: Option<LearningAcknowledgement>,
78}
79
80#[derive(Serialize, Clone)]
83pub struct PersonData {
84 pub label: String,
86 pub full_name: String,
89 pub face_ids: Vec<i64>,
90 pub representative_id: i64,
91 pub hashes: Vec<String>,
92}
93
94#[derive(Serialize, Clone)]
96pub struct ClusterData {
97 pub cluster_id: i64,
98 pub face_ids: Vec<i64>,
99 pub hashes: Vec<String>,
100}
101
102#[derive(Serialize, Clone)]
104pub struct SingletonData {
105 pub face_id: i64,
106 pub hash: String,
107}
108
109#[derive(Serialize, Clone, Default)]
114pub struct FacesData {
115 pub people: Vec<PersonData>,
116 pub clusters: Vec<ClusterData>,
117 pub singletons: Vec<SingletonData>,
118}
119
120#[derive(Serialize, Clone)]
122pub struct ClusterFaceData {
123 pub face_id: i64,
124 pub hash: String,
125 pub path: String,
126}
127
128#[derive(Serialize, Clone)]
130pub struct ClusterDetail {
131 pub cluster_id: i64,
132 pub faces: Vec<ClusterFaceData>,
133}
134
135#[derive(Serialize, Clone)]
138pub struct PersonFaceData {
139 pub face_id: i64,
140 pub hash: String,
141 pub path: String,
142 pub is_primary: bool,
143}
144
145#[derive(Serialize, Clone)]
147pub struct PersonDetail {
148 pub label: String,
150 pub full_name: String,
152 pub faces: Vec<PersonFaceData>,
153}