Underground-Digital/Workflow-Engine
0
1ENGLISH_REACT_COMPLETION_PROMPT_TEMPLATES = """Respond to the human as helpfully and accurately as possible. 2 3{{instruction}}4 5You have access to the following tools:6 7{{tools}}8 9Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).10Valid "action" values: "Final Answer" or {{tool_names}}11 12Provide only ONE action per $JSON_BLOB, as shown:13 14```15{16 "action": $TOOL_NAME,17 "action_input": $ACTION_INPUT18}19```20 21Follow this format:22 23Question: input question to answer24Thought: consider previous and subsequent steps25Action:26```27$JSON_BLOB28```29Observation: action result30... (repeat Thought/Action/Observation N times)31Thought: I know what to respond32Action:33```34{35 "action": "Final Answer",36 "action_input": "Final response to human"37}38```39 40Begin! 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:.41{{historic_messages}}42Question: {{query}}43{{agent_scratchpad}}44Thought:""" # noqa: E50145 46 47ENGLISH_REACT_COMPLETION_AGENT_SCRATCHPAD_TEMPLATES = """Observation: {{observation}}48Thought:"""49 50ENGLISH_REACT_CHAT_PROMPT_TEMPLATES = """Respond to the human as helpfully and accurately as possible. 51 52{{instruction}}53 54You have access to the following tools:55 56{{tools}}57 58Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).59Valid "action" values: "Final Answer" or {{tool_names}}60 61Provide only ONE action per $JSON_BLOB, as shown:62 63```64{65 "action": $TOOL_NAME,66 "action_input": $ACTION_INPUT67}68```69 70Follow this format:71 72Question: input question to answer73Thought: consider previous and subsequent steps74Action:75```76$JSON_BLOB77```78Observation: action result79... (repeat Thought/Action/Observation N times)80Thought: I know what to respond81Action:82```83{84 "action": "Final Answer",85 "action_input": "Final response to human"86}87```88 89Begin! 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:.90""" # noqa: E50191 92 93ENGLISH_REACT_CHAT_AGENT_SCRATCHPAD_TEMPLATES = ""94 95REACT_PROMPT_TEMPLATES = {96 "english": {97 "chat": {98 "prompt": ENGLISH_REACT_CHAT_PROMPT_TEMPLATES,99 "agent_scratchpad": ENGLISH_REACT_CHAT_AGENT_SCRATCHPAD_TEMPLATES,100 },101 "completion": {102 "prompt": ENGLISH_REACT_COMPLETION_PROMPT_TEMPLATES,103 "agent_scratchpad": ENGLISH_REACT_COMPLETION_AGENT_SCRATCHPAD_TEMPLATES,104 },105 }106}107 