Skip to content

fgarnadi/chatgpt-fish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

chatgpt-fish

Simple wrapper for ChatGPT in Fish.

Installation

Install with Fisher:

fisher install fgarnadi/chatgpt-fish

Prerequisite

Install jq.

brew install jq

Set your OpenAI private key as environment variable.

set -x OPENAI_API_KEY "<your-openai-key>"

Usage

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
    }
  ]
}

License

MIT

About

Wrapper for ChatGPT in Fish.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages