Skip to content

Commit

Permalink
Retrieve relevant chat_id docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishesh Arora committed Feb 6, 2024
1 parent ecfe70e commit 9f3d679
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ async def get_message_by_id(message_id: str, api_key: str = Security(get_api_key


@app.get("/messages/search/") # TODO - Add response model
async def search_messages(search_string: str = Query(..., min_length=1), api_key: str = Security(get_api_key)):
async def search_messages(search_string: str = Query(..., min_length=1), chat_id: str = Query(..., min_length=1), api_key: str = Security(get_api_key)):
query_text = f"Who says this - {search_string}"

results = collection.query(
query_texts=query_text,
where={"chat_id": chat_id},
n_results=5
)

Expand Down

0 comments on commit 9f3d679

Please sign in to comment.