mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-15 09:14:07 +00:00
Added logging and changed return logic for missing or unavailable AI models in Chat/ContentText.cs
This commit is contained in:
parent
1b3d9ed8cd
commit
b15134d876
@ -169,8 +169,12 @@ public sealed class ContentText : IContent
|
||||
if(chatModel.IsSystemModel)
|
||||
return true;
|
||||
|
||||
if(string.IsNullOrWhiteSpace(chatModel.Id))
|
||||
return true;
|
||||
if (string.IsNullOrWhiteSpace(chatModel.Id))
|
||||
{
|
||||
LOGGER.LogWarning(
|
||||
"Skipping AI request because model ID is null or white space.");
|
||||
return false;
|
||||
}
|
||||
|
||||
IEnumerable<Model> loadedModels;
|
||||
try
|
||||
@ -189,8 +193,13 @@ public sealed class ContentText : IContent
|
||||
|
||||
var availableModels = loadedModels.Where(model => !string.IsNullOrWhiteSpace(model.Id)).ToList();
|
||||
if (availableModels.Count == 0)
|
||||
return true;
|
||||
|
||||
{
|
||||
LOGGER.LogWarning(
|
||||
"Skipping AI request because there are no models available from '{ProviderInstanceName}' (provider={ProviderType}).",
|
||||
provider.InstanceName, provider.Provider);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(availableModels.Any(model => ModelsMatch(model, chatModel)))
|
||||
return true;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user