Coverage for lintro / ai / provider_info.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-04-03 18:53 +0000

1"""Provider metadata dataclass. 

2 

3Houses the frozen :class:`ProviderInfo` dataclass used by the provider 

4registry. Separated from :mod:`lintro.ai.registry` so that consumers 

5needing only the data shapes can import them without depending on the 

6singleton instance. 

7""" 

8 

9from __future__ import annotations 

10 

11from collections.abc import Mapping 

12from dataclasses import dataclass, field 

13 

14from lintro.ai.model_pricing import ModelPricing 

15 

16__all__ = ["ModelPricing", "ProviderInfo"] 

17 

18 

19@dataclass(frozen=True) 

20class ProviderInfo: 

21 """Metadata for a single AI provider. 

22 

23 Attributes: 

24 default_model: Model identifier used when the user omits one. 

25 default_api_key_env: Environment variable checked for the API key. 

26 models: Known models and their pricing. 

27 Typed as ``Mapping`` to signal read-only intent; the frozen 

28 dataclass prevents reassignment of the attribute itself. 

29 """ 

30 

31 default_model: str 

32 default_api_key_env: str 

33 models: Mapping[str, ModelPricing] = field(default_factory=dict)