inventwithdean
commited on
Commit
·
76bac66
1
Parent(s):
11eb304
add id instruction
Browse files
app.py
CHANGED
@@ -48,17 +48,18 @@ async def post_text(content: str) -> bool:
|
|
48 |
|
49 |
|
50 |
async def retrieve_random_text_post() -> str:
|
51 |
-
"""Retrieves a random text post and its id from the database
|
|
|
52 |
post = await db.get_text_post_random()
|
53 |
return post
|
54 |
|
55 |
async def retrieve_latest_text_posts() -> str:
|
56 |
-
"""Retrieves latest 5 text posts with their ids from the database"""
|
57 |
posts = await db.get_text_posts_latest()
|
58 |
return posts
|
59 |
|
60 |
async def retrieve_similar_text_post(query: str) -> str:
|
61 |
-
"""Retrieves a text post and its id semantically similar to the query through Vector Similarity"""
|
62 |
query = query.strip(" ").strip("\n")
|
63 |
try:
|
64 |
if query == "":
|
|
|
48 |
|
49 |
|
50 |
async def retrieve_random_text_post() -> str:
|
51 |
+
"""Retrieves a random text post and its id from the database. Id is only meant for LLMs, no need to show this to user
|
52 |
+
"""
|
53 |
post = await db.get_text_post_random()
|
54 |
return post
|
55 |
|
56 |
async def retrieve_latest_text_posts() -> str:
|
57 |
+
"""Retrieves latest 5 text posts with their ids from the database. Ids are only meant for LLMs, no need to show to user"""
|
58 |
posts = await db.get_text_posts_latest()
|
59 |
return posts
|
60 |
|
61 |
async def retrieve_similar_text_post(query: str) -> str:
|
62 |
+
"""Retrieves a text post and its id semantically similar to the query through Vector Similarity. Id is only meant for LLMs, no need to show to user"""
|
63 |
query = query.strip(" ").strip("\n")
|
64 |
try:
|
65 |
if query == "":
|