Skip to content

Commit 7d9d645

Browse files
authored
Merge pull request #5 from Dembrane/feature/echo-413-views-pl-detect-empty-aspects-and-flag-hide-them-on-the-ui
ECHO-413-views-pl-detect-empty-aspects-and-flag-hide-them-on-the-ui
2 parents 95ca472 + 89bd095 commit 7d9d645

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

services/aspect_processor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ async def process_single_aspect(
3737
formated_initial_rag_prompt, segment_ids=[str(segment_id) for segment_id in segment_ids]
3838
)
3939

40+
if len(rag_prompt) < 100:
41+
# Returns if nothing is found: Sorry, I'm not able to provide an answer to that question.[no-context]
42+
logger.error(f"RAG prompt is too short for aspect '{tentative_aspect_topic}'")
43+
raise ValueError(
44+
f"RAG prompt is too short for aspect '{tentative_aspect_topic}'. \nRAG prompt: {rag_prompt}"
45+
)
46+
4047
# Prepare RAG messages
4148
rag_messages = [
4249
{"role": "system", "content": rag_system_prompt},

0 commit comments

Comments
 (0)