Model billing information
| 692 | |
| 693 | @dataclass |
| 694 | class ModelBilling: |
| 695 | """Model billing information""" |
| 696 | |
| 697 | multiplier: float | None = None |
| 698 | token_prices: ModelBillingTokenPrices | None = None |
| 699 | |
| 700 | @staticmethod |
| 701 | def from_dict(obj: Any) -> ModelBilling: |
| 702 | assert isinstance(obj, dict) |
| 703 | multiplier = obj.get("multiplier") |
| 704 | tp = obj.get("tokenPrices") |
| 705 | token_prices = ModelBillingTokenPrices.from_dict(tp) if tp is not None else None |
| 706 | return ModelBilling( |
| 707 | multiplier=float(multiplier) if multiplier is not None else None, |
| 708 | token_prices=token_prices, |
| 709 | ) |
| 710 | |
| 711 | def to_dict(self) -> dict: |
| 712 | result: dict = {} |
| 713 | if self.multiplier is not None: |
| 714 | result["multiplier"] = self.multiplier |
| 715 | if self.token_prices is not None: |
| 716 | result["tokenPrices"] = self.token_prices.to_dict() |
| 717 | return result |
| 718 | |
| 719 | |
| 720 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…