ask
is a little CLI I made to interact with OpenAI's GPT-3 (text-davinci-002
) from my shell/terminal. The instruction fine-tuning on that model makes it particularly ideal for just asking questions and making requests.
With this CLI, I can do something like:
$ ask 'Write a haskell function that reverses a string'
reverseString :: String -> String
reverseString = foldl (\acc x -> x : acc) []
I can also pipe input into ask
:
$ echo 'Write a haskell function that reverses a string' | ask --stdin
reverseString :: String -> String
reverseString = foldl (\acc x -> x : acc) []
There's a small set of flags I can use to control the model's output sampling quickly:
$ ask --help
Ask: ask OpenAI GPT-3
Usage
ask [prompt] [options]
your-program | ask --stdin [options]
CLI options
--[h]elp Show this help message
--[v]ersion Print version information and exit
Text generation options
--[n] Number of completions to generate
--[t]emperature Temperature for output sampling, default 1.0
--top-p top_p value for nucleus sampling, default 0.9
--max Max number of tokens to generate, default 256