fetchActiveModelPrice method
Queries the live token price for the currently active model configuration.
Implementation
Future<void> fetchActiveModelPrice() async {
final config = activeLlmConfig;
if (config.provider == LlmProvider.none && config.model.trim().isEmpty) {
_activeModelPrice = null;
_isLoadingPrice = false;
notifyListeners();
return;
}
_isLoadingPrice = true;
notifyListeners();
try {
_activeModelPrice = await ModelPricingService.fetchPrice(config);
} catch (_) {
_activeModelPrice = ModelPriceInfo.unknown;
} finally {
_isLoadingPrice = false;
notifyListeners();
}
}