|
4 | 4 | import os |
5 | 5 | import pathlib |
6 | 6 | import sys |
7 | | -from enum import Enum |
8 | 7 |
|
9 | 8 | import requests |
10 | 9 | from azure.ai.evaluation import AzureAIProject |
|
21 | 20 | root_dir = pathlib.Path(__file__).parent |
22 | 21 |
|
23 | 22 |
|
24 | | -class HarmSeverityLevel(Enum): |
25 | | - """Harm severity levels reported by the Azure AI Evaluator service. |
26 | | - These constants have been copied from the azure-ai-evaluation package, |
27 | | - where they're currently in a private module. |
28 | | - """ |
29 | | - |
30 | | - VeryLow = "Very low" |
31 | | - Low = "Low" |
32 | | - Medium = "Medium" |
33 | | - High = "High" |
34 | | - |
35 | | - |
36 | 23 | def get_azure_credential(): |
37 | 24 | AZURE_TENANT_ID = os.getenv("AZURE_TENANT_ID") |
38 | 25 | if AZURE_TENANT_ID: |
@@ -68,9 +55,9 @@ async def callback( |
68 | 55 | async def run_simulator(target_url: str, max_simulations: int): |
69 | 56 | credential = get_azure_credential() |
70 | 57 | azure_ai_project: AzureAIProject = { |
71 | | - "subscription_id": os.environ["AZURE_SUBSCRIPTION_ID"], |
72 | | - "resource_group_name": os.environ["AZURE_RESOURCE_GROUP"], |
73 | | - "project_name": os.environ["AZURE_AI_PROJECT"], |
| 58 | + "subscription_id": os.getenv("AZURE_SUBSCRIPTION_ID"), |
| 59 | + "resource_group_name": os.getenv("AZURE_RESOURCE_GROUP"), |
| 60 | + "project_name": "pf-testprojforaisaety", |
74 | 61 | } |
75 | 62 | model_red_team = RedTeam( |
76 | 63 | azure_ai_project=azure_ai_project, |
@@ -114,7 +101,7 @@ async def run_simulator(target_url: str, max_simulations: int): |
114 | 101 |
|
115 | 102 | # Configure logging to show tracebacks for warnings and above |
116 | 103 | logging.basicConfig( |
117 | | - level=logging.WARNING, |
| 104 | + level=logging.DEBUG, |
118 | 105 | format="%(message)s", |
119 | 106 | datefmt="[%X]", |
120 | 107 | handlers=[RichHandler(rich_tracebacks=False, show_path=True)], |
|
0 commit comments