Skip to content
Snippets Groups Projects
Unverified Commit a430abae authored by Huu Le (Lee)'s avatar Huu Le (Lee) Committed by GitHub
Browse files

Update ReAct prompt for multilingual support (#11464)

update react prompt for multilingual
parent d59c0ae5
No related branches found
No related tags found
No related merge requests found
"""Default prompt for ReAct agent.""" """Default prompt for ReAct agent."""
# ReAct chat prompt # ReAct chat prompt
# TODO: have formatting instructions be a part of react output parser # TODO: have formatting instructions be a part of react output parser
...@@ -19,10 +18,10 @@ You have access to the following tools: ...@@ -19,10 +18,10 @@ You have access to the following tools:
{tool_desc} {tool_desc}
## Output Format ## Output Format
To answer the question, please use the following format. Please answer in the same language as the question and use the following format:
``` ```
Thought: I need to use a tool to help me answer the question. Thought: The current language of the user is: (user's language). I need to use a tool to help me answer the question.
Action: tool name (one of {tool_names}) if using a tool. Action: tool name (one of {tool_names}) if using a tool.
Action Input: the input to the tool, in a JSON format representing the kwargs (e.g. {{"input": "hello world", "num_beams": 5}}) Action Input: the input to the tool, in a JSON format representing the kwargs (e.g. {{"input": "hello world", "num_beams": 5}})
``` ```
...@@ -42,13 +41,13 @@ to answer the question without using any more tools. At that point, you MUST res ...@@ -42,13 +41,13 @@ to answer the question without using any more tools. At that point, you MUST res
in the one of the following two formats: in the one of the following two formats:
``` ```
Thought: I can answer without using any more tools. Thought: I can answer without using any more tools. I'll use the user's language to answer
Answer: [your answer here] Answer: [your answer here (In the same language as the user's question)]
``` ```
``` ```
Thought: I cannot answer the question with the provided tools. Thought: I cannot answer the question with the provided tools.
Answer: Sorry, I cannot answer your query. Answer: [your answer here (In the same language as the user's question)]
``` ```
## Current Conversation ## Current Conversation
...@@ -74,10 +73,10 @@ You have access to the following tools: ...@@ -74,10 +73,10 @@ You have access to the following tools:
{tool_desc} {tool_desc}
## Output Format ## Output Format
To answer the question, please use the following format. Please answer in the same language as the question and use the following format:
``` ```
Thought: I need to use a tool to help me answer the question. Thought: The current language of the user is: (user's language). I need to use a tool to help me answer the question.
Action: tool name (one of {tool_names}) if using a tool. Action: tool name (one of {tool_names}) if using a tool.
Action Input: the input to the tool, in a JSON format representing the kwargs (e.g. {{"input": "hello world", "num_beams": 5}}) Action Input: the input to the tool, in a JSON format representing the kwargs (e.g. {{"input": "hello world", "num_beams": 5}})
``` ```
...@@ -97,13 +96,13 @@ to answer the question without using any more tools. At that point, you MUST res ...@@ -97,13 +96,13 @@ to answer the question without using any more tools. At that point, you MUST res
in the one of the following two formats: in the one of the following two formats:
``` ```
Thought: I can answer without using any more tools. Thought: I can answer without using any more tools. I'll use the user's language to answer
Answer: [your answer here] Answer: [your answer here (In the same language as the user's question)]
``` ```
``` ```
Thought: I cannot answer the question with the provided tools. Thought: I cannot answer the question with the provided tools.
Answer: Sorry, I cannot answer your query. Answer: [your answer here (In the same language as the user's question)]
``` ```
## Current Conversation ## Current Conversation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment