From d28b3eeac2eab359f672aac60898e7a3ccc275aa Mon Sep 17 00:00:00 2001 From: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:16:24 +0530 Subject: [PATCH] Fixed missing keys in highlight data --- prompt-service/src/unstract/prompt_service/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prompt-service/src/unstract/prompt_service/helper.py b/prompt-service/src/unstract/prompt_service/helper.py index cf4ef63cb..d5e7f3e8c 100644 --- a/prompt-service/src/unstract/prompt_service/helper.py +++ b/prompt-service/src/unstract/prompt_service/helper.py @@ -295,8 +295,8 @@ def run_completion( extract_json=prompt_type.lower() != PSKeys.TEXT, ) answer: str = completion[PSKeys.RESPONSE].text - highlight_data = completion.get(PSKeys.HIGHLIGHT_DATA) - if all([metadata, highlight_data, prompt_key]): + highlight_data = completion.get(PSKeys.HIGHLIGHT_DATA, []) + if all([metadata, prompt_key]): metadata.setdefault(PSKeys.HIGHLIGHT_DATA, {})[prompt_key] = highlight_data return answer # TODO: Catch and handle specific exception here