From 9f3d679f31eabd6bcfdb8cfcd04daede53d94e12 Mon Sep 17 00:00:00 2001 From: Vishesh Arora <> Date: Tue, 6 Feb 2024 23:38:51 +0800 Subject: [PATCH] Retrieve relevant chat_id docs --- backend/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/main.py b/backend/main.py index b02f96e..d40c4b3 100644 --- a/backend/main.py +++ b/backend/main.py @@ -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 )