Skip to content

MacOS issue: TypeError: Client.__init__() got an unexpected keyword argument 'proxies' #101

@ldelossa

Description

@ldelossa
Traceback (most recent call last):
  File "/opt/homebrew/bin/chatblade", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/__main__.py", line 5, in main
    cli.cli()
    ~~~~~~~^^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/cli.py", line 156, in cli
    handle_input(query, params)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/cli.py", line 81, in handle_input
    messages = fetch_and_cache(messages, params)
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/cli.py", line 14, in fetch_and_cache
    result = chat.query_chat_gpt(messages, params)
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/chat.py", line 126, in query_chat_gpt
    client = build_client(config)
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/chatblade/chat.py", line 119, in build_client
    return openai.OpenAI(
           ~~~~~~~~~~~~~^
        api_key=config["openai_api_key"], base_url=config["openai_base_url"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/openai/_client.py", line 122, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        version=__version__,
        ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        _strict_response_validation=_strict_response_validation,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/openai/_base_client.py", line 846, in __init__
    self._client = http_client or SyncHttpxClientWrapper(
                                  ~~~~~~~~~~~~~~~~~~~~~~^
        base_url=base_url,
        ^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        follow_redirects=True,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/homebrew/Cellar/chatblade/0.7.0_1/libexec/lib/python3.13/site-packages/openai/_base_client.py", line 744, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: Client.__init__() got an unexpected keyword argument 'proxies'

This appears to be an issue with the openai client. There's some details here: https://community.openai.com/t/error-with-openai-1-56-0-client-init-got-an-unexpected-keyword-argument-proxies/1040332/32

However, I am not sure if I need to upgrade or downgrade the openai pip package. If I upgrade, Chatblade tries to install Version: 1.35.15

The odd part is, I don't think I did much to change my system lately. Just a brew upgrade, but I install chatblade via pip3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions