File tree Expand file tree Collapse file tree 4 files changed +31
-9
lines changed
Expand file tree Collapse file tree 4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 77
88__email__ = "engineering@bugout.dev"
99__license__ = "MIT"
10- __version__ = "0.2.11 "
10+ __version__ = "0.2.12 "
1111
1212__all__ = (
1313 "__author__" ,
Original file line number Diff line number Diff line change @@ -1035,6 +1035,9 @@ def search(
10351035 content : bool = True ,
10361036 timeout : float = REQUESTS_TIMEOUT ,
10371037 order : SearchOrder = SearchOrder .DESCENDING ,
1038+ representation : Union [
1039+ str , data .EntryRepresentationTypes
1040+ ] = data .EntryRepresentationTypes .ENTRY ,
10381041 auth_type : str = data .AuthType .bearer .name ,
10391042 ** kwargs : Dict [str , Any ],
10401043 ) -> data .BugoutSearchResults :
@@ -1048,6 +1051,7 @@ def search(
10481051 offset ,
10491052 content ,
10501053 order = order ,
1054+ representation = data .EntryRepresentationTypes (representation ),
10511055 auth_type = data .AuthType [auth_type ],
10521056 ** kwargs ,
10531057 )
Original file line number Diff line number Diff line change @@ -272,14 +272,6 @@ class BugoutSearchResult(BaseModel):
272272 context_id : Optional [str ] = None
273273
274274
275- class BugoutSearchResults (BaseModel ):
276- total_results : int
277- offset : int
278- next_offset : Optional [int ]
279- max_score : float
280- results : List [BugoutSearchResult ]
281-
282-
283275class BugoutHumbugIntegration (BaseModel ):
284276 id : uuid .UUID
285277 group_id : uuid .UUID
@@ -338,3 +330,26 @@ class BugoutJournalEntity(BaseModel):
338330
339331class BugoutJournalEntities (BaseModel ):
340332 entities : List [BugoutJournalEntity ] = Field (default_factory = list )
333+
334+
335+ class BugoutSearchResultAsEntity (BaseModel ):
336+ journal_id : str
337+ entity_url : str
338+ title : str
339+ address : Optional [str ] = None
340+ blockchain : Optional [str ] = None
341+ required_fields : List [Dict [str , Any ]] = Field (default_factory = list )
342+ secondary_fields : Dict [str , Any ] = Field (default_factory = dict )
343+ created_at : str
344+ updated_at : str
345+ score : float
346+
347+
348+ class BugoutSearchResults (BaseModel ):
349+ total_results : int
350+ offset : int
351+ next_offset : Optional [int ]
352+ max_score : float
353+ results : List [Union [BugoutSearchResult , BugoutSearchResultAsEntity ]] = Field (
354+ default_factory = list
355+ )
Original file line number Diff line number Diff line change 2121 BugoutJournalScopeSpecs ,
2222 BugoutScopes ,
2323 BugoutSearchResults ,
24+ EntryRepresentationTypes ,
2425 HolderType ,
2526 JournalTypes ,
2627 Method ,
@@ -729,6 +730,7 @@ def search(
729730 offset : int = 0 ,
730731 content : bool = True ,
731732 order : SearchOrder = SearchOrder .DESCENDING ,
733+ representation : EntryRepresentationTypes = EntryRepresentationTypes .ENTRY ,
732734 auth_type : AuthType = AuthType .bearer ,
733735 ** kwargs : Dict [str , Any ],
734736 ) -> BugoutSearchResults :
@@ -745,6 +747,7 @@ def search(
745747 "offset" : offset ,
746748 "content" : content ,
747749 "order" : order .value ,
750+ "representation" : representation .value ,
748751 }
749752 result = self ._call (
750753 method = Method .get , path = search_path , params = query_params , headers = headers
You can’t perform that action at this time.
0 commit comments