mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Fix /beta/chat API to use Entry class instead of old dictionary pattern
Search returns response of type SearchResponse instead of a dict now
This commit is contained in:
@@ -45,8 +45,8 @@ def chat(q: str):
|
|||||||
|
|
||||||
if get_from_dict(metadata, "intent", "memory-type") == "notes":
|
if get_from_dict(metadata, "intent", "memory-type") == "notes":
|
||||||
query = get_from_dict(metadata, "intent", "query")
|
query = get_from_dict(metadata, "intent", "query")
|
||||||
result_list = search(query, n=1, t=SearchType.Org)
|
result_list = search(query, n=1, t=SearchType.Org, r=True)
|
||||||
collated_result = "\n".join([item["entry"] for item in result_list])
|
collated_result = "\n".join([item.entry for item in result_list])
|
||||||
logger.debug(f'Semantically Similar Notes:\n{collated_result}')
|
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)
|
gpt_response = summarize(collated_result, summary_type="notes", user_query=q, api_key=state.processor_config.conversation.openai_api_key)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user