No project description provided
Project description
API Assistant
The API assistant is a ChatGPT assistant on top of an OpenAI IDL json file. The CLI will based on prompts find the correct request and send it with the provided arguments.
You can run the CLI from your terminal with
api-chat --idl=<OPENAI_IDL_PATH>
Installation
The tool is available at pypi and can be installed using pip
pip install api-assistant
Extra - convert a swagger to OpenAI IDL
If you have generated a swagger (OpenAPI) for you API then you can use the s2o (swagger to openai) tool to convert it to a OpenAI IDL format. The tool can be installed with the cargo CLI that follows the rust installation.
If you have cargo installed then you can install it with
cargo install s2o
In order to interact with the cli there are some environment variables that needs to be present.
Environment variables - REQUIRED
- OPENAI_API_KEY: An OpenAI api key
- HOST: The host of the API that you wish to query. Ex: http://localhost:8000
- ASSISTANT_INSTRUCTIONS: A description (prompt) to the assistant of its purpose. Ex: For a payments api a typical instruction could be "ou are a wrapper around a payments api. Use the provided endpoints to answer user questions. Sometimes functions has to be combined to achieve the intended result."
CLI Arguments
There is only one argument to the CLI itself
- idl: The path to the OpenAI IDL json. Ex:
api-chat --idl=./idls/openai.idl
.
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
Built Distribution
File details
Details for the file api_assistant-0.4.0.tar.gz
.
File metadata
- Download URL: api_assistant-0.4.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ee71312fa16dd0dec39ebf6924261870579a646c06df2c7975174dac4e9d3b |
|
MD5 | c3feba3d48ef4235cc3df70f8b9c953f |
|
BLAKE2b-256 | f1c11192979b8bf2736b188c9c793614333b243e9299e3a0edaad81deb0d8c69 |
File details
Details for the file api_assistant-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: api_assistant-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 284.8 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a80c0c964e7e69360c45889dabe18545fc326123d5863ac718d0f1c83eee02c |
|
MD5 | 42cee6fcaf479643ac3443b4f1cd68a3 |
|
BLAKE2b-256 | 79ddb999651762239579f6d777a511dec29d90983514f2dac9e7f11303fe0335 |