Skip to content

Commit

Permalink
Merge pull request #14 from adidoesnt/development
Browse files Browse the repository at this point in the history
Retrieve relevant chat_id docs
  • Loading branch information
adidoesnt authored Feb 6, 2024
2 parents 4bd3c2b + 9f3d679 commit a1d9ebc
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 a1d9ebc

Please sign in to comment.