Unverified Commit ebc2cdad authored by Jyong's avatar Jyong Committed by GitHub

fix annotation query exception (#1771)

Co-authored-by: 's avatarjyong <jyong@dify.ai>
parent 5bb84193
...@@ -341,6 +341,7 @@ class Completion: ...@@ -341,6 +341,7 @@ class Completion:
app = conversation_message_task.app app = conversation_message_task.app
annotation_reply = app_model_config.annotation_reply_dict annotation_reply = app_model_config.annotation_reply_dict
if annotation_reply['enabled']: if annotation_reply['enabled']:
try:
score_threshold = annotation_reply.get('score_threshold', 1) score_threshold = annotation_reply.get('score_threshold', 1)
embedding_provider_name = annotation_reply['embedding_model']['embedding_provider_name'] embedding_provider_name = annotation_reply['embedding_model']['embedding_provider_name']
embedding_model_name = annotation_reply['embedding_model']['embedding_model_name'] embedding_model_name = annotation_reply['embedding_model']['embedding_model_name']
...@@ -401,6 +402,9 @@ class Completion: ...@@ -401,6 +402,9 @@ class Completion:
from_source, from_source,
score) score)
return True return True
except Exception as e:
logging.warning(f'Query annotation failed, exception: {str(e)}.')
return False
return False return False
@classmethod @classmethod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment