mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 23:07:23 +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
@@ -188,9 +188,13 @@ public sealed class DataSourceValidation
|
||||
// An id which matches no provider belongs to one which was deleted since. Saved like this, the
|
||||
// data source keeps pointing at a provider nobody can reach, and nothing of it is embedded:
|
||||
//
|
||||
if(this.GetSelectedEmbeddingProvider() is null)
|
||||
if(this.GetSelectedEmbeddingProvider() is not { } selectedEmbedding)
|
||||
return TB("The embedding provider of this data source no longer exists. Please select another one.");
|
||||
|
||||
// Saved like this, nothing of the data source would ever be embedded:
|
||||
if(this.GetSettingsManager() is { } settingsManager && settingsManager.IsProviderProhibited(selectedEmbedding.UsedLLMProvider))
|
||||
return TB("The use of this embedding provider has been prohibited by your organization. Please select a different embedding provider.");
|
||||
|
||||
return this.ValidateSelectedEmbeddingProviderAccess();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user