{"record":{"id":"6961045757d7b09b","repo":"microsoft/autogen","slug":"no-transformer-found-for-model-family-model-fami","errorCode":null,"errorMessage":"No transformer found for model family '{model_family}'","messagePattern":"No transformer found for model family '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/openai/_transformation/registry.py","lineNumber":128,"sourceCode":"    This is a thin wrapper around `MESSAGE_TRANSFORMERS.get(...)`, but serves as\n    an abstraction layer to allow future enhancements such as:\n\n    - Providing fallback transformers for unknown model families\n    - Injecting mock transformers during testing\n    - Adding logging, metrics, or versioning later\n\n    Keeping this as a function (instead of direct dict access) improves long-term flexibility.\n    \"\"\"\n\n    if model_family not in set(get_args(ModelFamily.ANY)) or model_family == ModelFamily.UNKNOWN:\n        # fallback to finding the best matching model family\n        model_family = _find_model_family(api, model)\n\n    transformer = MESSAGE_TRANSFORMERS.get(api, {}).get(model_family, {})\n\n    if not transformer:\n        # Just in case, we should never reach here\n        raise ValueError(f\"No transformer found for model family '{model_family}'\")\n\n    return transformer\n","sourceCodeStart":110,"sourceCodeEnd":131,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/openai/_transformation/registry.py#L110-L131","documentation":"Thrown by the message-transformation registry when no transformer is registered for the resolved model family. After optionally re-resolving the family from the model name (for unknown/non-enumerated families), the registry looks up MESSAGE_TRANSFORMERS[api][model_family] and, finding nothing, raises as a defensive invariant — under normal operation a default should always exist.","triggerScenarios":"Calling with an api value that has no transformer map for any family, or a ModelFamily value that resolves (or is passed) to a family with no registered transformer for that API. Realistically only reachable if the registry maps are extended/incomplete or an unexpected api string is supplied by custom client code.","commonSituations":"Custom code calling the transformation registry directly with a nonstandard api identifier; version skew where a new ModelFamily member was added to the enum but not to MESSAGE_TRANSFORMERS; monkey-patched or trimmed registries in downstream forks.","solutions":["Upgrade autogen-ext to a version where the model family has a registered transformer","If invoking the registry directly, use the documented api identifiers (e.g. 'chat') and a supported ModelFamily","For custom model families, register a transformer in MESSAGE_TRANSFORMERS or map your model to a supported family via model_info['family']"],"exampleFix":"# before\nmodel_info = {\"family\": \"my-custom-family\", ...}  # no transformer registered\n\n# after\nmodel_info = {\"family\": ModelFamily.UNKNOWN, ...}  # falls back to default transformer resolution","handlingStrategy":"validation","validationCode":"from autogen_ext.models.openai._transformation.registry import MESSAGE_TRANSFORMERS\n\nfamily = model_info.get(\"family\")\nif family not in {f for fams in MESSAGE_TRANSFORMERS.values() for f in fams}:\n    model_info[\"family\"] = ModelFamily.UNKNOWN  # use default resolution","typeGuard":"def has_transformer(api: str, family) -> bool:\n    return family in MESSAGE_TRANSFORMERS.get(api, {})","tryCatchPattern":"try:\n    result = await client.create(messages)\nexcept ValueError as e:\n    if \"No transformer found\" in str(e):\n        raise RuntimeError(f\"unsupported model family {family!r}; update autogen-ext\") from e\n    raise","preventionTips":["Use standard ModelFamily values (or UNKNOWN) in model_info","Upgrade autogen-ext when adopting newly added model families","If you extend the registry in a fork, register transformers for every family you add"],"tags":["openai","transformation","model-family","registry","internal-invariant"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}