Update src/chat/focus_chat/heartflow_prompt_builder.py

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
pull/952/head
墨梓柒 2025-05-15 10:10:12 +08:00 committed by GitHub
parent a242a4cb7a
commit 8775c66454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -613,7 +613,7 @@ class PromptBuilder:
all_knowledges = Knowledges.select()
if not all_knowledges:
return "" if not return_raw else []
return [] if return_raw else ""
query_embedding_magnitude = math.sqrt(sum(x * x for x in query_embedding))
if query_embedding_magnitude == 0: # Avoid division by zero