-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Added http_client option to the BaseOpenAIClientConfiguration class #5811
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
Conversation
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.
python/packages/autogen-ext/src/autogen_ext/models/openai/config/__init__.py
Outdated
Show resolved
Hide resolved
To support SSL verification option in model_client intiation.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5811 +/- ##
==========================================
- Coverage 77.25% 77.25% -0.01%
==========================================
Files 200 200
Lines 14256 14262 +6
==========================================
+ Hits 11014 11018 +4
- Misses 3242 3244 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@avinashmihani actually I just realized the 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. |
The problem though is that |
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 |
@jackgerrits @avinashmihani Question: can we not just forward all parameters that matches the constructor argument list of |
@avinashmihani if you agree to my changes please go ahead and respond to the CLA |
hi @avinashmihani and @ekzhu , I follow the #5795 here. So I'm following your hint to instantiate an AsyncOpenAI, and pass it to instantiate OpenAIChatCompletion, the codes as here: async_client = AsyncOpenAI( model_client = OpenAIChatCompletionClient( but the same connection error happened, though I thought this should have worked. Could you please give me a clue on how to fix this? |
I am checking with my employer on this. Please allow some time. |
Hi @zijianding, below is how I am using it.
I updated my autogen package by adding http_client option to the BaseOpenAIClientConfiguration class. Hope that works for you. |
Thanks @avinashmihani , I read the codes and found a simple way when instantiate the chat complete client by directly passing the http_client parameter. I guess there is no need to expose this specific parameter, also thanks for @ekzhu |
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