Further refine doc
This commit is contained in:
parent
4d4bf13152
commit
24d9cf9e3d
14
README.md
14
README.md
|
@ -29,10 +29,16 @@ limitations under the License.
|
|||
</h3>
|
||||
|
||||
Agents is a library that enables you to run powerful agents in a few lines of code!
|
||||
It is:
|
||||
- lightweight
|
||||
- understandable (we kept abstractions to the minimum)
|
||||
- the only library with first-class support for Code Agents, i.e. agents that write their actions in code!
|
||||
|
||||
This library offers:
|
||||
|
||||
✨ **Simplicity**: the logic for agents fits in ~thousand lines of code. We kept abstractions to their minimal shape above raw code!
|
||||
|
||||
🌐 **Support for any LLM**: it supports models hosted on the Hub loaded in their `transformers` version or through our inference API, but also models from OpenAI, Anthropic... it's really easy to power an agent with any LLM.
|
||||
|
||||
🧑💻 **First-class support for Code Agents**, i.e. agents that write their actions in code (as opposed to "agents being used to write code"), [read more here](tutorials/secure_code_execution).
|
||||
|
||||
🤗 **Hub integrations**: you can share and load tools to/from the Hub, and more is to come!
|
||||
|
||||
Quick demo:
|
||||
First install the package.
|
||||
|
|
|
@ -15,20 +15,15 @@ rendered properly in your Markdown viewer.
|
|||
-->
|
||||
# ReAct agents
|
||||
|
||||
## One shot agent
|
||||
|
||||
This agent has a planning step, then generates python code to execute all its actions at once. It natively handles different input and output types for its tools, thus it is the recommended choice for multimodal tasks.
|
||||
|
||||
## React agents
|
||||
|
||||
This is the go-to agent to solve reasoning tasks.
|
||||
|
||||
The ReAct framework ([Yao et al., 2022](https://huggingface.co/papers/2210.03629)) is currently the main approach to building agents.
|
||||
|
||||
The name is based on the concatenation of two words, "Reason" and "Act." Indeed, agents following this architecture will solve their task in as many steps as needed, each step consisting of a Reasoning step, then an Action step where it formulates tool calls that will bring it closer to solving the task at hand.
|
||||
|
||||
React process involves keeping a memory of past steps.
|
||||
|
||||
> [!TIP]
|
||||
> Read [Open-source LLMs as LangChain Agents](https://huggingface.co/blog/open-source-llms-as-agents) blog post to learn more about ReAct agents.
|
||||
|
||||
Here is a video overview of how that works:
|
||||
|
||||
<div class="flex justify-center">
|
||||
|
@ -49,5 +44,4 @@ We implement two versions of JsonAgent:
|
|||
- [`CodeAgent`] is a new type of JsonAgent that generates its tool calls as blobs of code, which works really well for LLMs that have strong coding performance.
|
||||
|
||||
> [!TIP]
|
||||
> Read [Open-source LLMs as LangChain Agents](https://huggingface.co/blog/open-source-llms-as-agents) blog post to learn more about ReAct agents.
|
||||
|
||||
> We also provide an option to run agents in one-shot: just pass `oneshot=True` when launching the agent, like `agent.run(your_task, oneshot=True)`
|
|
@ -17,7 +17,15 @@ rendered properly in your Markdown viewer.
|
|||
|
||||
This library is the simplest framework out there to build powerful agents! By the way, wtf are "agents"? We provide our definition [in this page](conceptual_guides/intro_agents), whe're you'll also find tips for when to use them or not (spoilers: you'll often be better off without agents).
|
||||
|
||||
Amongst other things, this library provides first-class support for Code Agents, i.e. agents that write their actions in code (as opposed to "agents being used to write code", which many good libraries already do), [read more here](tutorials/secure_code_execution).
|
||||
This library offers:
|
||||
|
||||
✨ **Simplicity**: the logic for agents fits in ~thousand lines of code. We kept abstractions to their minimal shape above raw code!
|
||||
|
||||
🌐 **Support for any LLM**: it supports models hosted on the Hub loaded in their `transformers` version or through our inference API, but also models from OpenAI, Anthropic... it's really easy to power an agent with any LLM.
|
||||
|
||||
🧑💻 **First-class support for Code Agents**, i.e. agents that write their actions in code (as opposed to "agents being used to write code"), [read more here](tutorials/secure_code_execution).
|
||||
|
||||
🤗 **Hub integrations**: you can share and load tools to/from the Hub, and more is to come!
|
||||
|
||||
<div class="mt-10">
|
||||
<div class="w-full flex flex-col space-y-4 md:space-y-0 md:grid md:grid-cols-2 md:gap-y-4 md:gap-x-5">
|
||||
|
|
|
@ -94,10 +94,7 @@ messages = [
|
|||
{"role": "user", "content": "No need to help, take it easy."},
|
||||
]
|
||||
|
||||
HfApiEngine()(messages, stop_sequences=["conversation"])
|
||||
```
|
||||
```text
|
||||
"That's very kind of you to say! It's always nice to have a relaxed "
|
||||
HfApiEngine()(messages)
|
||||
```
|
||||
|
||||
[[autodoc]] HfApiEngine
|
||||
|
|
Loading…
Reference in New Issue