INNER CODE UNIT · Python
cli
adamyodinsky/TerminalGPT · terminalgpt/main.py:50
def cli(ctx, model, style: str, token_limit: int = 0):
"""*~ TerminalGPT - Your Personal Terminal Assistant ~*"""
max_token_limit = (
config.get_default_config().get("models", config.MODELS).get(model)
)
printer: Printer = PrinterFactory.get_printer("plain")
if token_limit == 0:
token_limit = max_token_limit
elif token_limit > max_token_limit:
printer.printt(
Style.BRIGHT
+ Fore.RED
+ "\nWarning: The token limit you set is exceeding the maximum token limit for the chosen model!"
)
printer.printt(
f"Model: {model} "