https://github.com/poteat/gpt3-cli
Typescript CLI and API to OpenAI's state-of-the-art machine learning platform.
https://github.com/poteat/gpt3-cli
Last synced: about 1 year ago
JSON representation
Typescript CLI and API to OpenAI's state-of-the-art machine learning platform.
- Host: GitHub
- URL: https://github.com/poteat/gpt3-cli
- Owner: poteat
- Created: 2020-07-14T00:18:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-26T02:57:51.000Z (over 5 years ago)
- Last Synced: 2024-10-30T08:52:45.804Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 64
- Watchers: 5
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-github-projects - gpt3-cli - Typescript CLI and API to OpenAI's state-of-the-art machine learning platform. ⭐63 `TypeScript` (📦 Legacy & Inactive Projects)
README
# GPT3 CLI API
A simple NodeJS wrapper library and CLI to interface with OpenAI's Beta API. Written in Typescript.
## Requirements
When using the CLI, the API key and secret key must be defined in your environment under `OPENAI_KEY` and `OPENAI_SECRET_KEY` respectively.
When using this package as a library, you may either provide the keys in the environment as above, or provide them as a final `auth` parameter.
## Installation
If CLI:
```sh
npm i -g gpt3
```
If programmatic:
```
npm i gpt3
```
## CLI Usage
You pass in the starter text as the first parameter, and the tool returns the completion.
```
> gpt3 "Once upon a time, there was a thing..."
"Once upon a time, there was a thing that did this, etc, foobar."
```
## Programmatic Usage
```ts
import { getCompletion } from "gpt3";
const result = await getCompletion("Once upon a time, ");
// etc.
```
## Limitations and Future Work
Features not supported, but which I eventually plan to:
* Streaming
* Simple filtering, optional clean-up logic
* Automatic truth checking
* Search API
* Fine-tuning API (Once it comes out)
* Pre-selected prompt generation logic