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

add timestamps

Changed files
+10 -2
+10 -2
database.py
··· 1 1 from dataclasses import dataclass 2 + from datetime import datetime, timezone 2 3 import logging 3 4 import sys 4 5 from typing import List, Optional ··· 93 94 field_schema=PayloadSchemaType.KEYWORD, 94 95 ) 95 96 self._client.create_payload_index( 96 - collection_name=self.avatar_collection_name, 97 + collection_name=self.profile_collection_name, 97 98 field_name="timestamp", 98 99 field_schema=PayloadSchemaType.DATETIME, 99 100 ) ··· 178 179 field_schema=PayloadSchemaType.KEYWORD, 179 180 ) 180 181 self._client.create_payload_index( 181 - collection_name=self.avatar_collection_name, 182 + collection_name=self.post_collection_name, 182 183 field_name="timestamp", 183 184 field_schema=PayloadSchemaType.DATETIME, 184 185 ) ··· 193 194 payload = { 194 195 "did": did, 195 196 "description": description, 197 + "timestamp": create_now_timestamp(), 196 198 } 197 199 198 200 existing = self._client.scroll( ··· 228 230 payload = { 229 231 "did": did, 230 232 "cid": cid, 233 + "timestamp": create_now_timestamp(), 231 234 } 232 235 233 236 existing = self._client.scroll( ··· 264 267 "did": did, 265 268 "uri": uri, 266 269 "text": text, 270 + "timestamp": create_now_timestamp(), 267 271 } 268 272 269 273 # we don't care about upserting these ··· 354 358 355 359 356 360 QDRANT_SERVICE = QdrantService() 361 + 362 + 363 + def create_now_timestamp(): 364 + return datetime.now(timezone.utc).isoformat()