ai-parrot-0.9.9
توضیحات
Chatbot services for Navigator, based on Langchain
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | ai-parrot-0.9.9 |
| نام | ai-parrot |
| نسخه کتابخانه | 0.9.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Jesus Lara <jesuslara@phenobarbital.info> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/ai-parrot/ |
| مجوز | - |
# AI-Parrot 🦜
**AI-Parrot** is a powerful, async-first Python framework for building, extending, and orchestrating AI Agents and Chatbots. Built on top of `navigator-api`, it provides a unified interface for interacting with various LLM providers, managing tools, conducting agent-to-agent (A2A) communication, and serving agents via the Model Context Protocol (MCP).
Whether you need a simple chatbot, a complex multi-agent orchestration workflow, or a robust production-ready AI service, AI-Parrot exposes the primitives to build it efficiently.
## 🚀 Key Features
* **Unified Agent API**: Simple interface (`Chatbot`) to create agents with memory, tools, and RAG capabilities.
* **Tool Management**: Easy-to-use decorators (`@tool`) and class-based toolkits (`AbstractToolkit`) to give your agents capabilities.
* **Orchestration & Workflow**: `AgentCrew` for managing multi-agent workflows (Sequential, Parallel, Flow, Loop).
* **Advanced Connectivity**:
* **A2A (Agent-to-Agent)**: Native protocol for agents to discover and talk to each other.
* **MCP (Model Context Protocol)**: Expose your agents as MCP servers or consume external MCP servers.
* **OpenAPI Integration**: Consume any OpenAPI specification as a dynamic toolkit (`OpenAPIToolkit`).
* **Scheduling**: Built-in task scheduling for agents using the `@schedule` decorator.
* **Multi-Provider Support**: Switch seamlessy between OpenAI, Anthropic, Google Gemini, Groq, and more.
* **Integrations**: Native support for exposing bots via Telegram, MS Teams, and Slack.
---
## 📦 Installation
```bash
pip install ai-parrot
```
For specific provider support (e.g., Anthropic, Google):
```bash
pip install "ai-parrot[anthropic,google]"
```
---
## ⚡ Quick Start
Create a simple weather chatbot in just a few lines of code:
```python
import asyncio
from parrot.bots import Chatbot
from parrot.tools import tool
# 1. Define a tool
@tool
def get_weather(location: str) -> str:
"""Get the current weather for a location."""
return f"The weather in {location} is Sunny, 25°C"
async def main():
# 2. Create the Agent
bot = Chatbot(
name="WeatherBot",
llm="openai:gpt-4o", # Provider:Model
tools=[get_weather],
system_prompt="You are a helpful weather assistant."
)
# 3. Configure (loads tools, connects to memory)
await bot.configure()
# 4. Chat!
response = await bot.ask("What's the weather like in Madrid?")
print(response)
if __name__ == "__main__":
asyncio.run(main())
```
---
## 🏗️ Architecture
AI-Parrot is designed with a modular architecture enabling agents to be both consumers and providers of tools and services.
```mermaid
graph TD
User["User / Client"] --> API["AgentTalk Handlers"]
API --> Bot["Chatbot / BaseBot"]
subgraph "Agent Core"
Bot --> Memory["Memory / Vector Store"]
Bot --> LLM["LLM Client (OpenAI/Anthropic/Etc)"]
Bot --> TM["Tool Manager"]
end
subgraph "Tools & Capabilities"
TM --> LocalTools["Local Tools (@tool)"]
TM --> Toolkits["Toolkits (OpenAPI/Custom)"]
TM --> MCPServer["External MCP Servers"]
end
subgraph "Connectivity"
Bot -.-> A2A["A2A Protocol (Client/Server)"]
Bot -.-> MCP["MCP Protocol (Server)"]
Bot -.-> Integrations["Telegram / MS Teams"]
end
subgraph "Orchestration"
Crew["AgentCrew"] --> Bot
Crew --> OtherBots["Other Agents"]
end
```
---
## 🧩 Core Concepts
### Agents (`Chatbot`)
The `Chatbot` class is your main entry point. It handles conversation history, RAG (Retrieval-Augmented Generation), and tool execution loop.
```python
bot = Chatbot(
name="MyAgent",
model="anthropic:claude-3-5-sonnet-20240620",
enable_memory=True
)
```
### Tools
#### Functional Tools (`@tool`)
The simplest way to create a tool. The docstring and type hints are automatically used to generate the schema for the LLM.
```python
from parrot.tools import tool
@tool
def calculate_vat(amount: float, rate: float = 0.20) -> float:
"""Calculate VAT for a given amount."""
return amount * rate
```
#### Class-Based Toolkits (`AbstractToolkit`)
Group related tools into a reusable class. All public async methods become tools.
```python
from parrot.tools import AbstractToolkit
class MathToolkit(AbstractToolkit):
async def add(self, a: int, b: int) -> int:
"""Add two numbers."""
return a + b
async def multiply(self, a: int, b: int) -> int:
"""Multiply two numbers."""
return a * b
```
#### OpenAPI Toolkit (`OpenAPIToolkit`)
Dynamically generate tools from any OpenAPI/Swagger specification.
```python
from parrot.tools.openapi_toolkit import OpenAPIToolkit
petstore = OpenAPIToolkit(
spec="https://petstore.swagger.io/v2/swagger.json",
service="petstore"
)
# Now your agent can call petstore_get_pet_by_id, etc.
bot = Chatbot(name="PetBot", tools=petstore.get_tools())
```
### Orchestration (`AgentCrew`)
orchestrate multiple agents to solve complex tasks using `AgentCrew`.
**Supported Modes:**
* **Sequential**: Agents run one after another, passing context.
* **Parallel**: Independent tasks run concurrently.
* **Flow**: DAG-based execution defined by dependencies.
* **Loop**: Iterative execution until a condition is met.
```python
from parrot.bots.orchestration import AgentCrew
crew = AgentCrew(
name="ResearchTeam",
agents=[researcher_agent, writer_agent]
)
# Define a Flow
# Writer waits for Researcher to finish
crew.task_flow(researcher_agent, writer_agent)
await crew.run_flow("Research the latest advancements in Quantum Computing")
```
### Scheduling (`@schedule`)
Give your agents agency to run tasks in the background.
```python
from parrot.scheduler import schedule, ScheduleType
class DailyBot(Chatbot):
@schedule(schedule_type=ScheduleType.DAILY, hour=9, minute=0)
async def morning_briefing(self):
news = await self.ask("Summarize today's top tech news")
await self.send_notification(news)
```
---
## 🔌 Connectivity & Exposure
### Agent-to-Agent (A2A) Protocol
Agents can discover and talk to each other using the A2A protocol.
**Expose an Agent:**
```python
# In your server setup (aiohttp)
from parrot.a2a import A2AServer
a2a = A2AServer(my_agent)
a2a.setup(app, url="https://my-agent.com")
```
**Consume an Agent:**
```python
from parrot.a2a import A2AClient
async with A2AClient("https://remote-agent.com") as client:
response = await client.send_message("Hello from another agent!")
```
### Model Context Protocol (MCP)
**AI-Parrot** has first-class support for MCP.
**Consume MCP Servers:**
Give your agent access to filesystem, git, or any other MCP server.
```python
# In Chatbot config
mcp_servers = [
MCPServerConfig(
name="filesystem",
command="npx",
args=["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
)
]
await bot.setup_mcp_servers(mcp_servers)
```
**Expose Agent as MCP Server:**
Allow Claude Desktop or other MCP clients to use your agent as a tool.
```python
# (Configuration details in documentation)
```
### Platform Integrations
Expose your bots natively to chat platforms defined in your `parrot.conf`:
* **Telegram**
* **Microsoft Teams**
* **Slack**
* **WhatsApp**
---
## 🤖 Supported LLM Clients
AI-Parrot supports a wide range of LLM providers via `parrot.clients`:
* **OpenAI** (`openai`)
* **Anthropic** (`anthropic`, `claude`)
* **Google Gemini** (`google`)
* **Groq** (`groq`)
* **X.AI** (`grok`)
* **HuggingFace** (`hf`)
* **Ollama/Local** (via OpenAI compatible endpoint)
---
## 🤝 Community & Support
* **Issues**: [GitHub Tracker](https://github.com/phenobarbital/ai-parrot/issues)
* **Discussion**: [GitHub Discussions](https://github.com/phenobarbital/ai-parrot/discussions)
* **Contribution**: Pull requests are welcome! Please read `CONTRIBUTING.md`.
---
*Built with ❤️ by the Navigator Team*
نیازمندی
| مقدار | نام |
|---|---|
| xtr | youtube_search==2.1.2; |
| xtr | wikipedia==1.4.0; |
| xtr | mediawikiapi==1.2; |
| xtr | pyowm==3.3.0; |
| xtr | stackapi==0.3.1; |
| xtr | duckduckgo-search==8.1.1; |
| xtr | google-search-results==2.4.2; |
| xtr | google-api-python-client>=2.151.0; |
| xtr | networkx>=3.0; |
| xtr | decorator>=5; |
| xtr | html2text==2025.4.15; |
| xtr | httpx-sse==0.4.1; |
| xtr | mcp==1.15.0; |
| xtr | sse-starlette==3.0.2; |
| xtr | requests-oauthlib==2.0.0; |
| xtr | jira==3.10.5; |
| xtr | arxiv==2.2.0; |
| xtr | docker==7.1.0; |
| xtr | aiogoogle==5.17.0; |
| xtr | rq==2.6.0; |
| xtr | zeep[async]==4.3.1; |
| xtr | branca==0.8.2; |
| xtr | folium==0.20.0; |
| xtr | opensearch-py==3.1.0; |
| xtr | mammoth==1.8.0; |
| xtr | pytube==15.0.0; |
| xtr | youtube_transcript_api==1.0.3; |
| xtr | yt-dlp==2025.8.22; |
| xtr | ebooklib>=0.19; |
| xtr | whisperx==3.4.2; |
| xtr | av==15.1.0; |
| xtr | resemblyzer==0.1.4; |
| xtr | pyannote-audio==3.4.0; |
| xtr | pyannote-core==5.0.0; |
| xtr | pyannote-database==5.1.3; |
| xtr | pyannote-metrics==3.2.1; |
| xtr | pyannote-pipeline==3.0.1; |
| xtr | pytorch-lightning==2.5.5; |
| xtr | pytorch-metric-learning==2.9.0; |
| xtr | nvidia-cudnn-cu12==9.1.0.70; |
| xtr | moviepy==2.2.1; |
| xtr | decorator>=5; |
| xtr | ffmpeg==1.4; |
| xtr | paddleocr==3.2.0; |
| xtr | sentence-transformers>=5.0.0; |
| xtr | tiktoken==0.9.0; |
| xtr | chromadb==0.6.3; |
| xtr | bm25s[full]==0.2.14; |
| xtr | simsimd>=4.3.1; |
| xtr | tokenizers<=0.21.1,>=0.20.0; |
| xtr | safetensors>=0.4.3; |
| xtr | torch==2.6.0; |
| xtr | torchaudio==2.6.0; |
| xtr | numpy<2.2,>=2.1; |
| xtr | accelerate==0.34.2; |
| xtr | bitsandbytes==0.44.1; |
| xtr | datasets>=3.0.2; |
| xtr | transformers<=4.51.3,>=4.51.1; |
| xtr | tensorflow>=2.19.1; |
| xtr | tf-keras==2.19.0; |
| xtr | opencv-python==4.10.0.84; |
| xtr | ai-parrot[embeddings,ml-heavy]; |
| xtr | google-genai>=1.61.0; |
| xtr | openai==2.8.1; |
| xtr | yfinance==0.2.54; |
| xtr | youtube_search==2.1.2; |
| xtr | wikipedia==1.4.0; |
| xtr | mediawikiapi==1.2; |
| xtr | pyowm==3.3.0; |
| xtr | stackapi==0.3.1; |
| xtr | duckduckgo-search==8.1.1; |
| xtr | google-search-results==2.4.2; |
| xtr | google-api-python-client>=2.151.0; |
| xtr | networkx>=3.0; |
| xtr | decorator>=5; |
| xtr | html2text==2025.4.15; |
| xtr | httpx-sse==0.4.1; |
| xtr | mcp==1.15.0; |
| xtr | sse-starlette==3.0.2; |
| xtr | requests-oauthlib==2.0.0; |
| xtr | jira==3.10.5; |
| xtr | arxiv==2.2.0; |
| xtr | docker==7.1.0; |
| xtr | aiogoogle==5.17.0; |
| xtr | rq==2.6.0; |
| xtr | zeep[async]==4.3.1; |
| xtr | branca==0.8.2; |
| xtr | folium==0.20.0; |
| xtr | opensearch-py==3.1.0; |
| xtr | torchvision==0.21.0; |
| xtr | timm==1.0.15; |
| xtr | ultralytics==8.3.179; |
| xtr | albumentations==2.0.6; |
| xtr | filetype==1.2.0; |
| xtr | imagehash==4.3.1; |
| xtr | pgvector==0.4.1; |
| xtr | pyheif==0.8.0; |
| xtr | exif==1.6.1; |
| xtr | pillow-avif-plugin==1.5.2; |
| xtr | pillow-heif==0.22.0; |
| xtr | python-xmp-toolkit==2.0.2; |
| xtr | exifread==3.5.1; |
| xtr | transformers<=4.51.3,>=4.51.1; |
| xtr | ffmpeg==1.4; |
| xtr | holoviews==1.21.0; |
| xtr | bokeh==3.7.3; |
| xtr | pandas-bokeh==0.5.5; |
| xtr | plotly==5.22.0; |
| xtr | ipywidgets==8.1.0; |
| xtr | altair==5.5.0; |
| xtr | whisperx==3.4.2; |
| xtr | av==15.1.0; |
| xtr | torch==2.6.0; |
| xtr | torchaudio==2.6.0; |
| xtr | torchvision==0.21.0; |
| xtr | pyannote-audio==3.4.0; |
| xtr | pyannote-core==5.0.0; |
| xtr | pyannote-database==5.1.3; |
| xtr | pyannote-metrics==3.2.1; |
| xtr | pyannote-pipeline==3.0.1; |
| xtr | pytorch-lightning==2.5.5; |
| xtr | pytorch-metric-learning==2.9.0; |
| xtr | nvidia-cudnn-cu12==9.1.0.70; |
| xtr | torch-audiomentations==0.12.0; |
| xtr | torch-pitch-shift==1.2.5; |
| xtr | torchmetrics==1.8.2; |
| xtr | anthropic[aiohttp]==0.61.0; |
| xtr | claude-agent-sdk>=0.1.0; |
| xtr | openai==2.8.1; |
| xtr | tiktoken==0.9.0; |
| xtr | google-api-python-client<=2.177.0,>=2.166.0; |
| xtr | google-cloud-texttospeech==2.27.0; |
| xtr | google-genai>=1.61.0; |
| xtr | google-cloud-aiplatform==1.110.0; |
| xtr | groq==0.33.0; |
| xtr | google-genai>=1.61.0; |
| xtr | openai==2.8.1; |
| xtr | groq==0.33.0; |
| xtr | anthropic[aiohttp]==0.61.0; |
| xtr | claude-agent-sdk>=0.1.0; |
| xtr | xai-sdk>=0.1.0; |
| xtr | querysource>=3.17.9; |
| xtr | async-notify[all]>=1.5.2; |
| xtr | azure-teambots>=0.1.1; |
| xtr | pymilvus==2.4.8; |
| xtr | milvus==2.3.5; |
| xtr | chroma==0.2.0; |
| xtr | ydata-profiling==4.16.1; |
| xtr | sweetviz==2.1.4; |
| xtr | pytector[gguf]==0.2.0; |
| xtr | xai-sdk>=0.1.0; |
| xtr | gunicorn>=23.0.0; |
| xtr | docling[tesserocr]>=2.31.1; |
| xtr | mautrix>=0.20; |
| xtr | python-olm>=3.2.16; |
| xtr | ai-parrot[agents,images,integrations,llms,loaders,vectors]; |
| xtr | ai-parrot[agents-lite,embeddings,integrations,llms]; |
| xtr | pytest>=7.2.2; |
| xtr | pytest-asyncio==1.2.0; |
| xtr | pytest-xdist==3.3.1; |
| xtr | pytest-assume==2.4.3; |
| xtr | pytest-mock==3.15.1; |
| xtr | black; |
| xtr | pylint; |
| xtr | mypy; |
| xtr | coverage; |
| xtr | maturin==1.9.6; |
| - | Cython==3.0.11 |
| - | faiss-cpu>=1.9.0 |
| - | jq==1.7.0 |
| - | rank_bm25==0.2.2 |
| - | tabulate==0.9.0 |
| - | sentencepiece==0.2.1 |
| - | markdown2==2.5.4 |
| - | psycopg-binary==3.2.6 |
| - | python-datamodel>=0.10.17 |
| - | backoff==2.2.1 |
| - | asyncdb>=2.11.6 |
| - | google-cloud-bigquery>=3.30.0 |
| - | numexpr==2.10.2 |
| - | fpdf==1.7.2 |
| - | python-docx==1.1.2 |
| - | typing-extensions<5,>=4.14.1 |
| - | navconfig[default]>=1.7.13 |
| - | navigator-auth>=0.17.2 |
| - | navigator-session>=0.6.5 |
| - | navigator-api[locale,uvloop]>=2.13.5 |
| - | matplotlib==3.10.0 |
| - | seaborn==0.13.2 |
| - | pydub==0.25.1 |
| - | click>=8.1.7 |
| - | async-notify[all]>=1.4.2 |
| - | markitdown>=0.1.2 |
| - | ddgs>=9.5.2 |
| - | xmltodict>=0.14.2 |
| - | pytesseract>=0.3.13 |
| - | python-statemachine==2.5.0 |
| - | aiohttp-swagger3==0.10.0 |
| - | PyYAML>=6.0.2 |
| - | python-arango-async==1.2.0 |
| - | asyncdb[arangodb,bigquery,boto3,influxdb,mongodb]>=2.12.0 |
| - | brotli==1.2.0 |
| - | urllib3==2.6.3 |
| - | aioquic==1.3.0 |
| - | pylsqpack==0.3.23 |
| - | aiohttp-sse-client==0.2.1 |
| - | prance>=25.4.8.0 |
| - | openapi-schema-validator==0.6.3 |
| - | praw>=7.8.1 |
| - | weasyprint==68.0 |
| - | apscheduler==3.11.2 |
| - | pydantic==2.12.5 |
| - | aiohttp-cors>=0.8.1 |
| - | querysource>=3.17.10 |
| - | pywa>=3.8.0 |
| xtr | sentence_transformers==5.0.0; |
| xtr | yfinance==0.2.54; |
| xtr | youtube_search==2.1.2; |
| xtr | wikipedia==1.4.0; |
| xtr | mediawikiapi==1.2; |
| xtr | pyowm==3.3.0; |
| xtr | stackapi==0.3.1; |
| xtr | duckduckgo-search==8.1.1; |
| xtr | google-search-results==2.4.2; |
| xtr | google-api-python-client>=2.151.0; |
| xtr | networkx>=3.0; |
| xtr | decorator>=5; |
| xtr | autoviz==0.1.905; |
| xtr | spacy==3.8.6; |
| xtr | html2text==2025.4.15; |
| xtr | httpx-sse==0.4.1; |
| xtr | mcp==1.15.0; |
| xtr | sse-starlette==3.0.2; |
| xtr | requests-oauthlib==2.0.0; |
| xtr | undetected-chromedriver==3.5.5; |
| xtr | selenium==4.35.0; |
| xtr | playwright==1.52.0; |
| xtr | streamlit==1.50.0; |
| xtr | jira==3.10.5; |
| xtr | arxiv==2.2.0; |
| xtr | docker==7.1.0; |
| xtr | aiogoogle==5.17.0; |
| xtr | rq==2.6.0; |
| xtr | zeep[async]==4.3.1; |
| xtr | branca==0.8.2; |
| xtr | folium==0.20.0; |
| xtr | webdriver-manager==4.0.2; |
| xtr | prophet==1.2.1; |
| xtr | folium==0.20.0; |
| xtr | opensearch-py==3.1.0; |
| xtr | cairosvg>=2.7; |
| xtr | python-pptx==1.0.2; |
| xtr | markdownify==1.1.0; |
| xtr | python-docx==1.1.2; |
| xtr | pymupdf==1.26.3; |
| xtr | pymupdf4llm==0.0.27; |
| xtr | pdf4llm==0.0.27; |
| xtr | alpaca-py>=0.43.2; |
| xtr | defillama-sdk>=0.1.0; |
| xtr | pandas-ta-classic>=0.3.59; |
| xtr | TA-Lib>=0.4.32; |
| xtr | aioimaplib>=1.1.0; |
| xtr | gmqtt>=0.6.15; |
| xtr | azure-identity>=1.18.0; |
| xtr | msgraph-sdk>=1.8.0; |
| xtr | microsoft-kiota-authentication-azure>=1.2.0; |
| xtr | jinja2>=3.1; |
| xtr | xhtml2pdf>=0.2.17; |
| xtr | matplotlib>=3.7; |
| xtr | cairosvg>=2.7; |
| xtr | svglib>=1.5; |
| xtr | reportlab>=4.0; |
| xtr | yfinance==0.2.54; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10.1 | Python |
نحوه نصب
نصب پکیج whl ai-parrot-0.9.9:
pip install ai-parrot-0.9.9.whl
نصب پکیج tar.gz ai-parrot-0.9.9:
pip install ai-parrot-0.9.9.tar.gz