Skip to content

Commit c4304cf

Browse files
committed
fix: The simple application of stream=false Q&A will also directly return segmented content when the similarity is not enough
1 parent 21d505a commit c4304cf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ def get_block_result(message_list: List[BaseMessage],
208208
problem_text=None):
209209
if paragraph_list is None:
210210
paragraph_list = []
211-
212-
directly_return_chunk_list = [AIMessage(content=paragraph.content)
213-
for paragraph in paragraph_list if
214-
paragraph.hit_handling_method == 'directly_return']
211+
directly_return_chunk_list = [AIMessageChunk(content=paragraph.content)
212+
for paragraph in paragraph_list if (
213+
paragraph.hit_handling_method == 'directly_return' and paragraph.similarity >= paragraph.directly_return_similarity)]
215214
if directly_return_chunk_list is not None and len(directly_return_chunk_list) > 0:
216215
return directly_return_chunk_list[0], False
217216
elif len(paragraph_list) == 0 and no_references_setting.get(

0 commit comments

Comments
 (0)