OuroborosM commited on
Commit
416fc4a
·
1 Parent(s): 60efe9d

update prompt

Browse files
Files changed (1) hide show
  1. app.py +33 -12
app.py CHANGED
@@ -836,22 +836,39 @@ Final Answer: the final answer to the original input question"""
836
  When you don't have enough information, you can use tools and you must define **Action** and **Action Input** after **Thought**.
837
  '''
838
  FORMAT_INSTRUCTIONS_3 = """
839
- When you don't have enough information, you can use tools and you must use the following format to define **Action:** and **Action Input:** after **Thought:**:
840
  '''
841
- Thought: you should always think about what to do |
842
- Action: the action to take, should be one of [{tool_names}] |
843
- Action Input: the input to the action |
844
- Observation: the result of the action |
845
  '''
846
- If **Thought:** or **Action:** or **Action Input:** is missing in the response, please re-write the response.
847
 
848
  ---
849
- When you have gathered all the information to provide final answer, you must use the following format to define **Final Answer:** after **Thought:**:
850
  '''
851
- Thought: I now know the final answer |
852
- Final Answer: the final answer to the original input question |
853
  '''
854
- If **Thought:** or **Final Answer:** is missing in the response, please re-write the response.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
855
  """
856
 
857
  SUFFIX = """
@@ -862,9 +879,13 @@ Thought: {agent_scratchpad}"""
862
 
863
  SUFFIX2 = """Begin!
864
 
865
- Chat History: {chat_history}
 
866
  Question: {input}
867
- Thought: {agent_scratchpad}"""
 
 
 
868
 
869
 
870
  prompt = ZeroShotAgent.create_prompt(
 
836
  When you don't have enough information, you can use tools and you must define **Action** and **Action Input** after **Thought**.
837
  '''
838
  FORMAT_INSTRUCTIONS_3 = """
839
+ 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:**:
840
  '''
841
+ **Thought:** you should always think about what to do|
842
+ **Action:** the action to take, should be one of [{tool_names}]|
843
+ *Action Input:** the input to the action|
844
+ **Observation:** the result of the action|
845
  '''
846
+ If **Thought:**, **Action:**, **Action Input:** is missing in the response, you must re-write the response.
847
 
848
  ---
849
+ When you need to provide final answer, you must use the following format to define **Final Answer:** after **Thought:**:
850
  '''
851
+ **Thought:** I now know the final answer|
852
+ **Final Answer:** the final answer to the original input question|
853
  '''
854
+ If **Thought:**, **Final Answer:** is missing in the response, you must re-write the response.
855
+
856
+ Example 1:
857
+ ```
858
+ Question: what is architecture ?
859
+ ---
860
+ Thought: I need to check the definition of architecture in Vector Database|
861
+ Action: Vector Database Search|
862
+ Action Input: architecture|
863
+ ```
864
+
865
+ Example 2:
866
+ ```
867
+ Question: Good morning
868
+ ---
869
+ Thought: I need to make a greeting to user|
870
+ Final Answer: Hello, how can I do for you ?|
871
+ ```
872
  """
873
 
874
  SUFFIX = """
 
879
 
880
  SUFFIX2 = """Begin!
881
 
882
+ {chat_history}
883
+ ---
884
  Question: {input}
885
+ ---
886
+ Thought: {agent_scratchpad}
887
+ """
888
+
889
 
890
 
891
  prompt = ZeroShotAgent.create_prompt(