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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openapi_agent-0.1.3.tar.gz
(9.7 kB
view details)
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 openapi_agent-0.1.3.tar.gz.
File metadata
- Download URL: openapi_agent-0.1.3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.3 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1eb214a890f248cb075e1be041c120a82a6c7daeadfae7cbcc83cdeeffb43b5
|
|
| MD5 |
fa627e219b54315b05839963775a6898
|
|
| BLAKE2b-256 |
bae94ac029910e27a49d82ee9c9ceddb96b2918ba43da7f3fbd98fa4f4b06cf3
|
File details
Details for the file openapi_agent-0.1.3-py3-none-any.whl.
File metadata
- Download URL: openapi_agent-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.12.3 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f85615c2eaaa099f4c1e30a9cc3d9d316a202abc9400da5399677c8e6d94d9ed
|
|
| MD5 |
10d8e7412d0ba278afd2b12a57021b6a
|
|
| BLAKE2b-256 |
92e7b0cfbf6a1c5370a235da8ff64da4ee646777cfd9645be6d390fdb805e71b
|