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
Release history Release notifications | RSS feed
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 s2opy-0.1.0.tar.gz
.
File metadata
- Download URL: s2opy-0.1.0.tar.gz
- Upload date:
- Size: 57.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 318821ce63d295327a6d641d13fbd22c328988616b39f48e5bfb9ea1cf109313 |
|
MD5 | f06b8dc297cac047deba7234b2d8945c |
|
BLAKE2b-256 | 5b1465f5fee38e56c9e3206d8f5a113e2cbd1756c466977541015249059f4acb |
File details
Details for the file s2opy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: s2opy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 269.1 kB
- Tags: CPython 3.12, 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 | 807f82edb334ee998af35a266293a410a1e2a360c4b8d398b457f628f42db62a |
|
MD5 | 81328eba8a8f5393ea5e778ecad2abd7 |
|
BLAKE2b-256 | 17187b230047713aa78301501d586ab0c86d59548141d61d1249319456b77d0f |