mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-30 04:10:47 +00:00

This PR improves fallback safety when an invalid `model_family` is supplied to `get_transformer()`. Previously, if a user passed an arbitrary or incorrect `family` string in `model_info`, the lookup could fail without falling back to `ModelFamily.UNKNOWN`. Now, we explicitly check whether `model_family` is a valid value in `ModelFamily.ANY`. If not, we fallback to `_find_model_family()` as intended. ## Related issue number Related #6011#issuecomment-2779957730 ## Checks - [ ] 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. - [x] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [x] I've made sure all auto checks have passed. --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>