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

Added http_client option to the BaseOpenAIClientConfiguration class #5811

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

avinashmihani
Copy link

@avinashmihani avinashmihani commented Mar 4, 2025

Added http_client option to the BaseOpenAIClientConfiguration class, to support SSL verification option in model_client intiation.

Why are these changes needed?

In v0.2.x the agents to interact with LLM, was expecting LLM_CONFIG, which had an option to skip the SSL verification. Now in v0.4.x, the model client initiation does not have an option for skipping verification.
With this change, v0.4 as well will allow http_client option in model_client initiation

Related issue number

Closes #5795

Checks

Added http_client option to the BaseOpenAIClientConfiguration class, to support SSL verification option in model_client intiation.
To support SSL verification option in model_client intiation.
To support SSL verification option in model_client intiation.
@avinashmihani avinashmihani changed the title Update __init__.py Added http_client option to the BaseOpenAIClientConfiguration class Mar 4, 2025
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.58%. Comparing base (97536af) to head (ea79d65).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5811   +/-   ##
=======================================
  Coverage   75.58%   75.58%           
=======================================
  Files         189      189           
  Lines       12669    12671    +2     
=======================================
+ Hits         9576     9578    +2     
  Misses       3093     3093           
Flag Coverage Δ
unittests 75.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ekzhu
Copy link
Collaborator

ekzhu commented Mar 4, 2025

@avinashmihani actually I just realized the http_client should already passed to AsyncOpenAI constructor without this change.

Does this change actually resolves #5795 ?

@avinashmihani
Copy link
Author

avinashmihani commented Mar 4, 2025

@avinashmihani actually I just realized the http_client should already passed to AsyncOpenAI constructor without this change.

Does this change actually resolves #5795 ?

@ekzhu Yes, this change worked. I tested in my local. With this change, I am able to update SSL verification value in v0.4.x.

@ekzhu
Copy link
Collaborator

ekzhu commented Mar 4, 2025

The problem though is that CreateArguments is a typed dictionary so it can only contain typed annotation. So we can't use the httpx.AsyncClient type. Perhaps we use Any here? @jackgerrits what's your thought?

@jackgerrits
Copy link
Member

You can't put anything into that dictionary that is not json serializable so this is not going to work. This is required for the component config feature.

If a python object must be passed it must be done directly via the constructor and so it wont be supported via config. If it is necesasary to support this argument we will need to strip it out of the exported config dictionary in _to_config

@rysweet rysweet added the awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip SSL verification option missing while creating model client in v0.4.x
4 participants