OuroborosM commited on
Commit
41afa9b
·
1 Parent(s): d8a62af

update agent

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1020,9 +1020,10 @@ agent_STRUCTURED_ZEROSHOT_REACT = initialize_agent(tools_remote, GPTfake,
1020
  early_stopping_method="generate",
1021
  memory = memory2,
1022
  agent_kwargs={
1023
- 'prefix': PREFIX_2,
1024
- 'format_instructions': FORMAT_INSTRUCTIONS_3,
1025
- 'suffix': SUFFIX2,
 
1026
  'input_variables': input_variables,
1027
 
1028
  },
@@ -1645,20 +1646,20 @@ def Text2Sound_HMI():
1645
  def UpdateChatbot(Running_history):
1646
  timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1647
  Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1648
- yield Running_history
1649
  WelcomeStr = """
1650
  This is AI Assistant powered by MECH Core Team.
1651
  It is connected remotely with GPT4. The following function is available for you.
1652
- 1. Free Chat
1653
  2. Search Information and Engineering Data: Vector Database + Internet
1654
  3. Make specific task with tools:
1655
  - Text to Sound
1656
  - Sound to Text
1657
  - Doc summary
1658
- - Code interpret (Under Construction)
1659
  - Text to Image (forecast)
1660
  """
1661
- Running_history = Running_history + [(None, WelcomeStr)]
1662
  yield Running_history
1663
 
1664
  global last_answer
@@ -1715,7 +1716,7 @@ with gr.Blocks() as demo:
1715
 
1716
  with gr.Column() as main2:
1717
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
1718
- <center> v0.6.8: Powered by MECH Core Team - GPT4 REMOTE MODE"""),
1719
  chatbot = gr.Chatbot()
1720
  with gr.Row():
1721
  inputtext = gr.Textbox(
 
1020
  early_stopping_method="generate",
1021
  memory = memory2,
1022
  agent_kwargs={
1023
+ # 'prefix': PREFIX_2,
1024
+ # 'format_instructions': FORMAT_INSTRUCTIONS_3,
1025
+ # 'suffix': SUFFIX2,
1026
+ "memory_prompts": [MessagesPlaceholder(variable_name="chat_history")],
1027
  'input_variables': input_variables,
1028
 
1029
  },
 
1646
  def UpdateChatbot(Running_history):
1647
  timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1648
  Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1649
+ # yield Running_history
1650
  WelcomeStr = """
1651
  This is AI Assistant powered by MECH Core Team.
1652
  It is connected remotely with GPT4. The following function is available for you.
1653
+ 1. Free Chat with AI assistant
1654
  2. Search Information and Engineering Data: Vector Database + Internet
1655
  3. Make specific task with tools:
1656
  - Text to Sound
1657
  - Sound to Text
1658
  - Doc summary
1659
+ - Code interpret (Beta version)
1660
  - Text to Image (forecast)
1661
  """
1662
+ Running_history = Running_history + [(None, Running_history+'\n'+WelcomeStr)]
1663
  yield Running_history
1664
 
1665
  global last_answer
 
1716
 
1717
  with gr.Column() as main2:
1718
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
1719
+ <center> v0.7.1: Powered by MECH Core Team - GPT4 REMOTE MODE"""),
1720
  chatbot = gr.Chatbot()
1721
  with gr.Row():
1722
  inputtext = gr.Textbox(