ciyidogan commited on
Commit
f923942
Β·
verified Β·
1 Parent(s): d6090a3

Update chat_handler.py

Browse files
Files changed (1) hide show
  1. chat_handler.py +2 -2
chat_handler.py CHANGED
@@ -89,13 +89,13 @@ async def llm_generate(s: Session, prompt: str, user_msg: str) -> str:
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]}...")
 
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
+ 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=history[-10:] if history else []
99
  )
100
 
101
  log_info(f"πŸͺ„ LLM raw response: {raw[:100]}...")