Skip to content

Commit

Permalink
use pprint and valid all models
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Nov 15, 2023
1 parent 237b9de commit 62e2f9a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions askchat/askchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import asyncio
from argparse import ArgumentParser
import askchat
from pprint import pprint
VERSION = askchat.__version__

# print the response in a typewriter way
Expand Down Expand Up @@ -34,7 +35,8 @@ def main():
parser.add_argument('message', help='User message', default='', nargs='*')
parser.add_argument('-v', '--version', action='version', version=VERSION)
parser.add_argument('--debug', action='store_true', help='Print debug log')
parser.add_argument('--valid-models', action='store_true', help='Print valid models')
parser.add_argument('--valid-models', action='store_true', help='Print valid models that contain "gpt" in their names')
parser.add_argument('--all-valid-models', action='store_true', help='Print all valid models')
parser.add_argument('-m', '--model', default=None, help='Model name')
args = parser.parse_args()
# show debug log
Expand All @@ -43,8 +45,12 @@ def main():
return
# show valid models
if args.valid_models:
print('Valid models: ')
print(Chat().get_valid_models())
print('Valid models that contain "gpt" in their names:')
pprint(Chat().get_valid_models())
return
if args.all_valid_models:
print('All valid models:')
pprint(Chat().get_valid_models(gpt_only=False))
return
# get message and model
model, msg = args.model, args.message
Expand Down

0 comments on commit 62e2f9a

Please sign in to comment.