getLiveNagaData function

Future<String> getLiveNagaData()

Implementation

Future<String> getLiveNagaData() => http
    .get(Uri.parse("https://api.naga.ac/v1/models"))
    .thenRun((x) => print(x.body))
    .then(
      (v) => compress(
        $NagaModelsListResponse.fromJson(v.body).toJson(pretty: false),
        allowBZip2: false,
        allowZLib: false,
      ),
    )
    .catchError((e, es) {
      warn("Failed to get live OpenRouter data. Using internal fallback.");
      warn("$e, $es");
      return _nagaData;
    });