ciyidogan commited on
Commit
bf5e7f1
Β·
verified Β·
1 Parent(s): 2914686

Update chat_handler.py

Browse files
Files changed (1) hide show
  1. chat_handler.py +3 -1
chat_handler.py CHANGED
@@ -88,12 +88,14 @@ async def llm_generate(s: Session, prompt: str, user_msg: str) -> str:
88
 
89
  log_info(f"πŸš€ Calling LLM for session {s.session_id[:8]}...")
90
  log_info(f"πŸ“‹ Prompt preview (first 200 chars): {prompt[:200]}...")
 
 
91
 
92
  # Call the configured LLM provider
93
  raw = await llm_provider.generate(
94
  user_input=user_msg,
95
  system_prompt=prompt,
96
- context=s.chat_history[-10:] if s.chat_history else []
97
  )
98
 
99
  log_info(f"πŸͺ„ LLM raw response: {raw[:100]}...")
 
88
 
89
  log_info(f"πŸš€ Calling LLM for session {s.session_id[:8]}...")
90
  log_info(f"πŸ“‹ Prompt preview (first 200 chars): {prompt[:200]}...")
91
+
92
+ chat_history = s.get_chat_history()
93
 
94
  # Call the configured LLM provider
95
  raw = await llm_provider.generate(
96
  user_input=user_msg,
97
  system_prompt=prompt,
98
+ context=chat_history[-10:] if chat_history else []
99
  )
100
 
101
  log_info(f"πŸͺ„ LLM raw response: {raw[:100]}...")