summaryrefslogtreecommitdiffstats
path: root/g4f/cli.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-29 20:21:47 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-29 20:21:47 +0200
commitff8c1fc140d78b2b5cfd4338d91e88d3323e185e (patch)
tree36b9fd4c06ce84a1df6981ce5ec20cf1f368a0e3 /g4f/cli.py
parentFix workers argument in api (diff)
downloadgpt4free-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.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/g4f/cli.py b/g4f/cli.py
index 38bc9cc1..fe219b38 100644
--- a/g4f/cli.py
+++ b/g4f/cli.py
@@ -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,