Ask the endpoint for transcription models before falling back to the documented list

This commit is contained in:
Thorsten Sommer committed 2026-09-19 17:34:34 +02:00
1 parent 9595c6a19f
commit a4485ce618
4 files changed
+64 -13

No files matched your search

@@ -124,13 +124,16 @@ public sealed class ProviderMistral() : BaseProvider(LLMProviders.MISTRAL, new U
}
/// <inheritdoc />
public override Task<ModelLoadResult> GetTranscriptionModels(string? apiKeyProvisional = null, CancellationToken token = default)
public override async Task<ModelLoadResult> GetTranscriptionModels(string? apiKeyProvisional = null, CancellationToken token = default)
{
// Source: https://docs.mistral.ai/capabilities/audio_transcription
return Task.FromResult(ModelLoadResult.FromModels(
[
new Provider.Model("voxtral-mini-latest", "Voxtral Mini Latest"),
]));
var modelResponse = await this.LoadModelList(SecretStoreType.TRANSCRIPTION_PROVIDER, apiKeyProvisional, token);
if (!modelResponse.Success)
return modelResponse;
return modelResponse with
{
Models = [..modelResponse.Models.Where(n => n.IsTranscriptionModel(this.Provider))]
};
}
#endregion
@@ -145,4 +148,4 @@ public sealed class ProviderMistral() : BaseProvider(LLMProviders.MISTRAL, new U
listingFactory: modelResponse => modelResponse.Data.Select(n => ModelListing.For(n.Id, n.ContextWindowTokens)),
token: token);
}
}
}