mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-07 03:07:24 -04:00
debug: add logging to verify conversation history capture
Added debug output to confirm: - How many messages are in conversation_history - How many assistant vs tool messages - Preview of first assistant message content - What the summarizer receives This will verify that the full detailed reasoning (like portfolio analysis, trade execution details) is being captured and passed to the summarizer. Output will show: [DEBUG] Generating summary from N messages [DEBUG] Assistant messages: X, Tool messages: Y [DEBUG] First assistant message preview: ... [DEBUG ReasoningSummarizer] Formatting N messages [DEBUG ReasoningSummarizer] Breakdown: X assistant, Y tool
This commit is contained in:
@@ -670,6 +670,15 @@ Summary:"""
|
||||
session_duration = time.time() - session_start
|
||||
|
||||
# 7. Generate reasoning summary
|
||||
# Debug: Log conversation history size
|
||||
print(f"\n[DEBUG] Generating summary from {len(self.conversation_history)} messages")
|
||||
assistant_msgs = [m for m in self.conversation_history if m.get('role') == 'assistant']
|
||||
tool_msgs = [m for m in self.conversation_history if m.get('role') == 'tool']
|
||||
print(f"[DEBUG] Assistant messages: {len(assistant_msgs)}, Tool messages: {len(tool_msgs)}")
|
||||
if assistant_msgs:
|
||||
first_assistant = assistant_msgs[0]
|
||||
print(f"[DEBUG] First assistant message preview: {first_assistant.get('content', '')[:200]}...")
|
||||
|
||||
summarizer = ReasoningSummarizer(model=self.model)
|
||||
summary = await summarizer.generate_summary(self.conversation_history)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user