Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
a430abae
Unverified
Commit
a430abae
authored
1 year ago
by
Huu Le (Lee)
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llama-index-core/llama_index/core/agent/react/prompts.py
+10
-11
10 additions, 11 deletions
llama-index-core/llama_index/core/agent/react/prompts.py
with
10 additions
and
11 deletions
llama-index-core/llama_index/core/agent/react/prompts.py
+
10
−
11
View file @
a430abae
"""
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment