To use this script, you need to install the openai
package using pip. You also need to set the OPENAI_API_KEY
environment variable to your OpenAI API key.
For example, to ask a natural language question, you can pipe the output of ls -al
to the script like this:
ls -al | ./gpt "What are the permissions of the files?"
The script will use the OpenAI GPT-3 model to generate a response to your question with a temperature of 0.2. The response will be printed to the console.
The above text is generated with the following prompt:
cat gpt | gpt "write a basic usage example for this script. the filename of the script is 'gpt'. explain the dep (pip install) and env variable is needed. explain how it can be used it with a meaningful example on asking it a natural language question by piping the output of ls -al to it. be concise"