flying-delta-tools-openapi


Nameflying-delta-tools-openapi JSON
Version 0.1.0 PyPI version JSON
download
home_page
Summaryllama-index tools openapi integration
upload_time2024-01-28 19:21:09
maintainer
docs_urlNone
authorYour Name
requires_python>=3.8.1,<3.12
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenAPI Tool

This tool loads an OpenAPI spec and allow the Agent to retrieve endpoints and details about endpoints. The RequestsToolSpec can also be laoded into the agent to allow the agent to hit the nessecary endpoints with a REST request.

## Usage

This tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/emptycrown/llama-hub/tree/main/llama_hub/tools/notebooks/openapi_and_requests.ipynb)

Here's an example usage of the OpenAPIToolSpec.

```python
from llama_hub.tools.openapi import OpenAPIToolSpec
from llama_index.agent import OpenAIAgent

f = requests.get(
    "https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml"
).text
open_api_spec = yaml.safe_load(f)
# OR
open_spec = OpenAPIToolSpec(
    url="https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml"
)


tool_spec = OpenAPIToolSpec(open_api_spec)

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat("What is the base url for the API")
agent.chat("What parameters does the x endpoint need?")
```

`load_openapi_spec`: Returns the parsed OpenAPI spec that the class was initialized with

This loader is designed to be used as a way to load data as a Tool in a Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "flying-delta-tools-openapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/28/4c/9465fb3eef1d1757b9ee1ec451168c25a6c08854f67d751fae97a5aa06bd/flying_delta_tools_openapi-0.1.0.tar.gz",
    "platform": null,
    "description": "# OpenAPI Tool\n\nThis tool loads an OpenAPI spec and allow the Agent to retrieve endpoints and details about endpoints. The RequestsToolSpec can also be laoded into the agent to allow the agent to hit the nessecary endpoints with a REST request.\n\n## Usage\n\nThis tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/emptycrown/llama-hub/tree/main/llama_hub/tools/notebooks/openapi_and_requests.ipynb)\n\nHere's an example usage of the OpenAPIToolSpec.\n\n```python\nfrom llama_hub.tools.openapi import OpenAPIToolSpec\nfrom llama_index.agent import OpenAIAgent\n\nf = requests.get(\n    \"https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml\"\n).text\nopen_api_spec = yaml.safe_load(f)\n# OR\nopen_spec = OpenAPIToolSpec(\n    url=\"https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/openapi.yaml\"\n)\n\n\ntool_spec = OpenAPIToolSpec(open_api_spec)\n\nagent = OpenAIAgent.from_tools(tool_spec.to_tool_list())\n\nagent.chat(\"What is the base url for the API\")\nagent.chat(\"What parameters does the x endpoint need?\")\n```\n\n`load_openapi_spec`: Returns the parsed OpenAPI spec that the class was initialized with\n\nThis loader is designed to be used as a way to load data as a Tool in a Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index tools openapi integration",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "293ef057ecac50542e1416500d868291cce974a2e2a4d2939c0fa51444468fd2",
                "md5": "aa0268dcbade21d158fb67c3b271654c",
                "sha256": "839b1633a40c397e6b9ca819a6fc91ec7ed1d54403c0e15b691ee4617be57f2a"
            },
            "downloads": -1,
            "filename": "flying_delta_tools_openapi-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aa0268dcbade21d158fb67c3b271654c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<3.12",
            "size": 3594,
            "upload_time": "2024-01-28T19:21:08",
            "upload_time_iso_8601": "2024-01-28T19:21:08.051224Z",
            "url": "https://files.pythonhosted.org/packages/29/3e/f057ecac50542e1416500d868291cce974a2e2a4d2939c0fa51444468fd2/flying_delta_tools_openapi-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "284c9465fb3eef1d1757b9ee1ec451168c25a6c08854f67d751fae97a5aa06bd",
                "md5": "4a97a4c5a52c7f28f8d9527d99eb2fc3",
                "sha256": "b9965183d54bc789ecbdabef47246734622e48fc5eca956aba00b2f6c1e00b24"
            },
            "downloads": -1,
            "filename": "flying_delta_tools_openapi-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4a97a4c5a52c7f28f8d9527d99eb2fc3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<3.12",
            "size": 3352,
            "upload_time": "2024-01-28T19:21:09",
            "upload_time_iso_8601": "2024-01-28T19:21:09.842930Z",
            "url": "https://files.pythonhosted.org/packages/28/4c/9465fb3eef1d1757b9ee1ec451168c25a6c08854f67d751fae97a5aa06bd/flying_delta_tools_openapi-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-28 19:21:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "flying-delta-tools-openapi"
}
        
Elapsed time: 0.20403s