BabyAGI 2o – the simplest self-building autonomous agent.
- Một bát cơm gạo lứt bao nhiêu Calo? Ăn nhiều có béo không?
- 5 cách bảo quản hạt dẻ đơn giản, để được lâu và tươi ngon hơn
- 50 reasons why a woman really DOES need a man! The list by Jane Gordon, who is on her own for the first time in 30 years, is irreverent, poignant and very funny…
- Bánh giò bao nhiêu calo? Sự thật về việc ăn nhiều bánh giò gây tăng cân
- Lung Metastases Imaging
BabyAGI 2o is an exploration into creating the simplest self-building autonomous agent. Unlike its sibling project BabyAGI 2, which focuses on storing and executing functions from a database, BabyAGI 2o aims to iteratively build itself by creating and registering tools as required to complete tasks provided by the user. As these functions are not stored, the goal is to integrate this with the BabyAGI 2 framework for persistence of tools created.
Bạn đang xem: Search code, repositories, users, issues, pull requests…
- Simple Autonomous Agent: Capable of building and updating tools to solve user-defined tasks.
- Dynamic Tool Creation: The agent creates and updates its tools, enabling it to solve increasingly complex tasks without human intervention.
- Package Management: Automatically installs required packages for tools.
- Error Handling and Iteration: Handles errors gracefully, learns from them, and continues iterating towards task completion.
- Function Storage: Functions are registered dynamically, allowing them to be reused in future tasks.
- Model Flexibility: Compatible with multiple models via litellm, as long as they support tool calling.
- Python 3.7 or higher
- pip package manager
-
Clone the Repository
-
Create a Virtual Environment (Optional but Recommended)
-
Install Dependencies
BabyAGI 2o uses the litellm package to interface with language models. Depending on the model you choose (e.g., OpenAI’s GPT-4, Anthropic’s Claude), you’ll need to set the appropriate API keys in your environment variables. You’ll also need to specify the model by setting the LITELLM_MODEL environment variable. Ensure that the model you choose supports tool/function calling.
- OpenAI models (e.g., gpt-4, gpt-3.5-turbo)
- Anthropic models (e.g., claude-2)
- Any other models supported by litellm that support tool calling
For macOS/Linux:
For Windows (Command Prompt):
For Windows (PowerShell):
Run the application:
-
Install python-dotenv to load environment variables from a .env file:
-
Create a .env file in the root of the project directory and add your API keys and model configuration:
Note: Include only the API key relevant to the model you are using.
-
Run the application as usual:
Ensure that the model you select supports tool/function calling. Not all models may have this capability. Refer to the litellm documentation or the model provider’s documentation to confirm.
-
Run the Application
-
Describe the Task
Xem thêm : Recommended for you
When prompted, enter a description of the task you want BabyAGI 2o to complete. The agent will iterate through creating and using tools, aiming to solve the task autonomously.
-
Monitor Progress
The agent will print progress updates as it iterates. If the task is completed, you will see a “Task completed” message.
-
View Generated Tools
BabyAGI 2o will dynamically create or update Python functions as tools to solve the task.
Here are some fun examples that sometimes works:
- Scrape techmeme and provide a summary of headlines.
- Analyze image.jpg in your folder and describe the image. (you need to include an image file for this.)
- Create a halloween flyer using DALLE to generate a background and overlaying a halloween message in big letters, then save the image.
You can see those examples on this X/Twitter thread.
This project is an experimental exploration of autonomous agent building. Contributions are welcome, especially if you’re interested in integrating this functionality into the BabyAGI framework. Feel free to fork the repo, make improvements, and reach out on X/Twitter to discuss ideas. Note that I don’t check PRs frequently, so a heads-up is appreciated!
This project is licensed under the MIT License – see the LICENSE file for details.
Nguồn: https://blogtinhoc.edu.vn
Danh mục: Giáo Dục
This post was last modified on Tháng mười một 13, 2024 5:19 chiều