Skip to content

Commit 5b4a060

Browse files
committed
remove reasoning_details from all generator response messages (can get huge)
1 parent 17bb17a commit 5b4a060

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

llms/extensions/app/db.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ def prepare_thread(self, thread, id=None, user=None):
353353
self.ctx.cache_message_inline_data(m)
354354
if "timestamp" not in m:
355355
m["timestamp"] = initial_timestamp + idx
356+
# remove reasoning_details from all messages (can get huge)
357+
if "reasoning_details" in m:
358+
del m["reasoning_details"]
356359
thread["contextTokens"] = count_tokens_approx(thread["messages"])
357360
return with_user(thread, user=user)
358361

0 commit comments

Comments
 (0)