A Python package for building AI agents capable of making multiple function calls in sequence
Project description
TeenAGI
A Python package for building AI agents capable of making multiple function calls in sequence. Inspired by BabyAGI but with more advanced capabilities.
Table of Contents
Installation
pip install teenagi
Usage
Python API
from teenagi import TeenAGI, create_agent
# Create an agent with a custom name and OpenAI integration
agent = TeenAGI(
name="Research Assistant",
api_key="your_openai_api_key", # Or set OPENAI_API_KEY environment variable
provider="openai", # "openai" or "anthropic"
model="gpt-4-turbo" # Optional, defaults to "gpt-3.5-turbo" for OpenAI
)
# Add capabilities to the agent
agent.learn("can search the web for information")
agent.learn("can summarize long documents")
# Get a response that might require multiple function calls
response = agent.respond("Find and summarize recent research on climate change")
print(response)
# Alternative: use the factory function
specialized_agent = create_agent(
name="DataAnalyst",
provider="anthropic",
model="claude-3-opus-20240229"
)
Command Line Interface
TeenAGI includes a CLI for quick interactions:
# Basic usage
teenagi --name "ResearchBot" --capabilities "can search the web" "can summarize text" "Find recent papers on quantum computing"
# Using with OpenAI
teenagi --provider openai --api-key "your_openai_api_key" --model "gpt-4" "Explain quantum entanglement"
# Using with Anthropic
teenagi --provider anthropic --api-key "your_anthropic_api_key" --model "claude-3-sonnet-20240229" "Explain quantum entanglement"
You can also store your API keys in a .env file:
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/jordan/teen-agi.git
cd teen-agi
# Install dependencies with Poetry
poetry install
# Run tests
poetry run pytest
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teenagi-0.4.0.tar.gz.
File metadata
- Download URL: teenagi-0.4.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.11 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3acceff7d4d5bf0b1979f7b7132088366a97ccebeb08510594c45c583d386d2d
|
|
| MD5 |
341090f5bc4fdf4d8a78220ebd9d3550
|
|
| BLAKE2b-256 |
423b6fdb832a8329002b5042c2d76eeb403db146383577ea9695f8e08894ea08
|
File details
Details for the file teenagi-0.4.0-py3-none-any.whl.
File metadata
- Download URL: teenagi-0.4.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.11 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd2d8ba01550ef6811b70308a569bdfffa777274af2d38191897bf07aa73ab63
|
|
| MD5 |
e0bff7789cc8eff647a1725e6362d374
|
|
| BLAKE2b-256 |
2e966824a8595d1bdea446f055f39988776d5fd0c41fe5ace54ea2ac99b71d03
|