-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Fix for http client #2579
Fix for http client #2579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Given @Gr3atWh173 's comment: #2412 (comment)
I think instead of checking for http_client
key, we should try and raise the error but append a more meaningful error message saying please implement the value class with __deepcopy__
method to support deepcopy.
@microsoft-github-policy-service agree |
@ekzhu agreed - I've added the necessary changes and updated the docs. Please review |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2579 +/- ##
==========================================
- Coverage 33.33% 25.06% -8.27%
==========================================
Files 83 85 +2
Lines 8636 9011 +375
Branches 1835 2069 +234
==========================================
- Hits 2879 2259 -620
- Misses 5516 6491 +975
- Partials 241 261 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* Fix for http client * fixed constructor to only ignore the http_client while copying * fixed comment formating * removed check for http_client and added error message with docs * fix formatting * fix formatting * added test for http-fix * changed title and content of docs * changed test func name
Why are these changes needed?
When you add the parameter
http_client
(which is typically an instance ofhttpx.Client
orhttpx.AsyncClient
) to llm_config, the methodcopy.deepcopy
throws an error as it won't be able to pickle the client object. This is a fix to skip the copying if an http_client parameter is passed.Code to reproduce:
Related issue number
#2412
Checks