tangled
alpha
login
or
join now
hailey.at
/
skyembed
1
fork
atom
A lil service that creates embeddings of posts, profiles, and avatars to store them in Qdrant
1
fork
atom
overview
issues
pulls
pipelines
add wordct to posts
hailey.at
2 months ago
1fb48402
9bed6c62
+10
2 changed files
expand all
collapse all
unified
split
database.py
search.py
+3
database.py
···
262
262
return False
263
263
264
264
def upsert_post(self, did: str, uri: str, text: str, vector: List[float]):
265
265
+
word_ct = len(text.split())
266
266
+
265
267
try:
266
268
payload = {
267
269
"did": did,
268
270
"uri": uri,
269
271
"text": text,
272
272
+
"word_count": word_ct,
270
273
"timestamp": create_now_timestamp(),
271
274
}
272
275
+7
search.py
···
6
6
import click
7
7
from qdrant_client.models import (
8
8
DatetimeRange,
9
9
+
Direction,
9
10
FieldCondition,
10
11
Filter,
11
12
MatchValue,
13
13
+
OrderBy,
12
14
)
13
15
from rich.console import Console
14
16
from rich.table import Table
···
303
305
),
304
306
]
305
307
),
308
308
+
order_by=OrderBy(
309
309
+
key="timestamp",
310
310
+
direction=Direction.DESC,
311
311
+
),
312
312
+
limit=30,
306
313
with_payload=True,
307
314
with_vectors=True,
308
315
)[0]