docs: v1.1.2 (#5850)
* docs:add-changelog-to-nav * docs: add OpenRouter component documentation with detailed inputs and outputs * docs: add Outputs section to components-models documentation for Cohere and Ollama * docs: update references from configuration-objects to concepts-objects across multiple components and documentation files * feat: Add DataFrame operations section to components-processing documentation * title-case-in-nav * fix-memories-tab-in-chat-memory * tool-calling-agent-update * feat: enhance documentation with icon imports and improved instructions for OpenAI component * material-icon * fix: update documentation for tool mode input connection in agent component * add-loop-component * add-img-for-loop-summary * feat: add documentation for using logic components in a flow with examples * fix: enhance documentation for Loop component with detailed data flow explanation * redirect-for-config-objects-page * fix: improve error handling in data processing module * fix: update documentation for Data objects in Loop component and add import statement in memory chatbot tutorial * quickstart-screenshots * docs: update starter flow images * update-agent-screenshots * move-repl-agent * docs: enhance global variables documentation and clarify prerequisites for vector store RAG flow * docs: update Simple Agent to use URL component * docs: enhance memory chatbot tutorial with example conversation and clarify session ID terminology * docs: update visibility icon description in concepts-components.md * Apply suggestions from code review Co-authored-by: brian-f <brian.fisher@datastax.com> * correct-playground-sequence-and-typo --------- Co-authored-by: brian-f <brian.fisher@datastax.com>
This commit is contained in:
parent
3e835632df
commit
0d11564dea
52 changed files with 917 additions and 1370 deletions
56
docs/docs/Tutorials/tutorials-math-agent.md
Normal file
56
docs/docs/Tutorials/tutorials-math-agent.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
title: Math agent
|
||||
slug: /tutorials-math-agent
|
||||
---
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
Build a **Math Agent** flow for an agentic application using the **Tool-calling agent** component.
|
||||
|
||||
In this flow, the **Tool-calling agent** reasons using an **Open AI** LLM to solve math problems.
|
||||
It selects the **Calculator** tool for simpler math and the **Python REPL** tool (with the Python `math` library) for more complex problems.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To use this flow, you need an OpenAI API key.
|
||||
|
||||
## Open Langflow and start a new flow
|
||||
|
||||
Click **New Flow**, and then select the **Math Agent** flow.
|
||||
|
||||
This opens a starter flow with the necessary components to run an agentic application using the Tool-calling agent.
|
||||
|
||||
## Math Agent flow
|
||||
|
||||

|
||||
|
||||
The **Math Agent** flow consists of these components:
|
||||
|
||||
* The **Tool calling agent** component uses the connected LLM to reason through the user's input and select among the connected tools to complete its task.
|
||||
* The **Python REPL tool** component executes Python code in a REPL (Read-Evaluate-Print Loop) interpreter.
|
||||
* The **Calculator** component performs basic arithmetic operations.
|
||||
* The **Chat Input** component accepts user input to the chat.
|
||||
* The **Prompt** component combines the user input with a user-defined prompt.
|
||||
* The **Chat Output** component prints the flow's output to the chat.
|
||||
* The **OpenAI** model component sends the user input and prompt to the OpenAI API and receives a response.
|
||||
|
||||
## Run the Math Agent flow
|
||||
|
||||
1. Add your credentials to the Open AI component.
|
||||
2. Click **Playground** to start a chat session.
|
||||
3. Enter a simple math problem, like `2 + 2`, and then make sure the bot responds with the correct answer.
|
||||
4. To confirm the REPL interpreter is working, prompt the `math` library directly with `math.sqrt(4)` and see if the bot responds with `4`.
|
||||
5. The agent will also reason through more complex word problems. For example, prompt the agent with the following math problem:
|
||||
|
||||
```plain
|
||||
The equation 24x2+25x−47ax−2=−8x−3−53ax−2 is true for all values of x≠2a, where a is a constant.
|
||||
What is the value of a?
|
||||
A) -16
|
||||
B) -3
|
||||
C) 3
|
||||
D) 16
|
||||
```
|
||||
|
||||
The agent should respond with `B`.
|
||||
|
||||
Now that your query has completed the journey from **Chat input** to **Chat output**, you have completed the **Math Agent** flow.
|
||||
Loading…
Add table
Add a link
Reference in a new issue