π Quickstart
Lets build our first Agent use cases.
In this quickstart, we'll explore one of the use cases to demonstrate the execution of the Agent. We'll focus on querying Search Engines tools like DuckDuckGoSearchTool
to gather the information on 3 Days Trip to San Francisco and Bay area based on recent days.
Agents excel at autonomously performing multiple tasks, making decisions on the fly, and communicating with other agents. For this use case, we will let Admin
Agent to auto-decompose or Plan
the task and use tools as the supported Actions
.
1. Import required modules
To get started, we need to initialize a few methods from the modules.
Admin
Worker
Action
Large Language Model
Memory
Planner
2. Setting LLM configuration
To authenticate your requests to the OpenAI API (by default OpenAI Model will be used), you need to set your API key as an environment variable. This is essential for ensuring secure and authorised access to the API services.
Replace sk-proj-xxxxxxxxxxxxxxxxxx
with your actual OpenAI API key.
3. Setup Workers with Tools and Action
Workers are specialized classes tasked with executing the assignments given by the "Admin" class. They use tools such as internet news search engines, LLMs, and document writers to complete their tasks, individually and in cohesion (for complex tasks like writing blog articles).
An action is a functionality that enables the Agent to fetch, process, and store data for further analysis and decision-making.
DuckDuckGoNewsSearch
: This tool fetches real-time news data using the DuckDuckGo search engine, providing up-to-date information.WebBaseContextTool
: This tool is used to extract information from Web Pages. It also provides a way to load and optionally summarize the content of a webpage.WriteFileAction
: This action saves the written file to the specified location, ensuring data persistence.
4. Execute the Admin Agent
The Admin Agent serves as the central part for decision-maker, comprehending task specifications in form of supported actions and executing them in a human-like manner.
In order to execute the agent, user needs to specify their query and description to get the response from the Admin agent.
Last updated