Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit b75c950

Browse files
jhrozekblkt
authored andcommitted
Only append user messages with text to the user_messages array, not None (#1063)
1 parent 7b1dd0c commit b75c950

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/codegate/pipeline/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ def get_last_user_message_block(
227227
last_idx = -1
228228
for msg, idx in request.last_user_block():
229229
for content in msg.get_content():
230-
user_messages.append(content.get_text())
230+
txt = content.get_text()
231+
if not txt:
232+
continue
233+
user_messages.append(txt)
231234
last_idx = idx
232235

233236
if user_messages == []:

src/codegate/pipeline/output.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def _store_chunk_content(self, chunk: ModelResponse) -> None:
114114
streamed through the pipeline.
115115
"""
116116
for content in chunk.get_content():
117-
for text in content.get_text():
117+
text = content.get_text()
118+
if text:
118119
self._context.processed_content.append(text)
119120

120121
def _record_to_db(self) -> None:

0 commit comments

Comments
 (0)