fetchDialModels function

Future<List<String>> fetchDialModels(
  1. String baseUrl,
  2. String apiKey, {
  3. Client? client,
})

Fetches the deployment ids from {baseUrl}/openai/models (OpenAI-shaped {"data": [{"id": …}]} response), authenticating with the Api-Key header. Any failure answers an empty list — callers keep their hardcoded fallback model list.

Implementation

Future<List<String>> fetchDialModels(
  String baseUrl,
  String apiKey, {
  http.Client? client,
}) async {
  final (ids, _, _, _) = await fetchDialModelsInfo(
    baseUrl,
    apiKey,
    client: client,
  );
  return ids;
}