OuroborosM commited on
Commit
1195ec7
·
1 Parent(s): 979b5c4

correct chathmi4

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -758,9 +758,7 @@ python_tool2 = Tool(
758
  python_tool3 = Tool(
759
  name = "Code Runner",
760
  func = Code_Runner,
761
- description = "Code Interpreter which is able to run code block in local machine.\
762
- It is capable to treat any task by running the code and output the result. (i.e. analyzer data, modify/creat documents ...)\
763
- You should input detail python script code."
764
  )
765
 
766
 
@@ -868,8 +866,8 @@ Only when there is no information available from vector database, you can search
868
  When the final answer has output files, you must output the **name** of the file.
869
  You have access to the following tools:"""
870
 
871
- PREFIX_2 = """You are a helpful AI assistant. You are capable to handle **any** task.\nYour mission is to answer the following request as best as you can with detail information and explanation.\nWhen you need information, you must always check vector database first and try to answer the question based on the information found in vector database only.\nOnly when there is no information available from vector database, you can search information by using other tools.\nWhen the final answer has output files, you must output the **name** of the file with markdown format.\n
872
- ---\nYou have access to the following tools:\n
873
  """
874
 
875
 
@@ -902,21 +900,20 @@ When you don't have enough information, you can use tools and you must define **
902
  FORMAT_INSTRUCTIONS_3 = """
903
  When you don't have enough information, you can use tools and you must use the following format to define **Thought**, **Action** and **Action Input**:\n\
904
  '''
905
- "Thought": you should always think about what to do\n"Action": the action to take, should be one of [{tool_names}]\n"Action Input": the input to the action\n"Observation": the result of the action\n
906
- '''\nIf **Thought**, **Action**, **Action Input** is missing in the response of using tools, you must re-write the response.\n
907
- ---\n\
908
- When you are able to provide final answer, you must use the following format to define **Final Answer** after **Thought**:\n\
909
  '''
910
- "Thought": I now know the final answer\n"Final Answer": the final answer to the original input question\n
911
- '''\nIf **Thought**, **Final Answer** is missing in the response of final answer, you must re-write the response.\n\
912
 
913
  ---\n\
914
  Example of using tools:\n\
915
- ```\nQuestion: what is architecture ?\n---\nThought: I need to check the definition of architecture in Vector Database\nAction: Vector Database Search\nAction Input: architecture\n
916
  ```\n
917
 
918
  Example of final answer:\n\
919
- ```\nQuestion: Good morning\n---\nThought: I need to make a greeting to user\nFinal Answer: Hello, how can I do for you ?\n
920
  ```\n
921
  """
922
 
@@ -1426,7 +1423,7 @@ def chathmi4(message, history2):
1426
  if file_name != "":
1427
  history2 = history2 + [(None, (file_name,))]
1428
  Filename_Chatbot = file_name
1429
- yield ["", history2]
1430
  else:
1431
  print("No File Found in Response")
1432
  except Exception as e:
 
758
  python_tool3 = Tool(
759
  name = "Code Runner",
760
  func = Code_Runner,
761
+ description = """Code Interpreter which is able to run code block in local machine.\n It is capable to treat any task by running the code and output the result. (i.e. analyzer data, modify/creat documents ...)\n You should input detail python script code."""
 
 
762
  )
763
 
764
 
 
866
  When the final answer has output files, you must output the **name** of the file.
867
  You have access to the following tools:"""
868
 
869
+ PREFIX_2 = """You are a helpful AI assistant. You are capable to handle **any** task.\n Your mission is to answer the following request as best as you can with detail information and explanation.\n When you need information, you must always check vector database first and try to answer the question based on the information found in vector database only.\n Only when there is no information available from vector database, you can search information by using other tools.\n When the final answer has output files, you must output the **name** of the file.\n
870
+ ---\n You have access to the following tools:\n
871
  """
872
 
873
 
 
900
  FORMAT_INSTRUCTIONS_3 = """
901
  When you don't have enough information, you can use tools and you must use the following format to define **Thought**, **Action** and **Action Input**:\n\
902
  '''
903
+ "Thought": you should always think about what to do\n "Action": the action to take, should be one of [{tool_names}]\n "Action Input": the input to the action\n "Observation": the result of the action\n
904
+ '''\n If **Thought**, **Action**, **Action Input** is missing in the response of using tools, you must re-write the response.\n
905
+ ---\n When you are able to provide final answer, you must use the following format to define **Final Answer** after **Thought**:\n\
 
906
  '''
907
+ "Thought": I now know the final answer\n "Final Answer": the final answer to the original input question\n
908
+ '''\n If **Thought**, **Final Answer** is missing in the response of final answer, you must re-write the response.\n\
909
 
910
  ---\n\
911
  Example of using tools:\n\
912
+ ```\n Question: what is architecture ?\n---\n Thought: I need to check the definition of architecture in Vector Database\n Action: Vector Database Search\n Action Input: architecture\n
913
  ```\n
914
 
915
  Example of final answer:\n\
916
+ ```\n Question: Good morning\n---\n Thought: I need to make a greeting to user\n Final Answer: Hello, how can I do for you ?\n
917
  ```\n
918
  """
919
 
 
1423
  if file_name != "":
1424
  history2 = history2 + [(None, (file_name,))]
1425
  Filename_Chatbot = file_name
1426
+ yield ["", history2, "SUBMIT", "STOP"]
1427
  else:
1428
  print("No File Found in Response")
1429
  except Exception as e: