docs: more information on run flow component (#6046)
* edit-tools * more-info-on-edit-tools * component-as-tool-metadata * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> * Fix formatting and clarity in agent tool documentation * clarity-on-tool-and-run-flow --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
This commit is contained in:
parent
39c4304543
commit
f7db8eecf2
5 changed files with 69 additions and 29 deletions
|
|
@ -9,7 +9,8 @@ The `AgentComponent` is a component for easily creating an AI agent capable of a
|
|||
|
||||
The component contains all of the elements you'll need for creating an agent. Instead of managing LLM models and providers, pick your model and enter your API key. Instead of connecting a **Prompt** component, enter instructions in the component's **Agent Instruction** fields.
|
||||
|
||||
<img src="/img/tool-calling-agent-component.png" alt="Prompt component" style={{display: 'block', margin: 'auto', width: 300}} />
|
||||
|
||||

|
||||
|
||||
Learn how to build a flow starting with the **Tool calling agent** component, and see how it can help you solve problems.
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ The default settings are acceptable for now, so this guide assumes you're using
|
|||
3. Add your **Open AI API Key** to the **Agent** component.
|
||||
4. Add **Chat input** and **Chat output** components to your flow, and connect them to the tool calling agent.
|
||||
|
||||
<img src="/img/tool-calling-agent-add-chat.png" alt="Chat with agent component" style={{display: 'block', margin: 'auto', width: 600}} />
|
||||

|
||||
|
||||
This basic flow enables you to chat with the agent with the **Playground** after you've connected some **Tools**.
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ This component is not in the **Tools** category, but the agent can still use it
|
|||
To enable **Tool Mode** on the component, click **Tool Mode**.
|
||||
The component's fields change dynamically based on the mode it's in.
|
||||
|
||||
<img src="/img/tool-calling-agent-add-tools.png" alt="Chat with agent component" style={{display: 'block', margin: 'auto', width: 600}} />
|
||||

|
||||
|
||||
## Solve problems with the agent
|
||||
|
||||
|
|
@ -53,7 +54,25 @@ Point **API Request** to an online rules document, tell your agent `You are a fu
|
|||
* You need to learn a new software language quickly.
|
||||
Point **API Request** to some docs, tell your agent `You are a knowledgeable software developer who uses the tools at your disposal`, and start learning.
|
||||
|
||||
See what problems you can solve with this flow. As your problem becomes more specialized, add a tool. For example, the [simple agent starter project](/starter-projects-simple-agent) adds a Python REPL component to solve math problems that are too challenging for the calculator.
|
||||
See what problems you can solve with this flow. As your problem becomes more specialized, add a tool. For example, the [math agent tutorial project](/tutorials-math-agent) adds a Python REPL component to solve math problems that are too challenging for the calculator.
|
||||
|
||||
### Edit a tool's metadata
|
||||
|
||||
To edit a tool's metadata, click the **Edit Tools** button in the tool to modify its `name` or `description` metadata. These fields help connected agents understand how to use the tool, without having to modify the agent's prompt instructions.
|
||||
|
||||
For example, the [URL](/components-data#url) component has three tools available when **Tool Mode** is enabled.
|
||||
|
||||
| Tool Name | Description |
|
||||
|-----------|-------------|
|
||||
| `URL-fetch_content` | Use this tool to fetch and retrieve raw content from a URL, including HTML and other structured data. The full response content is returned. |
|
||||
| `URL-fetch_content_text` | Use this tool to fetch and extract clean, readable text content from a webpage. Only plain text content is returned. |
|
||||
| `URL-as_dataframe` | Use this tool to fetch structured data from a URL and convert it into a tabular format. Data is returned in a structured DataFrame table format. |
|
||||
|
||||
A connected agent will have a clear idea of each tool's capabilities based on the `name` and `description` metadata. If you think the agent is using a tool incorrectly, edit a tool's metadata to help it understand the tool better.
|
||||
|
||||
Tool names and descriptions can be edited, but the default tool identifiers cannot be changed. If you want to change the tool identifier, create a custom component.
|
||||
|
||||
To see which tools the agent is using and how it's using them, ask the agent, `What tools are you using to answer my questions?`
|
||||
|
||||
## Use an agent as a tool
|
||||
|
||||
|
|
@ -70,7 +89,11 @@ Add an agent to your problem-solving flow that uses a different OpenAI model for
|
|||
The new agent will use `gpt-4o` for the larger tasks of scraping and searching information that requires large context windows.
|
||||
The problem-solving agent will now use this agent as a tool, with its unique LLM and toolset.
|
||||
|
||||
<img src="/img/tool-calling-agent-as-tool.png" alt="Chat with agent component" style={{display: 'block', margin: 'auto', width: 600}} />
|
||||

|
||||
|
||||
7. The new agent's metadata can be edited to help the problem-solving agent understand how to use it.
|
||||
Click **Edit Tools** to modify the new agent's `name` or `description` metadata so its usage is clear to the problem-solving agent.
|
||||
For example, the default tool name is `Agent`. Edit the name to `Agent-gpt-4o`, and edit the description to `Use the gpt-4o model for complex problem solving`. The problem-solving agent will understand that this is the `gpt-4o` agent, and will use it for tasks requiring a larger context window.
|
||||
|
||||
## Add custom components as tools {#components-as-tools}
|
||||
|
||||
|
|
@ -181,8 +204,9 @@ An agent can use flows that are saved in your workspace as tools with the [Run f
|
|||
1. To add a **Run flow** component, click and drag a **Run flow** component to your workspace.
|
||||
2. Select the flow you want the agent to use as a tool.
|
||||
3. Enable **Tool Mode** in the component.
|
||||
3. Connect the tool output to the agent's tools input.
|
||||
4. Ask the agent, `What tools are you using to answer my questions?`
|
||||
Your flow should be visible in the response.
|
||||
4. Connect the tool output to the agent's tools input.
|
||||
5. To enable tool mode, select a **Flow** in the **Run flow** component, and then click **Tool Mode**.
|
||||
6. Ask the agent, `What tools are you using to answer my questions?`
|
||||
Your flow should be visible in the response as a tool.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ Instead of developers having to create logical statements to direct every possib
|
|||
|
||||
To simplify the development of agents, Langflow created a custom [Tool calling agent](/components-agents#agent-component) component that simplifies configuration and lets developers focus on solving problems with agents.
|
||||
|
||||
<img src="/img/tool-calling-agent-component.png" alt="Prompt component" style={{display: 'block', margin: 'auto', width: 300}} />
|
||||

|
||||
|
||||
To get started, see [Create a problem solving agent](/agents-tool-calling-agent-component).
|
||||
Loading…
Add table
Add a link
Reference in a new issue