bugfix: Workaround for pydantic/#7713#5893
Conversation
Use of `SKChatCompletionAdapter` reliably fails with "'MockValSer' object cannot be converted to 'SchemaSerializer'"; can repro with this example: https://microsoft.github.io/autogen/stable/user-guide/core-user-guide/components/model-clients.html#semantic-kernel-adapter This appears to be related to pydantic/pydantic#7713 - commit uses workaround from pydantic/pydantic#7713 (comment)
|
@microsoft-github-policy-service agree |
|
@nissa-seru , can you also post an error trace demonstrating the issue? If possible, can you share some minimal code to reproduce? I left one comment on the actual change as well |
|
Refer to the initial PR for a link to the example - this causes the issue for me when run in a Jupyter notebook running Python 3.12.8. Apologies for failing to capture the error trace originally - I'm a bit busy with other work right now though to roll back the fix locally and recapture it. |
|
@nissa-seru , I was initially concerned with potential loss of data but had a better look and since this is only for logging I don't think there are major concerns. I suggested a fix on the new function. Also make sure to run |
Co-authored-by: Leonardo Pinheiro <leosantospinheiro@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5893 +/- ##
==========================================
+ Coverage 70.15% 75.56% +5.41%
==========================================
Files 263 191 -72
Lines 15122 13093 -2029
Branches 256 0 -256
==========================================
- Hits 10609 9894 -715
+ Misses 4313 3199 -1114
+ Partials 200 0 -200
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:
|
Use of `SKChatCompletionAdapter` reliably fails with "'MockValSer' object cannot be converted to 'SchemaSerializer'"; can repro with this example: https://microsoft.github.io/autogen/stable/user-guide/core-user-guide/components/model-clients.html#semantic-kernel-adapter This appears to be related to pydantic/pydantic#7713 - commit uses workaround from pydantic/pydantic#7713 (comment) ## Why are these changes needed? This unblocks use of the Semantic Kernel integration by addressing the above-referenced error, enabling the integration to perform as expected. ## Related issue number N/A, see pydantic/pydantic#7713 for context, though. ## Checks - [X] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - None needed, internal only change. - [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR. - None added; this works on my machine, but I'm not clear on the root cause of the issue and have no strong opinion on whether this is the ideal way to fix it long term - simply leaning towards PR`ing a tenative fix instead of raising an issue. - [ ] I've made sure all auto checks have passed. - I am not familiar with these, but assume they will be run during CI. --------- Co-authored-by: Leonardo Pinheiro <leosantospinheiro@gmail.com> Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Use of
SKChatCompletionAdapterreliably fails with "'MockValSer' object cannot be converted to 'SchemaSerializer'"; can repro with this example: https://microsoft.github.io/autogen/stable/user-guide/core-user-guide/components/model-clients.html#semantic-kernel-adapterThis appears to be related to pydantic/pydantic#7713 - commit uses workaround from pydantic/pydantic#7713 (comment)
Why are these changes needed?
This unblocks use of the Semantic Kernel integration by addressing the above-referenced error, enabling the integration to perform as expected.
Related issue number
N/A, see pydantic/pydantic#7713 for context, though.
Checks