OrangeWalking commited on
Commit
7272669
·
verified ·
1 Parent(s): b1f7734

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -16,7 +16,9 @@ def process_message(user_input, chat_history, orchestrator_state):
16
  orchestrator_state = create_orchestrator()
17
 
18
  response = orchestrator_state.process_user_message(user_input)
19
- chat_history.append((user_input, response))
 
 
20
  new_state_text = f"当前状态: {orchestrator_state.state.name}"
21
 
22
  return chat_history, orchestrator_state, new_state_text, ""
@@ -90,5 +92,5 @@ with gr.Blocks(theme=gr.themes.Soft(), title="运筹优化对话平台") as demo
90
 
91
  # 【修改后】的代码
92
  if __name__ == "__main__":
93
- demo.launch(share=True)
94
 
 
16
  orchestrator_state = create_orchestrator()
17
 
18
  response = orchestrator_state.process_user_message(user_input)
19
+ chat_history.append({"role": "user", "content": user_input})
20
+ chat_history.append({"role": "assistant", "content": response})
21
+ print(chat_history)
22
  new_state_text = f"当前状态: {orchestrator_state.state.name}"
23
 
24
  return chat_history, orchestrator_state, new_state_text, ""
 
92
 
93
  # 【修改后】的代码
94
  if __name__ == "__main__":
95
+ demo.launch()
96