Share via


ProtectedMaterialMultimodalEvaluator Class

Note

This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.

Initialize a protected materials evaluator to detect whether protected material is present in multimodal messages. The evaluator outputs a Boolean label (True or False) indicating the presence of protected material, along with AI-generated reasoning.

Usage Example


   azure_ai_project = {
       "subscription_id": "<subscription_id>",
       "resource_group_name": "<resource_group_name>",
       "project_name": "<project_name>",
   }
   eval_fn = ProtectedMaterialMultimodalEvaluator(azure_ai_project)
   result = eval_fn(
       {
           "messages": [
               {
                   "role": "user",
                   "content": [
                       {
                           "type": "text",
                           "text": "What's in this image?"
                       },
                       {
                           "type": "image_url",
                           "image_url": {
                               "url": "<image url or base64 encoded image>"
                           }
                       }
                   ]
               },
               {
                   "role": "assistant",
                   "content": "This picture shows an astronaut standing in the desert."
               }
           ]
       }
   )

Output Format


   {
       "protected_material_label": "False",
       "protected_material_reason": "This query does not contain any protected material."
   }

Constructor

ProtectedMaterialMultimodalEvaluator(credential, azure_ai_project)

Parameters

Name Description
credential
Required

The credential for connecting to the Azure AI project. This is required.

azure_ai_project
Required

The scope of the Azure AI project, containing the subscription ID, resource group, and project name.