summaryrefslogtreecommitdiffstats
path: root/g4f/cli.py
diff options
context:
space:
mode:
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,