fluid-api-agent


Namefluid-api-agent JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/The-Swarm-Corporation/FluidAPI
SummaryFluid API
upload_time2024-11-20 21:55:20
maintainerNone
docs_urlNone
authorKye Gomez
requires_python<4.0,>=3.10
licenseMIT
keywords artificial intelligence deep learning optimizers prompt engineering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FluidAPI: Natural Language API Requests

[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)

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](https://github.com/kyegomez), 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](https://github.com/kyegomez/swarms), 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:

```bash
pip install fluid-api
```

---

## πŸ”§ Getting Started

### 1. Import and Initialize FluidAPI
```python
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:

```python
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:
1. Interpret your request.
2. Generate and execute the appropriate API call.
3. Return the API's response.

---

## ✨ Examples

### Fetch Data
```python
response = api_agent.run("Get a list of cat facts from https://catfact.ninja/fact")
print(response)
```

### Post Data
```python
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:
```python
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:
```env
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
```bash
git clone https://github.com/The-Swarm-Corporation/fluidapi.git
cd fluidapi
```

### Install Dependencies
```bash
pip install -r requirements.txt
```

---

## πŸ’‘ How It Works

FluidAPI leverages the **Swarms Framework** to:
1. Parse natural language instructions.
2. Dynamically construct API requests.
3. Execute requests and handle responses intelligently.

Learn more about the Swarms Framework [here](https://github.com/kyegomez/swarms).

---

# Todo
- [ ] Add documentation
- [ ] Add tests
- [ ] Add examples

----

## 🀝 Contributing

We welcome contributions! To get started:
1. Fork the repository.
2. Create a new branch.
3. Submit a pull request.

---

## πŸ“ License

FluidAPI is licensed under the MIT License. See the [LICENSE](https://github.com/The-Swarm-Corporation/fluidapi/blob/main/LICENSE) file for details.

---

## 🌍 Connect with Us

- **Author**: [Kye Gomez](https://github.com/kyegomez)
- **Project**: [The-Swarm-Corporation/FluidAPI](https://github.com/The-Swarm-Corporation/fluidapi)
- **Pip Package**: [fluid-api](https://pypi.org/project/fluid-api/)

---

**Transform the way you interact with APIs. With FluidAPI, it's as simple as saying what you want.**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/The-Swarm-Corporation/FluidAPI",
    "name": "fluid-api-agent",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "artificial intelligence, deep learning, optimizers, Prompt Engineering",
    "author": "Kye Gomez",
    "author_email": "kye@apac.ai",
    "download_url": "https://files.pythonhosted.org/packages/89/ce/ec3a1523f5787e7e08a3f567fbd1b8b27d3ffc0fdf9398513b2bfde5d5a1/fluid_api_agent-0.0.1.tar.gz",
    "platform": null,
    "description": "# FluidAPI: Natural Language API Requests\n\n[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)\n\nWelcome to **FluidAPI**, a revolutionary framework that allows you to interact with APIs using **natural language**. No more JSON, headers, or complex formats\u2014simply describe your request in plain English, and FluidAPI will do the rest.\n\nPowered by the **Swarms Framework** and created by [Kye Gomez](https://github.com/kyegomez), FluidAPI redefines how developers interact with APIs.\n\n---\n\n## \ud83c\udf1f Features\n\n- **Natural Language API Requests**: Just describe your task, and FluidAPI generates and executes the request for you.\n- **Powered by AI Agents**: Built on the robust [Swarms Framework](https://github.com/kyegomez/swarms), enabling dynamic and intelligent API handling.\n- **Effortless Integration**: Replace complex API workflows with simple, human-friendly commands.\n- **Retry and Reliability**: Automatic retries and error handling for seamless performance.\n- **Dynamic Authentication**: Handles token management and injects them automatically.\n\n---\n\n## \ud83d\ude80 Installation\n\nInstall the `fluid-api` package via pip:\n\n```bash\npip install fluid-api\n```\n\n---\n\n## \ud83d\udd27 Getting Started\n\n### 1. Import and Initialize FluidAPI\n```python\nfrom fluid_api.main import fluid_api_request, batch_fluid_api_request\n```\n\n### 2. Make a Natural Language Request\nSimply describe your request in natural language:\n\n```python\nfrom fluid_api.main import fluid_api_request, batch_fluid_api_request\n\nprint(fluid_api_request(\"Generate an API request to get a random cat fact from https://catfact.ninja/fact\"))\n\nprint(batch_fluid_api_request([\n    \"Generate an API request to get a random cat fact from https://catfact.ninja/fact\",\n    \"Generate an API request to get a random dog fact from https://dogapi.dog/api/v2/facts\", \n    \"Generate an API request to get a random joke from https://official-joke-api.appspot.com/random_joke\"\n]))\n\n```\n\nFluidAPI will:\n1. Interpret your request.\n2. Generate and execute the appropriate API call.\n3. Return the API's response.\n\n---\n\n## \u2728 Examples\n\n### Fetch Data\n```python\nresponse = api_agent.run(\"Get a list of cat facts from https://catfact.ninja/fact\")\nprint(response)\n```\n\n### Post Data\n```python\nresponse = api_agent.run(\"Send a POST request to https://api.example.com/users with name='John Doe' and email='john.doe@example.com'\")\nprint(response)\n```\n\n### Authentication\nFluidAPI automatically handles token management. For APIs requiring authentication, simply include it in your description:\n```python\nresponse = api_agent.run(\"Retrieve my GitHub repositories from https://api.github.com/user/repos using my GitHub token\")\nprint(response)\n```\n\n---\n\n## \u2699\ufe0f Configuration\n\n### Environment Variables\nFluidAPI uses environment variables for sensitive data:\n- `OPENAI_API_KEY`: Your OpenAI API key.\n\nSet these variables in your `.env` file:\n```env\nOPENAI_API_KEY=your-openai-api-key\nWORKSPACE_DIR=\"agent_workspace\"\n\n```\n\n---\n\n## \ud83d\udce6 Advanced Features\n\n### Retry Logic\nFluidAPI includes built-in retry logic to handle transient failures automatically. You can configure retry settings directly in the agent.\n\n### Caching\nFrequent requests are optimized with caching to improve performance.\n\n---\n\n## \ud83d\udee0 Development\n\n### Clone the Repository\n```bash\ngit clone https://github.com/The-Swarm-Corporation/fluidapi.git\ncd fluidapi\n```\n\n### Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n---\n\n## \ud83d\udca1 How It Works\n\nFluidAPI leverages the **Swarms Framework** to:\n1. Parse natural language instructions.\n2. Dynamically construct API requests.\n3. Execute requests and handle responses intelligently.\n\nLearn more about the Swarms Framework [here](https://github.com/kyegomez/swarms).\n\n---\n\n# Todo\n- [ ] Add documentation\n- [ ] Add tests\n- [ ] Add examples\n\n----\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! To get started:\n1. Fork the repository.\n2. Create a new branch.\n3. Submit a pull request.\n\n---\n\n## \ud83d\udcdd License\n\nFluidAPI is licensed under the MIT License. See the [LICENSE](https://github.com/The-Swarm-Corporation/fluidapi/blob/main/LICENSE) file for details.\n\n---\n\n## \ud83c\udf0d Connect with Us\n\n- **Author**: [Kye Gomez](https://github.com/kyegomez)\n- **Project**: [The-Swarm-Corporation/FluidAPI](https://github.com/The-Swarm-Corporation/fluidapi)\n- **Pip Package**: [fluid-api](https://pypi.org/project/fluid-api/)\n\n---\n\n**Transform the way you interact with APIs. With FluidAPI, it's as simple as saying what you want.**\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fluid API",
    "version": "0.0.1",
    "project_urls": {
        "Documentation": "https://github.com/The-Swarm-Corporation/FluidAPI",
        "Homepage": "https://github.com/The-Swarm-Corporation/FluidAPI",
        "Repository": "https://github.com/The-Swarm-Corporation/FluidAPI"
    },
    "split_keywords": [
        "artificial intelligence",
        " deep learning",
        " optimizers",
        " prompt engineering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e79ab9ae032fc6bba67afa0802cb7a7beb47c8e946367b634753caea54c26ca",
                "md5": "45b5da354f93b2780d3cbf72442054ae",
                "sha256": "65fdd439898ba20f99432eca981adea832064152a023ca2a20dff43a3eb43631"
            },
            "downloads": -1,
            "filename": "fluid_api_agent-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45b5da354f93b2780d3cbf72442054ae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 7200,
            "upload_time": "2024-11-20T21:55:18",
            "upload_time_iso_8601": "2024-11-20T21:55:18.710443Z",
            "url": "https://files.pythonhosted.org/packages/4e/79/ab9ae032fc6bba67afa0802cb7a7beb47c8e946367b634753caea54c26ca/fluid_api_agent-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89ceec3a1523f5787e7e08a3f567fbd1b8b27d3ffc0fdf9398513b2bfde5d5a1",
                "md5": "1f1c096583c16bcf5b260ebb2e692651",
                "sha256": "6d68efb77572501e77741e6a8859ba5a0a04f817062d2d288bd3c764bbf577c3"
            },
            "downloads": -1,
            "filename": "fluid_api_agent-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1f1c096583c16bcf5b260ebb2e692651",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 6842,
            "upload_time": "2024-11-20T21:55:20",
            "upload_time_iso_8601": "2024-11-20T21:55:20.456361Z",
            "url": "https://files.pythonhosted.org/packages/89/ce/ec3a1523f5787e7e08a3f567fbd1b8b27d3ffc0fdf9398513b2bfde5d5a1/fluid_api_agent-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 21:55:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "The-Swarm-Corporation",
    "github_project": "FluidAPI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "fluid-api-agent"
}
        
Elapsed time: 0.47761s