Skip to content

Instantly share code, notes, and snippets.

View laurentperrinet's full-sized avatar
👁️‍🗨️
Busy coding...

Laurent Perrinet laurentperrinet

👁️‍🗨️
Busy coding...
View GitHub Profile
#!/usr/bin/env python
# https://gist.github.com/laurentperrinet/94fbcc0dab15736cd66c9ffc669b625b
# install the API using `conda install openai` (MMV)
# setup your API key by including `export OPENAI_API_KEY="sk-xxxxxyyyyyyyzzzz"` in your `.zshrc` (MMV)
import argparse
parser = argparse.ArgumentParser(description='A simple CLI for chat-GPT with my prefered settings')
parser.add_argument('prompt', help="A useful prompt.", default='Demonstrate that the earth is flat.', type=str)
parser.add_argument("--max_tokens", help="Set the maximum tokens number", default=1000, type=int)