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
pip install openapi-agent
Quickstart
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.
Metadata
Release files for openapi-agent 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openapi_agent-0.1.3.tar.gz | 9.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openapi_agent-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / openapi_agent-0.1.3.tar.gz
| Download URL | openapi_agent-0.1.3.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1eb214a890f248cb075e1be041c120a82a6c7daeadfae7cbcc83cdeeffb43b5
|
|
BLAKE2b-256 checksum How to use checksums |
bae94ac029910e27a49d82ee9c9ceddb96b2918ba43da7f3fbd98fa4f4b06cf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Darwin/24.1.0
|
Release files / openapi_agent-0.1.3-py3-none-any.whl
| Download URL | openapi_agent-0.1.3-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f85615c2eaaa099f4c1e30a9cc3d9d316a202abc9400da5399677c8e6d94d9ed
|
|
BLAKE2b-256 checksum How to use checksums |
92e7b0cfbf6a1c5370a235da8ff64da4ee646777cfd9645be6d390fdb805e71b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Darwin/24.1.0
|
Security for openapi-agent 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.