Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpx 0.28.0 removed proxies in httpx.Client, result in error #1915

Closed
1 task done
fefe982 opened this issue Dec 2, 2024 · 2 comments
Closed
1 task done

httpx 0.28.0 removed proxies in httpx.Client, result in error #1915

fefe982 opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@fefe982
Copy link

fefe982 commented Dec 2, 2024

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

httpx 0.28.0 removed proxies in httpx.Client, result in error:

  File ".../test.py", line 3, in <module>
    client = OpenAI(
        api_key="API_KEY",
        base_url="https://some_url/v1",
    )
  File ".../lib/python3.13/site-packages/openai/_client.py", line 123, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        version=__version__,
        ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        _strict_response_validation=_strict_response_validation,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File ".../lib/python3.13/site-packages/openai/_base_client.py", line 857, in __init__
    self._client = http_client or SyncHttpxClientWrapper(
                                  ~~~~~~~~~~~~~~~~~~~~~~^
        base_url=base_url,
        ^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        follow_redirects=True,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File ".../lib/python3.13/site-packages/openai/_base_client.py", line 755, in __init__
    super().__init__(**kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: Client.__init__() got an unexpected keyword argument 'proxies'

To Reproduce

With a python file with the following content can reproduce the error:

from openai import OpenAI

client = OpenAI(
    api_key="API_KEY",
    base_url="https://some_url/v1",
)

Output of pip freeze: (note httpx is 0.28.0)

annotated-types==0.7.0
anyio==4.6.2.post1
blinker==1.9.0
build==1.2.2.post1
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
cryptography==43.0.3
distro==1.9.0
Flask==3.1.0
h11==0.14.0
httpcore==1.0.7
httpx==0.28.0
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.4
jiter==0.8.0
MarkupSafe==3.0.2
openai==1.54.4
packaging==24.2
pip-tools==7.4.1
pycparser==2.22
pydantic==2.10.2
pydantic_core==2.27.1
pyproject_hooks==1.2.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
requests==2.32.3
setuptools==75.1.0
six==1.16.0
sniffio==1.3.1
tqdm==4.67.1
typing_extensions==4.12.2
urllib3==2.2.3
volcengine-python-sdk==1.0.109
Werkzeug==3.1.3
wheel==0.44.0

Code snippets

No response

OS

Linux Ubuntu 22.04.3 LTS

Python version

Python 3.13.0

Library version

openai==1.54.4

@fefe982 fefe982 added the bug Something isn't working label Dec 2, 2024
@fefe982
Copy link
Author

fefe982 commented Dec 2, 2024

I just found it is already fixed with the most recent openai package.
Sorry for the trouble.

@fefe982 fefe982 closed this as completed Dec 2, 2024
@dgellow
Copy link
Contributor

dgellow commented Dec 2, 2024

All good, thanks for the report :)

For anyone who would find this GitHub issue and are looking for the context/solution:

dagardner-nv added a commit to dagardner-nv/Morpheus that referenced this issue Dec 14, 2024
Templatize langchain versions
Add dependency to langchain-openai, as openai is being removed from langchain-community
rapids-bot bot pushed a commit to nv-morpheus/Morpheus that referenced this issue Dec 16, 2024
* Work-around known openai incompatibility with httpx v0.28 (openai/openai-python#1915)
* Templatize the llm pip dependencies
* Replace deprecated imports of openai from langchain and langchain_community 

Closes #2084 

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

URL: #2083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants