jdesiree commited on
Commit
20ee050
·
verified ·
1 Parent(s): 7a86db7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1011,13 +1011,13 @@ def orchestrate_turn(user_input: str, session_id: str = "default") -> str:
1011
 
1012
  # Get conversation history
1013
  conversation_state = global_state_manager.get_conversation_state(session_id)
1014
- recent_history = conversation_state['conversation_state'][-8:] if conversation_state['conversation_state'] else []
1015
 
1016
  # Format history for agents
1017
- recent_history_formatted = "\n".join([
1018
  f"{msg['role']}: {msg['content'][:100]}"
1019
- for msg in recent_history
1020
- ]) if recent_history else "No previous conversation"
1021
 
1022
  log_step("Step 2: Process user input", step_start)
1023
 
@@ -1126,7 +1126,7 @@ def orchestrate_turn(user_input: str, session_id: str = "default") -> str:
1126
  think_start = log_step("Thinking agents execution")
1127
  thinking_context = thinking_agents.process(
1128
  user_input=user_input,
1129
- conversation_history=recent_history_formatted,
1130
  thinking_prompts=thinking_prompts_string,
1131
  tool_img_output=tool_img_output,
1132
  tool_context=tool_context
@@ -1184,7 +1184,7 @@ Image output: {tool_img_output}
1184
  Image context: {tool_context}
1185
 
1186
  Conversation history, if available:
1187
- {recent_history_formatted}
1188
 
1189
  Consider any context available to you:
1190
  {thinking_context}
 
1011
 
1012
  # Get conversation history
1013
  conversation_state = global_state_manager.get_conversation_state(session_id)
1014
+ conversation_history = conversation_state['conversation_state'][-8:] if conversation_state['conversation_state'] else []
1015
 
1016
  # Format history for agents
1017
+ conversation_history_formatted = "\n".join([
1018
  f"{msg['role']}: {msg['content'][:100]}"
1019
+ for msg in conversation_history
1020
+ ]) if conversation_history else "No previous conversation"
1021
 
1022
  log_step("Step 2: Process user input", step_start)
1023
 
 
1126
  think_start = log_step("Thinking agents execution")
1127
  thinking_context = thinking_agents.process(
1128
  user_input=user_input,
1129
+ conversation_history=conversation_history_formatted,
1130
  thinking_prompts=thinking_prompts_string,
1131
  tool_img_output=tool_img_output,
1132
  tool_context=tool_context
 
1184
  Image context: {tool_context}
1185
 
1186
  Conversation history, if available:
1187
+ {conversation_history_formatted}
1188
 
1189
  Consider any context available to you:
1190
  {thinking_context}