@@ -84,6 +84,55 @@ def from_dict(cls, d: dict[str, Any]) -> "IdentifyResult":
8484 )
8585
8686
87+ @dataclass
88+ class CrossCollectionSearchMatch (FaceMatch ):
89+ collection_id : str = ""
90+
91+ @classmethod
92+ def from_dict (cls , d : dict [str , Any ]) -> "CrossCollectionSearchMatch" :
93+ return cls (
94+ face_id = d .get ("faceId" , "" ),
95+ external_id = d .get ("externalId" , "" ),
96+ confidence = float (d .get ("confidence" , 0.0 )),
97+ metadata = d .get ("metadata" ),
98+ collection_id = d .get ("collectionId" , "" ),
99+ )
100+
101+
102+ @dataclass
103+ class SkippedCollection :
104+ id : str
105+ name : str
106+ reason : str
107+
108+ @classmethod
109+ def from_dict (cls , d : dict [str , Any ]) -> "SkippedCollection" :
110+ return cls (
111+ id = d .get ("id" , "" ),
112+ name = d .get ("name" , "" ),
113+ reason = d .get ("reason" , "" ),
114+ )
115+
116+
117+ @dataclass
118+ class CrossCollectionSearchResult :
119+ matches : list [CrossCollectionSearchMatch ]
120+ query_time_ms : int
121+ collections_searched : int
122+ skipped_collections : list [SkippedCollection ]
123+
124+ @classmethod
125+ def from_dict (cls , d : dict [str , Any ]) -> "CrossCollectionSearchResult" :
126+ return cls (
127+ matches = [CrossCollectionSearchMatch .from_dict (m ) for m in d .get ("matches" , [])],
128+ query_time_ms = d .get ("queryTimeMs" , 0 ),
129+ collections_searched = d .get ("collectionsSearched" , 0 ),
130+ skipped_collections = [
131+ SkippedCollection .from_dict (c ) for c in d .get ("skippedCollections" , [])
132+ ],
133+ )
134+
135+
87136@dataclass
88137class LivenessResult :
89138 """Result of a passive liveness check.
0 commit comments