From 74e779f8d033a6e745701e45b0cdf7b619adc123 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 8 Jan 2023 15:26:31 -0300 Subject: [PATCH] Fix /beta/chat API to use Entry class instead of old dictionary pattern Search returns response of type SearchResponse instead of a dict now --- src/routers/api_beta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routers/api_beta.py b/src/routers/api_beta.py index 6425630d..0719e817 100644 --- a/src/routers/api_beta.py +++ b/src/routers/api_beta.py @@ -45,8 +45,8 @@ def chat(q: str): if get_from_dict(metadata, "intent", "memory-type") == "notes": query = get_from_dict(metadata, "intent", "query") - result_list = search(query, n=1, t=SearchType.Org) - collated_result = "\n".join([item["entry"] for item in result_list]) + result_list = search(query, n=1, t=SearchType.Org, r=True) + collated_result = "\n".join([item.entry for item in result_list]) logger.debug(f'Semantically Similar Notes:\n{collated_result}') gpt_response = summarize(collated_result, summary_type="notes", user_query=q, api_key=state.processor_config.conversation.openai_api_key) else: