Skip to content

Commit c2304dd

Browse files
authored
Merge pull request #47 from DUT-Team-21TCLC-DT3/hotfix/law-fix-case-in-non-debug
hotfix: [LAW] Fix case in non debug error
2 parents 7eb4202 + bc6ee12 commit c2304dd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ai_service/app/services/streaming_service.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ async def generate_streaming_response(question: str, is_debug: bool = False) ->
114114
full_response = await asyncio.to_thread(composer.compose, question, search_result, web_context)
115115
yield create_content_chunk(full_response)
116116
else:
117-
# Yield chunks directly from compose_stream
118117
iterator = composer.compose_stream(question, search_result, web_context)
119-
for chunk in iterator:
120-
yield chunk
118+
for chunk_text in iterator:
119+
yield create_content_chunk(chunk_text)
121120
return
122121

123122
# 2. Vector Search (for CONSULTATION category)
@@ -153,10 +152,9 @@ async def generate_streaming_response(question: str, is_debug: bool = False) ->
153152
content = await asyncio.to_thread(composer.compose, question, search_result, web_context)
154153
yield create_content_chunk(content)
155154
else:
156-
# Yield chunks directly - compose_stream already formats them properly
157155
iterator = composer.compose_stream(question, search_result, web_context)
158-
for chunk in iterator:
159-
yield chunk
156+
for chunk_text in iterator:
157+
yield create_content_chunk(chunk_text)
160158

161159
except Exception as e:
162160
log.error(f"Pipeline Error: {e}", exc_info=True)

0 commit comments

Comments
 (0)