Metadata-Version: 2.1
Name: openapi-agent
Version: 0.1.3
Summary: An OpenAPI agent that can execute operations based on natural language descriptions
Author: Jordi Montes Sanabria
Author-email: jordi@fewsats.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: cachetools
Requires-Dist: docker
Requires-Dist: fastapi
Requires-Dist: jsonref
Requires-Dist: langsmith
Requires-Dist: openai
Requires-Dist: openapi-spec-validator
Requires-Dist: pydantic
Requires-Dist: python-dotenv
Requires-Dist: pyyaml
Requires-Dist: uvicorn
Description-Content-Type: text/markdown

# OpenAPI Agent

A Python library that enables natural language interaction with any OpenAPI-compliant API. The agent interprets natural language commands, matches them to appropriate API operations, and executes them safely.

## Features

- 🤖 Natural language understanding of API operations
- 🔒 Secure code execution in sandboxed environments
- 🔄 Automatic retry mechanisms
- 💾 Caching of API specifications
- 🔍 Smart operation matching using tags and descriptions

## Installation

```bash
pip install openapi-agent
```

## Quickstart

```python
from openapi_agent import Agent

# Initialize agent with OpenAPI spec
agent = Agent('path/to/openapi.yaml', auth_header="Bearer your-token")

# Execute operations using natural language
result = agent.execute_function("github_agent", {
    "action": "Create a new user repository called 'my-repo' and return its full name"
})
```


## Security

- All code execution happens in isolated Docker containers
- Automatic timeout handling prevents infinite loops
- No file system access outside the sandbox
- Limited network access within the container

## Environment Variables

- `OPENAI_API_KEY`: Your OpenAI API key
- Additional API-specific authentication tokens as needed

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

