Fixed a bug with non-running local transcription providers

This commit is contained in:
Thorsten Sommer 2026-01-18 12:25:52 +01:00
parent 839068ff34
commit 8107c97a6e
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 11 additions and 11 deletions

View File

@ -149,31 +149,30 @@ public sealed class ProviderSelfHosted(Host host, string hostname) : BaseProvide
}
/// <inheritdoc />
public override Task<IEnumerable<Provider.Model>> GetTranscriptionModels(string? apiKeyProvisional = null, CancellationToken token = default)
public override async Task<IEnumerable<Provider.Model>> GetTranscriptionModels(string? apiKeyProvisional = null, CancellationToken token = default)
{
try
{
switch (host)
{
case Host.WHISPER_CPP:
return Task.FromResult<IEnumerable<Provider.Model>>(
new List<Provider.Model>
{
new("loaded-model", TB("Model as configured by whisper.cpp")),
});
return new List<Provider.Model>
{
new("loaded-model", TB("Model as configured by whisper.cpp")),
};
case Host.OLLAMA:
case Host.VLLM:
return this.LoadModels(SecretStoreType.TRANSCRIPTION_PROVIDER, [], [], token, apiKeyProvisional);
return await this.LoadModels(SecretStoreType.TRANSCRIPTION_PROVIDER, [], [], token, apiKeyProvisional);
default:
return Task.FromResult(Enumerable.Empty<Provider.Model>());
return [];
}
}
catch (Exception e)
{
LOGGER.LogError(e, "Failed to load transcription models from self-hosted provider.");
return Task.FromResult(Enumerable.Empty<Provider.Model>());
LOGGER.LogError($"Failed to load transcription models from self-hosted provider: {e.Message}");
return [];
}
}

View File

@ -1,4 +1,5 @@
# v26.1.2, build 232 (2026-01-xx xx:xx UTC)
- Added the option to hide specific assistants by configuration plugins. This is useful for enterprise environments in organizations.
- Fixed a logging bug that prevented log events from being recorded in some cases.
- Fixed a bug that allowed adding a provider without selecting a model.
- Fixed a bug that allowed adding a provider without selecting a model.
- Fixed a bug with local transcription providers by handling errors correctly when the local provider is unavailable.