mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-24 07:55:07 +01: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:
parent
f2436039a0
commit
74e779f8d0
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue