Metadata-Version: 2.4
Name: pgns-agent-crewai
Version: 0.2.0
Summary: CrewAI adapter for pgns-agent
Project-URL: Homepage, https://pgns.io
Project-URL: Documentation, https://docs.pgns.io/libraries/pgns-agent-crewai
Project-URL: Repository, https://github.com/pgns-io/pgns-agent-crewai
Author: pgns
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: a2a,agents,crewai,pgns
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: crewai<1,>=0.108
Requires-Dist: pgns-agent>=0.1
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# pgns-agent-crewai

CrewAI adapter for [pgns-agent](https://pypi.org/project/pgns-agent/). Run CrewAI crews as pgns agents with automatic correlation ID propagation and signed webhook delivery.

## Quick Start

```python
from crewai import Agent, Crew, Task
from pgns_agent import AgentServer
from pgns_agent_crewai import CrewAIAdapter

# Define your CrewAI crew
researcher = Agent(role="Researcher", goal="Find key facts about a topic")
task = Task(description="Research {topic}", agent=researcher)
crew = Crew(agents=[researcher], tasks=[task])

# Wrap it in a pgns agent
server = AgentServer("my-crew", "A CrewAI-powered research agent")
server.use(CrewAIAdapter(crew))
server.listen(3000)
```

## How It Works

The adapter calls `crew.kickoff(inputs=task_input)` with the incoming task payload as input variables. The `CrewOutput` is normalized into a pgns-agent result dict with:

- `output` — the crew's raw output string (or structured Pydantic model)
- `metadata.tasks` — per-task results (description, agent, raw output)
- `metadata.token_usage` — aggregate token usage when available

## Installation

```bash
pip install pgns-agent-crewai
```

## License

Apache-2.0
