mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 03:17:59 +00:00
Ask the endpoint for transcription models before falling back to the documented list
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user