Simple wrapper for ChatGPT in Fish.
Install with Fisher:
fisher install fgarnadi/chatgpt-fish
Install jq.
brew install jq
Set your OpenAI private key as environment variable.
set -x OPENAI_API_KEY "<your-openai-key>"
Ask you inquiry directly as parameter.
> gpt "what is the biggest fish"
The biggest fish is the whale shark, which can grow up to 40 feet (12 meters) long and weigh up to 21 tons (42,000 pounds).
For debugging purpose, use rgpt
for raw result.
> rgpt "what is the biggest fish"
{
"id": "chat-id",
"object": "chat.completion",
"created": timestamp,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 35,
"total_tokens": 47
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\nThe biggest fish is the whale shark, which can grow up to 40 feet (12 meters) long and weigh up to 21 tons (42,000 pounds)."
},
"finish_reason": "stop",
"index": 0
}
]
}