This is an AI tool that helps you discover your API documentation. It is based on the GPT-3.5 language model from OpenAI.
You can use this with either directly connecting to a FastApi app or by passing in an openapi.json
file.
Install the dependencies
pip install -r requirements.txt
- Run your backend app
uvicorn main:app --reload
- Run the script
python api_master.py --openai-key <your-openai-key> --target <your-fastapi-app> --base-url <your-base-url>
python api_master.py --openai-key <your-openai-key> --openapi-json <openapi-json> --base-url <your-base-url>
python api_master.py --openai-key=<your-openai-key> --openapi-json=./example/openapi.json --base-url="https://petstore3.swagger.io/api/v3"
Enjoy interacting with your API documentation
This also works with GPT-4. You just need to pass parameter --model-name=gpt-4
while running the script.
This works by creating open api documentation from your fastapi app and then using the GPT-3.5 language model to analyze documentation for your API.
sequenceDiagram
User-->>+Processor: Give me a list of items. I only need 5 of them
Processor-->>+AI: PROMPT: Give me a list of items. I only need 5 of them
AI-->>+Processor: CMD: GET /items?filter=5
Processor-->>+AI: CMD_RESP: [{"name": "cucumber"}, {"name": "celery"}...]
AI-->>+Processor: OUT: Items are cucumber, celery...
Processor-->>+User: Items are cucumber, celery...
This also supports react. More detail can be found at: https://arxiv.org/abs/2210.03629
- Token size