in src/AIHub/Controllers/ContentSafetyController.cs [18:33]
public ContentSafetyController(IConfiguration config, ILogger<HomeController> logger, IHttpClientFactory clientFactory)
{
_logger = logger;
endpoint = config.GetValue<string>("ContentModerator:Endpoint") ?? throw new ArgumentNullException("Endpoint");
subscriptionKey = config.GetValue<string>("ContentModerator:SubscriptionKey") ?? throw new ArgumentNullException("SubscriptionKey");
storageconnstring = config.GetValue<string>("Storage:ConnectionString") ?? throw new ArgumentNullException("ConnectionString");
jailbreakEndpoint = config.GetValue<string>("ContentModerator:JailbreakDetectionEndpoint") ?? throw new ArgumentNullException("JailbreakDetectionEndpoint");
BlobServiceClient blobServiceClient = new BlobServiceClient(storageconnstring);
containerClient = blobServiceClient.GetBlobContainerClient(config.GetValue<string>("Storage:ContainerName"));
sasUri = containerClient.GenerateSasUri(Azure.Storage.Sas.BlobContainerSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1));
// Obtiene una lista de blobs en el contenedor
blobs = containerClient.GetBlobs();
model = new ContentSafetyModel();
httpClient = clientFactory.CreateClient();
}