camel-ai / camel

🐫 CAMEL: Finding the Scaling Law of Agents. A multi-agent framework. https://www.camel-ai.org
https://www.camel-ai.org
Apache License 2.0
5.24k stars 633 forks source link

[Feature Request] ReAct (Reasoning and Acting) Agent #490

Open huyinan opened 5 months ago

huyinan commented 5 months ago

Required prerequisites

Motivation

Recent research results, in particular the paper of Shunyu Yao et al entitled' REACT: synergizing reasoning and acting in language models', have demonstrated the possibility of combining verbal reasoning with interactive decision making in autonomous systems. The tight synergy between 'acting' and 'reasoning' allows humans to learn new tasks quickly and perform robust decision making.

Solution

Add an extra type named 'ReasoningType' to specify the categories of output system messages. 'REASONING' -- the default reasoning type which only contains verbal messages produced by the language model; 'ACT' -- messages that involve function calling procedure; 'REACT' -- A combination of reasoning and acting.

Alternatives

No response

Additional context

No response

huyinan commented 4 months ago

Some more to solution: modify BaseMessage Class so that ReasonType is considered as a new argument. Then consider modifying the functions that convert BaseMessage to Openaimessages.

huyinan commented 4 months ago

Specifically, if ReasonType = 'REACT', we will add the following as the instruction for the assistant to produce output messages: """Solve a question answering task with interleaving Thought, Action steps. Thought can reason about the current situation, and Action can be searching the right function calling and applying the correct function calling based on {key words}. """

Use llf-bench as an example to implement the 'REACT' process. Create another .py file in the example folder where the example of llf-bench is implemented. Specifically, find how every function/class in the original llf-bench repo is realized in camel agent repo. Test this case with an embodied agent under another .py file in the '/test/'folder.