diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-29 20:21:47 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-29 20:21:47 +0200 |
commit | ff8c1fc140d78b2b5cfd4338d91e88d3323e185e (patch) | |
tree | 36b9fd4c06ce84a1df6981ce5ec20cf1f368a0e3 /g4f/cli.py | |
parent | Fix workers argument in api (diff) | |
download | gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar.gz gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar.bz2 gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar.lz gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar.xz gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.tar.zst gpt4free-ff8c1fc140d78b2b5cfd4338d91e88d3323e185e.zip |
Diffstat (limited to 'g4f/cli.py')
-rw-r--r-- | g4f/cli.py | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -4,8 +4,6 @@ import argparse from g4f import Provider from g4f.gui.run import gui_parser, run_gui_args -from g4f.cookies import read_cookie_files -from g4f import debug def main(): parser = argparse.ArgumentParser(description="Run gpt4free") @@ -31,18 +29,18 @@ def main(): exit(1) def run_api_args(args): - if args.debug: - debug.logging = True - if not args.ignore_cookie_files: - read_cookie_files() - import g4f.api - g4f.api.set_list_ignored_providers( + from g4f.api import AppConfig, run_api + + AppConfig.set_ignore_cookie_files( + args.ignore_cookie_files + ) + AppConfig.set_list_ignored_providers( args.ignored_providers ) - g4f.api.set_g4f_api_key( + AppConfig.set_g4f_api_key( args.g4f_api_key ) - g4f.api.run_api( + run_api( bind=args.bind, debug=args.debug, workers=args.workers, |