Skip to content

Fix OpenAI client compatibility by pinning httpx version#5

Open
grzegorz-aniol wants to merge 1 commit intotomasonjo:mainfrom
grzegorz-aniol:fix/httpx-openai-compatibility
Open

Fix OpenAI client compatibility by pinning httpx version#5
grzegorz-aniol wants to merge 1 commit intotomasonjo:mainfrom
grzegorz-aniol:fix/httpx-openai-compatibility

Conversation

@grzegorz-aniol
Copy link

Problem

The current setup was causing a TypeError when importing the OpenAI client:

TypeError: Client.__init__() got an unexpected keyword argument 'proxies'

This error occurs because OpenAI 1.10.0 has a compatibility issue with newer versions of httpx (specifically 0.28.1), where the OpenAI client tries to pass a proxies argument that the newer httpx version doesn't support.

Solution

  • Added httpx==0.27.2 to notebooks/requirements.txt
  • This version of httpx is compatible with OpenAI 1.10.0
  • Prevents the TypeError from occurring during imports

Testing

  • ✅ Import statements now work without errors
  • ✅ OpenAI client initializes successfully
  • ✅ Notebook can be executed without dependency issues

Files Changed

  • notebooks/requirements.txt: Added httpx version constraint

This is a minimal fix that ensures compatibility between the OpenAI and httpx packages without breaking any existing functionality.

- Add httpx==0.27.2 to requirements.txt to resolve TypeError
- OpenAI 1.10.0 has incompatibility with newer httpx versions
- Prevents 'Client.__init__() got an unexpected keyword argument proxies' error
@manbradcalf
Copy link

I can confirm, this worked for me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants