You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Answer the following questions as best you can. You have access to the following tools:\n"
735
-
"The way you use the tools is by specifying a json blob.\n"
736
-
"Specifically, this json should have a `action` key (with the name of the tool to use) and a `action_input` key (with the input to the tool going here).\n"
737
-
'The only values that should be in the "action" field are: {tool_names}\n'
738
-
"The $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n"
739
-
"```\n\n"
740
-
"{{{{\n"
741
-
' "action": $TOOL_NAME,\n'
742
-
' "action_input": $INPUT\n'
743
-
"}}}}\n"
744
-
"```\n\n"
745
-
"ALWAYS use the following format:\n"
746
-
"Question: the input question you must answer\n"
747
-
"Thought: you should always think about what to do\n"
748
-
"Action:\n"
749
-
"```\n\n"
750
-
"$JSON_BLOB"
751
-
"```\n\n"
752
-
"Observation: the result of the action\n"
753
-
"... (this Thought/Action/Observation can repeat N times)\n"
754
-
"Thought: I now know the final answer\n"
755
-
"Final Answer: the final answer to the original input question\n"
756
-
"Begin! Reminder to always use the exact characters `Final Answer` when responding.\n"
757
-
"Question:{input}\n"
758
-
"Thought:{agent_scratchpad}\n"
759
-
),
760
-
"ChatGLM3": (
761
-
"You can answer using the tools.Respond to the human as helpfully and accurately as possible.\n"
762
-
"You have access to the following tools:\n"
763
-
"{tools}\n"
764
-
"Use a json blob to specify a tool by providing an action key (tool name)\n"
765
-
"and an action_input key (tool input).\n"
766
-
'Valid "action" values: "Final Answer" or [{tool_names}]\n'
767
-
"Provide only ONE action per $JSON_BLOB, as shown:\n\n"
768
-
"```\n"
769
-
"{{{{\n"
770
-
' "action": $TOOL_NAME,\n'
771
-
' "action_input": $INPUT\n'
772
-
"}}}}\n"
773
-
"```\n\n"
774
-
"Follow this format:\n\n"
775
-
"Question: input question to answer\n"
776
-
"Thought: consider previous and subsequent steps\n"
777
-
"Action:\n"
778
-
"```\n"
779
-
"$JSON_BLOB\n"
780
-
"```\n"
781
-
"Observation: action result\n"
782
-
"... (repeat Thought/Action/Observation N times)\n"
783
-
"Thought: I know what to respond\n"
784
-
"Action:\n"
785
-
"```\n"
786
-
"{{{{\n"
787
-
' "action": "Final Answer",\n'
788
-
' "action_input": "Final response to human"\n'
789
-
"}}}}\n"
790
-
"Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary.\n"
791
-
"Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation:.\n"
792
-
"Question: {input}\n\n"
793
-
"{agent_scratchpad}\n"
794
-
),
795
-
"qwen": (
796
-
"Answer the following questions as best you can. You have access to the following APIs:\n\n"
797
-
"{tools}\n\n"
798
-
"Use the following format:\n\n"
799
-
"Question: the input question you must answer\n"
800
-
"Thought: you should always think about what to do\n"
801
-
"Action: the action to take, should be one of [{tool_names}]\n"
802
-
"Action Input: the input to the action\n"
803
-
"Observation: the result of the action\n"
804
-
"... (this Thought/Action/Action Input/Observation can be repeated zero or more times)\n"
805
-
"Thought: I now know the final answer\n"
806
-
"Final Answer: the final answer to the original input question\n\n"
807
-
"Format the Action Input as a JSON object.\n\n"
808
-
"Begin!\n\n"
809
-
"Question: {input}\n\n"
810
-
"{agent_scratchpad}\n\n"
811
-
),
812
-
"structured-chat-agent": (
813
-
"Respond to the human as helpfully and accurately as possible. You have access to the following tools:\n\n"
814
-
"{tools}\n\n"
815
-
"Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).\n\n"
816
-
'Valid "action" values: "Final Answer" or {tool_names}\n\n'
817
-
"Provide only ONE action per $JSON_BLOB, as shown:\n\n"
"Thought: consider previous and subsequent steps\n"
822
-
"Action:\n```\n$JSON_BLOB\n```\n"
823
-
"Observation: action result\n"
824
-
"... (repeat Thought/Action/Observation N times)\n"
825
-
"Thought: I know what to respond\n"
826
-
'Action:\n```\n{{\n "action": "Final Answer",\n "action_input": "Final response to human"\n}}\n\n'
827
-
"Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation\n"
828
-
"{input}\n\n"
829
-
"{agent_scratchpad}\n\n"
830
-
# '(reminder to respond in a JSON blob no matter what)')
831
-
),
692
+
# llm_model: dict = {
693
+
# "default": "{{input}}",
694
+
# "with_history": (
695
+
# "The following is a friendly conversation between a human and an AI.\n"
696
+
# "The AI is talkative and provides lots of specific details from its context.\n"
697
+
# "If the AI does not know the answer to a question, it truthfully says it does not know.\n\n"
698
+
# "Current conversation:\n"
699
+
# "{{history}}\n"
700
+
# "Human: {{input}}\n"
701
+
# "AI:"
702
+
# ),
703
+
# }
704
+
chatbot: t.Dict[str, str] = {
705
+
"default": ("You're a helpful assistant.\n\n"
706
+
"The chat history and user questions are as follows:\n"
# "Answer the following questions as best you can. You have access to the following tools:\n"
741
+
# "The way you use the tools is by specifying a json blob.\n"
742
+
# "Specifically, this json should have a `action` key (with the name of the tool to use) and a `action_input` key (with the input to the tool going here).\n"
743
+
# 'The only values that should be in the "action" field are: {tool_names}\n'
744
+
# "The $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n"
745
+
# "```\n\n"
746
+
# "{{{{\n"
747
+
# ' "action": $TOOL_NAME,\n'
748
+
# ' "action_input": $INPUT\n'
749
+
# "}}}}\n"
750
+
# "```\n\n"
751
+
# "ALWAYS use the following format:\n"
752
+
# "Question: the input question you must answer\n"
753
+
# "Thought: you should always think about what to do\n"
754
+
# "Action:\n"
755
+
# "```\n\n"
756
+
# "$JSON_BLOB"
757
+
# "```\n\n"
758
+
# "Observation: the result of the action\n"
759
+
# "... (this Thought/Action/Observation can repeat N times)\n"
760
+
# "Thought: I now know the final answer\n"
761
+
# "Final Answer: the final answer to the original input question\n"
762
+
# "Begin! Reminder to always use the exact characters `Final Answer` when responding.\n"
763
+
# "Question:{input}\n"
764
+
# "Thought:{agent_scratchpad}\n"
765
+
# ),
766
+
# "ChatGLM3": (
767
+
# "You can answer using the tools.Respond to the human as helpfully and accurately as possible.\n"
768
+
# "You have access to the following tools:\n"
769
+
# "{tools}\n"
770
+
# "Use a json blob to specify a tool by providing an action key (tool name)\n"
771
+
# "and an action_input key (tool input).\n"
772
+
# 'Valid "action" values: "Final Answer" or [{tool_names}]\n'
773
+
# "Provide only ONE action per $JSON_BLOB, as shown:\n\n"
774
+
# "```\n"
775
+
# "{{{{\n"
776
+
# ' "action": $TOOL_NAME,\n'
777
+
# ' "action_input": $INPUT\n'
778
+
# "}}}}\n"
779
+
# "```\n\n"
780
+
# "Follow this format:\n\n"
781
+
# "Question: input question to answer\n"
782
+
# "Thought: consider previous and subsequent steps\n"
783
+
# "Action:\n"
784
+
# "```\n"
785
+
# "$JSON_BLOB\n"
786
+
# "```\n"
787
+
# "Observation: action result\n"
788
+
# "... (repeat Thought/Action/Observation N times)\n"
789
+
# "Thought: I know what to respond\n"
790
+
# "Action:\n"
791
+
# "```\n"
792
+
# "{{{{\n"
793
+
# ' "action": "Final Answer",\n'
794
+
# ' "action_input": "Final response to human"\n'
795
+
# "}}}}\n"
796
+
# "Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary.\n"
797
+
# "Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation:.\n"
798
+
# "Question: {input}\n\n"
799
+
# "{agent_scratchpad}\n"
800
+
# ),
801
+
# "qwen": (
802
+
# "Answer the following questions as best you can. You have access to the following APIs:\n\n"
803
+
# "{tools}\n\n"
804
+
# "Use the following format:\n\n"
805
+
# "Question: the input question you must answer\n"
806
+
# "Thought: you should always think about what to do\n"
807
+
# "Action: the action to take, should be one of [{tool_names}]\n"
808
+
# "Action Input: the input to the action\n"
809
+
# "Observation: the result of the action\n"
810
+
# "... (this Thought/Action/Action Input/Observation can be repeated zero or more times)\n"
811
+
# "Thought: I now know the final answer\n"
812
+
# "Final Answer: the final answer to the original input question\n\n"
813
+
# "Format the Action Input as a JSON object.\n\n"
814
+
# "Begin!\n\n"
815
+
# "Question: {input}\n\n"
816
+
# "{agent_scratchpad}\n\n"
817
+
# ),
818
+
# "structured-chat-agent": (
819
+
# "Respond to the human as helpfully and accurately as possible. You have access to the following tools:\n\n"
820
+
# "{tools}\n\n"
821
+
# "Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).\n\n"
822
+
# 'Valid "action" values: "Final Answer" or {tool_names}\n\n'
823
+
# "Provide only ONE action per $JSON_BLOB, as shown:\n\n"
# "Thought: consider previous and subsequent steps\n"
828
+
# "Action:\n```\n$JSON_BLOB\n```\n"
829
+
# "Observation: action result\n"
830
+
# "... (repeat Thought/Action/Observation N times)\n"
831
+
# "Thought: I know what to respond\n"
832
+
# 'Action:\n```\n{{\n "action": "Final Answer",\n "action_input": "Final response to human"\n}}\n\n'
833
+
# "Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation\n"
834
+
# "{input}\n\n"
835
+
# "{agent_scratchpad}\n\n"
836
+
# # '(reminder to respond in a JSON blob no matter what)')
0 commit comments