Skip to main content

Fluid API

Project description

FluidAPI: Natural Language API Requests

Join our Discord Subscribe on YouTube Connect on LinkedIn Follow on X.com

Overview

FluidAPI is an enterprise-grade framework that enables natural language interaction with APIs. Eliminate the complexity of JSON formatting, header management, and complex request structures by simply describing your requirements in plain English. FluidAPI automatically handles the rest.

Built on the robust Swarms Framework and developed by Kye Gomez, FluidAPI revolutionizes API integration workflows for enterprise applications.


Key Features

  • Natural Language Processing: Transform natural language descriptions into fully functional API requests
  • AI-Powered Execution: Leverages the Swarms Framework for intelligent and dynamic API handling
  • Seamless Integration: Replace complex API workflows with intuitive, human-readable commands
  • Enterprise Reliability: Built-in retry mechanisms and comprehensive error handling for production environments
  • Dynamic Authentication Management: Automated token management and secure credential injection

Installation

Install the fluid-api-agent package using pip:

pip install fluid-api-agent

Quick Start

Basic Implementation

from fluid_api_agent.main import (
    fluid_api_request,
)

# Basic API Request Example
basic_request = fluid_api_request(
    "Generate an API request to get a random cat fact from https://catfact.ninja/fact"
)

print(basic_request.model_dump_json(indent=4))

Advanced Implementation

from fluid_api_agent.main import (
    fluid_api_request,
    batch_fluid_api_request,
)

# Basic API Request
# Execute a simple API request with default parameters
basic_request = fluid_api_request(
    "Generate an API request to get a random cat fact from https://catfact.ninja/fact"
)
print("\n=== Basic Request ===")
print(basic_request.model_dump_json(indent=4))

# Raw Response Request
# Retrieve unprocessed response data
raw_request = fluid_api_request(
    "Generate an API request to get a random joke from https://official-joke-api.appspot.com/random_joke",
    return_raw=True
)
print("\n=== Raw Request ===") 
print(raw_request.model_dump_json(indent=4))

# Verbose Request Processing
# Enable comprehensive logging during request execution
verbose_request = fluid_api_request(
    "Generate an API request to get weather data for New York from OpenWeatherMap",
    verbose=True
)
print("\n=== Verbose Request ===")
print(verbose_request.model_dump_json(indent=4))

# Custom Documentation Integration
# Enhance request generation with specific API documentation
docs = """
API Endpoint: https://api.example.com/v1/users
Methods: GET, POST
Authentication: Bearer token required
"""
custom_doc_request = fluid_api_request(
    "Generate a request to get all users",
    documentation=docs,
    verbose=True
)
print("\n=== Request with Documentation ===")
print(custom_doc_request.model_dump_json(indent=4))

# Batch Processing
# Execute multiple API requests sequentially
print("\n=== Batch Request ===")
batch_results = batch_fluid_api_request(
    tasks=[
        "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 quote from https://api.quotable.io/random",
        "Generate an API request to get Bitcoin price from CoinGecko public API"
    ],
    verbose=True
)
for i, result in enumerate(batch_results, 1):
    print(f"\nBatch Result {i}:")
    print(result.model_dump_json(indent=4))

Execution Flow

FluidAPI executes the following workflow:

  1. Request Interpretation: Analyzes and processes natural language input
  2. API Generation: Constructs appropriate API calls based on requirements
  3. Response Handling: Processes and returns API responses

Additional Examples

Refer to the example.py file for comprehensive usage examples.


Configuration

Environment Variables

FluidAPI utilizes environment variables for secure credential management:

  • OPENAI_API_KEY: Your OpenAI API key for AI-powered request processing

Configure these variables in your .env file:

OPENAI_API_KEY=your-openai-api-key
WORKSPACE_DIR="agent_workspace"

Enterprise Features

Retry Mechanisms

FluidAPI incorporates intelligent retry logic to handle transient failures automatically. Retry configurations can be customized directly within the agent settings.

Performance Optimization

Frequent requests are optimized through intelligent caching mechanisms to enhance performance and reduce API latency.


Development Setup

Repository Cloning

git clone https://github.com/The-Swarm-Corporation/fluidapi.git
cd fluidapi

Dependency Installation

pip install -r requirements.txt

Architecture

FluidAPI leverages the Swarms Framework to provide:

  1. Natural Language Parsing: Advanced NLP capabilities for request interpretation
  2. Dynamic Request Construction: Intelligent API request generation
  3. Intelligent Response Processing: Automated response handling and error management

For comprehensive information about the Swarms Framework, visit here.


Development Roadmap

  • Comprehensive API documentation
  • Unit and integration test suite
  • Extended usage examples
  • Performance benchmarking tools

Contributing

We welcome contributions from the community. To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request with detailed descriptions

License

FluidAPI is licensed under the MIT License. See the LICENSE file for complete terms and conditions.


Contact Information


Transform your API integration experience. With FluidAPI, complex API workflows become simple, natural language commands.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluid_api_agent-0.3.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fluid_api_agent-0.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file fluid_api_agent-0.3.0.tar.gz.

File metadata

  • Download URL: fluid_api_agent-0.3.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for fluid_api_agent-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3ab4ae05d310966895f5b1a2f1b5c82f1f47cfd0401bb72f0c6bba87e034f5dd
MD5 2eb41f8d738aa20bf8dd7c299d7aebbb
BLAKE2b-256 f21e1752c05e2d377814739416da2eb13b47f6c1c152436501c8d81a9dd41178

See more details on using hashes here.

File details

Details for the file fluid_api_agent-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fluid_api_agent-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for fluid_api_agent-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3fe873fcede3aa188a18335e5f0d280e736e1500adc84a224abf3ebd67061f2
MD5 3788b550a86b565f172c9b0b13d7b7e2
BLAKE2b-256 71ef7ca00761275ad586697ed775e0386b9ae59d84dc246316c2c9ae54c0a0bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page