All OK (aok) is a simple script to run the OpenAI API CHAT completions command. It can be used to generate text completions from a given input text. It takes user input via command line or STDIN and generates AI response with GPT-3 API. The chatbot keeps a history of 4 messages and can generate creative or definite answers based on user input.
All OK (aok) requires Python 3 and pip3 to be installed.
Run the following command to install the OpenAI CLI:
pip install --upgrade openai
Get your API Key from OpenAI and OPENAI_API_KEY
in your environment variables:
export OPENAI_API_KEY="xxx"
All OK (aok) can be used in three different ways:
- CHAT mode:
$ aok chat
- With an input text string:
$ aok "And the input text string like this"
- With an input text file:
$ echo "And the input text string like this" | aok
$ cat input.txt | aok
The application is using OpenAI Chat completion API with gpt-3.5-turbo
engine.
The System Prompt is designed to be sensitive to specific keywards in the user input and produce conscise yet different responses. The following keywords are used to generate different responses:
Command for
,Command to
andHow to
are used to generate a command code example and explanation.What is
andExplain
are used to generate a definition and explanation.Code example
andSample code
are used to generate a code example in specified lanaguage and explanation.Steps
orstep by step
are used to generate a numbered list of step by step guide.Summary
orSummarize
are used to generate a summary of the input text or code.- If there is no specific instruction in input, it will summarize the input text or code.
Add the following line to your .bashrc or .zshrc file to add an alias for aok:
alias "??"='path/to/aok.sh'
All OK (aok) is licensed under the MIT License.