Question for React Agent
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Trace the prompt and execution flow from lagent_example.py into react.py, starting with select_action_template, output_format_template, and the ActionFormat and FinishFormat definitions shown in the issue. Follow where the user query, tool information, and environmental output enter each iteration. Done means documenting whether previous output is incorporated and identifying the specific missing or misunderstood implementation chain.
Written by the indexing model from the issue text.
Description
I have taken a look at inside lagent_example.py and react.py.
it seems like the react prompt does not incorporate the previous output as new input.
Is it a systematic mistake, or am I missing some implementation chain?
So, where does the agent inject the question (user query) or environmental output?
So the prompt is like below
class ActionCall(BaseModel):
name: str = Field(description='调用的函数名称') # The name of the function being called
parameters: Dict = Field(description='调用函数的参数') # The parameters for the function call
class ActionFormat(BaseModel):
thought_process: str = Field(
description='描述当前所处的状态和已知信息。这有助于明确目前所掌握的信息和接下来的搜索方向。'
#description='Describe the current state and known information. This helps clarify what is known and the next search direction.'
)
action: ActionCall = Field(description='当前步骤需要执行的操作,包括函数名称和参数。') # description='The action to be performed at this step, including the function name and parameters.'
class FinishFormat(BaseModel):
thought_process: str = Field(
description='描述当前所处的状态和已知信息。这有助于明确目前所掌握的信息和接下来的搜索方向。'
#'Describe the current state and known information. This helps clarify what is known and the next search direction.'
)
conclusion: str = Field(description='总结当前的搜索结果,回答问题。') # 'Summarize the current search results and provide an answer.'
prompt_template = PromptTemplate(select_action_template)
output_format = JSONParser(output_format_template, function_format=ActionFormat, finish_format=FinishFormat)
select_action_template = """你是一个可以调用外部工具的助手,可以使用的工具包括:
{action_info}
{output_format}
开始!"""
"""
Translation
select_action_template = '''You are an assistant capable of calling external tools. The available tools include:
{action_info}
{output_format}
Begin!
"""
output_format_template = """如果使用工具请遵循以下格式回复:
{function_format}
如果你已经知道了答案,或者你不需要工具,请遵循以下格式回复
{finish_format}"""
''' Translation
output_format_template = """If you need to use a tool, please follow this response format:
{function_format}
If you already know the answer or do not need a tool, please follow this response format:
{finish_format}"""
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 249
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InternLM/lagent
-
OpenAI shuts down gpt-3.5-turbo and gpt-4o-2024-05-13 on 2026-10-23: default model_type values need updatingPossibly taken @qiyuhuating claimed this 53 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
`trust_remote_code=True` is hard-coded in the Hugging Face and vLLM wrappers and cannot be turned offPossibly taken @ningyixi claimed this 4 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 50/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
Parse truncated verbose GC logs up to the first XML errorPossibly taken A pull request linked to this issue is open or already merged. Openbug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#163932 · 1 comment ·
Maintainers usually reply within 1 day
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day