Merge dynamic pricing (from discovery) with static fallback.
()
| 2836 | _circuit_breaker = CircuitBreakerRegistry() |
| 2837 | |
| 2838 | def _refresh_active_pricing() -> None: |
| 2839 | """Merge dynamic pricing (from discovery) with static fallback.""" |
| 2840 | nonlocal _routing_config |
| 2841 | global _active_pricing |
| 2842 | merged = dict(DEFAULT_MODEL_PRICING) |
| 2843 | dynamic = _mapper.dynamic_pricing |
| 2844 | if dynamic: |
| 2845 | merged.update(dynamic) |
| 2846 | _active_pricing = merged |
| 2847 | |
| 2848 | import copy |
| 2849 | updated = copy.deepcopy(_routing_store.config()) |
| 2850 | dynamic_caps = _mapper.dynamic_capabilities |
| 2851 | if dynamic_caps: |
| 2852 | merged_caps = dict(updated.model_capabilities) |
| 2853 | merged_caps.update(dynamic_caps) |
| 2854 | updated.model_capabilities = merged_caps |
| 2855 | _routing_config = updated |
| 2856 | |
| 2857 | def _reload_providers() -> ProvidersConfig: |
| 2858 | nonlocal _providers, _semantic |
no test coverage detected