A lil service that creates embeddings of posts, profiles, and avatars to store them in Qdrant

add wordct to posts

+10
+3
database.py
··· 262 return False 263 264 def upsert_post(self, did: str, uri: str, text: str, vector: List[float]): 265 try: 266 payload = { 267 "did": did, 268 "uri": uri, 269 "text": text, 270 "timestamp": create_now_timestamp(), 271 } 272
··· 262 return False 263 264 def upsert_post(self, did: str, uri: str, text: str, vector: List[float]): 265 + word_ct = len(text.split()) 266 + 267 try: 268 payload = { 269 "did": did, 270 "uri": uri, 271 "text": text, 272 + "word_count": word_ct, 273 "timestamp": create_now_timestamp(), 274 } 275
+7
search.py
··· 6 import click 7 from qdrant_client.models import ( 8 DatetimeRange, 9 FieldCondition, 10 Filter, 11 MatchValue, 12 ) 13 from rich.console import Console 14 from rich.table import Table ··· 303 ), 304 ] 305 ), 306 with_payload=True, 307 with_vectors=True, 308 )[0]
··· 6 import click 7 from qdrant_client.models import ( 8 DatetimeRange, 9 + Direction, 10 FieldCondition, 11 Filter, 12 MatchValue, 13 + OrderBy, 14 ) 15 from rich.console import Console 16 from rich.table import Table ··· 305 ), 306 ] 307 ), 308 + order_by=OrderBy( 309 + key="timestamp", 310 + direction=Direction.DESC, 311 + ), 312 + limit=30, 313 with_payload=True, 314 with_vectors=True, 315 )[0]