mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:47:22 +00:00
Added a way for organizations to prohibit providers (#1105)
This commit is contained in:
1 parent
052868b24e
commit
7ba5f01388
38 files changed
+1488
-629
No files matched your search
@@ -255,6 +255,14 @@ public sealed class AIJobService(SettingsManager settingsManager, MessageBus mes
|
||||
var provider = request.ProviderSettings.CreateProvider();
|
||||
var chatThread = request.ChatThread;
|
||||
|
||||
// Checked on its own, so that the user learns what to change:
|
||||
if (settingsManager.IsProviderProhibited(request.ProviderSettings.UsedLLMProvider))
|
||||
{
|
||||
logger.LogError("The provider of chat '{ChatId}' is prohibited by the organization. Skipping the AI process.", chatThread.ChatId);
|
||||
await this.CompleteChatGenerationAsync(state, AIJobStatus.FAILED, TB("The use of this provider has been prohibited by your organization. Please select a different provider."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chatThread.IsLLMProviderAllowed(provider))
|
||||
{
|
||||
logger.LogError("The provider is not allowed for chat '{ChatId}' due to data security reasons. Skipping the AI process.", chatThread.ChatId);
|
||||
|
||||
Reference in new issue
Block a user