Skip to content

Commit bc6ee12

Browse files
committed
hotfix: [LAW] Fix case in non debug error
1 parent 3203775 commit bc6ee12

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
@@ -118,10 +118,9 @@ async def generate_streaming_response(question: str, is_debug: bool = False) ->
118118
from ..utils.stream_utils import create_metadata_chunk
119119
yield create_metadata_chunk(citations)
120120
else:
121-
# Yield chunks directly from compose_stream
122121
iterator = composer.compose_stream(question, search_result, web_context)
123-
for chunk in iterator:
124-
yield chunk
122+
for chunk_text in iterator:
123+
yield create_content_chunk(chunk_text)
125124
return
126125

127126
# 2. Vector Search (for CONSULTATION category)
@@ -161,10 +160,9 @@ async def generate_streaming_response(question: str, is_debug: bool = False) ->
161160
yield create_metadata_chunk(citations)
162161
yield create_content_chunk(content)
163162
else:
164-
# Yield chunks directly - compose_stream already formats them properly
165163
iterator = composer.compose_stream(question, search_result, web_context)
166-
for chunk in iterator:
167-
yield chunk
164+
for chunk_text in iterator:
165+
yield create_content_chunk(chunk_text)
168166

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

0 commit comments

Comments
 (0)