Fluid API
Project description
FluidAPI: Natural Language API Requests
Welcome to FluidAPI, a revolutionary framework that allows you to interact with APIs using natural language. No more JSON, headers, or complex formats—simply describe your request in plain English, and FluidAPI will do the rest.
Powered by the Swarms Framework and created by Kye Gomez, FluidAPI redefines how developers interact with APIs.
🌟 Features
- Natural Language API Requests: Just describe your task, and FluidAPI generates and executes the request for you.
- Powered by AI Agents: Built on the robust Swarms Framework, enabling dynamic and intelligent API handling.
- Effortless Integration: Replace complex API workflows with simple, human-friendly commands.
- Retry and Reliability: Automatic retries and error handling for seamless performance.
- Dynamic Authentication: Handles token management and injects them automatically.
🚀 Installation
Install the fluid-api
package via pip:
pip install fluid-api
🔧 Getting Started
1. Import and Initialize FluidAPI
from fluid_api.main import fluid_api_request, batch_fluid_api_request
2. Make a Natural Language Request
Simply describe your request in natural language:
from fluid_api.main import fluid_api_request, batch_fluid_api_request
print(fluid_api_request("Generate an API request to get a random cat fact from https://catfact.ninja/fact"))
print(batch_fluid_api_request([
"Generate an API request to get a random cat fact from https://catfact.ninja/fact",
"Generate an API request to get a random dog fact from https://dogapi.dog/api/v2/facts",
"Generate an API request to get a random joke from https://official-joke-api.appspot.com/random_joke"
]))
FluidAPI will:
- Interpret your request.
- Generate and execute the appropriate API call.
- Return the API's response.
✨ Examples
Fetch Data
response = api_agent.run("Get a list of cat facts from https://catfact.ninja/fact")
print(response)
Post Data
response = api_agent.run("Send a POST request to https://api.example.com/users with name='John Doe' and email='john.doe@example.com'")
print(response)
Authentication
FluidAPI automatically handles token management. For APIs requiring authentication, simply include it in your description:
response = api_agent.run("Retrieve my GitHub repositories from https://api.github.com/user/repos using my GitHub token")
print(response)
⚙️ Configuration
Environment Variables
FluidAPI uses environment variables for sensitive data:
OPENAI_API_KEY
: Your OpenAI API key.
Set these variables in your .env
file:
OPENAI_API_KEY=your-openai-api-key
WORKSPACE_DIR="agent_workspace"
📦 Advanced Features
Retry Logic
FluidAPI includes built-in retry logic to handle transient failures automatically. You can configure retry settings directly in the agent.
Caching
Frequent requests are optimized with caching to improve performance.
🛠 Development
Clone the Repository
git clone https://github.com/The-Swarm-Corporation/fluidapi.git
cd fluidapi
Install Dependencies
pip install -r requirements.txt
💡 How It Works
FluidAPI leverages the Swarms Framework to:
- Parse natural language instructions.
- Dynamically construct API requests.
- Execute requests and handle responses intelligently.
Learn more about the Swarms Framework here.
Todo
- Add documentation
- Add tests
- Add examples
🤝 Contributing
We welcome contributions! To get started:
- Fork the repository.
- Create a new branch.
- Submit a pull request.
📝 License
FluidAPI is licensed under the MIT License. See the LICENSE file for details.
🌍 Connect with Us
- Author: Kye Gomez
- Project: The-Swarm-Corporation/FluidAPI
- Pip Package: fluid-api
Transform the way you interact with APIs. With FluidAPI, it's as simple as saying what you want.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fluid_api_agent-0.0.1.tar.gz
.
File metadata
- Download URL: fluid_api_agent-0.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d68efb77572501e77741e6a8859ba5a0a04f817062d2d288bd3c764bbf577c3 |
|
MD5 | 1f1c096583c16bcf5b260ebb2e692651 |
|
BLAKE2b-256 | 89ceec3a1523f5787e7e08a3f567fbd1b8b27d3ffc0fdf9398513b2bfde5d5a1 |
File details
Details for the file fluid_api_agent-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: fluid_api_agent-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65fdd439898ba20f99432eca981adea832064152a023ca2a20dff43a3eb43631 |
|
MD5 | 45b5da354f93b2780d3cbf72442054ae |
|
BLAKE2b-256 | 4e79ab9ae032fc6bba67afa0802cb7a7beb47c8e946367b634753caea54c26ca |