(spec: str)
| 13 | |
| 14 | |
| 15 | def get_model_class(spec: str) -> type[Model]: |
| 16 | full_path = _MODEL_MAPPING.get(spec, spec) |
| 17 | module_name, class_name = full_path.rsplit(".", 1) |
| 18 | module = importlib.import_module(module_name) |
| 19 | return getattr(module, class_name) |
| 20 | |
| 21 | |
| 22 | def get_model(config: dict, *, default_type: str = "openai") -> Model: |