summaryrefslogtreecommitdiffstats
path: root/g4f/cli.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-29 16:56:56 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-29 16:56:56 +0200
commit26d5fcd216a6832614a5750257ac8f4bb8dfa6b2 (patch)
treea189ec4c4d6bff49bd6bc924fc0d99b4469efe7e /g4f/cli.py
parentUpdate README.md (diff)
downloadgpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar.gz
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar.bz2
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar.lz
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar.xz
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.tar.zst
gpt4free-26d5fcd216a6832614a5750257ac8f4bb8dfa6b2.zip
Diffstat (limited to '')
-rw-r--r--g4f/cli.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/g4f/cli.py b/g4f/cli.py
index 9037a6f1..38bc9cc1 100644
--- a/g4f/cli.py
+++ b/g4f/cli.py
@@ -16,9 +16,9 @@ def main():
api_parser.add_argument("--workers", type=int, default=None, help="Number of workers.")
api_parser.add_argument("--disable-colors", action="store_true", help="Don't use colors.")
api_parser.add_argument("--ignore-cookie-files", action="store_true", help="Don't read .har and cookie files.")
- api_parser.add_argument("--g4f-api-key", type=str, default=None, help="Sets an authentication key for your API.")
- api_parser.add_argument("--ignored-providers", nargs="+", choices=[provider for provider in Provider.__map__],
- default=[], help="List of providers to ignore when processing request.")
+ api_parser.add_argument("--g4f-api-key", type=str, default=None, help="Sets an authentication key for your API. (incompatible with --debug and --workers)")
+ api_parser.add_argument("--ignored-providers", nargs="+", choices=[provider.__name__ for provider in Provider.__providers__ if provider.working],
+ default=[], help="List of providers to ignore when processing request. (incompatible with --debug and --workers)")
subparsers.add_parser("gui", parents=[gui_parser()], add_help=False)
args = parser.parse_args()
@@ -39,11 +39,13 @@ def run_api_args(args):
g4f.api.set_list_ignored_providers(
args.ignored_providers
)
+ g4f.api.set_g4f_api_key(
+ args.g4f_api_key
+ )
g4f.api.run_api(
bind=args.bind,
debug=args.debug,
workers=args.workers,
- g4f_api_key=args.g4f_api_key,
use_colors=not args.disable_colors
)