Skip to content

Commit 74b191a

Browse files
nagkumar91Nagkumar ArkalgudNagkumar Arkalgud
authored
Change the enum according to APIView Review (#41880)
* Prepare evals SDK Release * Fix bug * Fix for ADV_CONV for FDP projects * Update release date * re-add pyrit to matrix * Change grader ids * Update unit test * replace all old grader IDs in tests * Update platform-matrix.json Add pyrit and not remove the other one * Update test to ensure everything is mocked * tox/black fixes * Skip that test with issues * update grader ID according to API View feedback * Update test * remove string check for grader ID * Update changelog and officialy start freeze * update the enum according to suggestions * update the changelog * Finalize logic --------- Co-authored-by: Nagkumar Arkalgud <nagkumar@naarkalg-work-mac.local> Co-authored-by: Nagkumar Arkalgud <nagkumar@Mac.lan>
1 parent 126beda commit 74b191a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

sdk/evaluation/azure-ai-evaluation/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
### Features Added
66

77
- Added support for Azure Open AI evaluation via `AzureOpenAIScoreModelGrader` class, which serves as a wrapper around Azure Open AI score model configurations. This new grader object can be supplied to the main `evaluate` method as if it were a normal callable evaluator.
8+
- Added new experimental risk categories ProtectedMaterial and CodeVulnerability for redteam agent scan.
89

910

1011
### Bugs Fixed
1112

1213
- Significant improvements to IntentResolution evaluator. New version has less variance, is nearly 2x faster and consumes fewer tokens.
13-
1414
- Fixed MeteorScoreEvaluator and other threshold-based evaluators returning incorrect binary results due to integer conversion of decimal scores. Previously, decimal scores like 0.9375 were incorrectly converted to integers (0) before threshold comparison, causing them to fail even when above the threshold. [#41415](https://github.com/Azure/azure-sdk-for-python/issues/41415)
15+
- Added a new enum `ADVERSARIAL_QA_DOCUMENTS` which moves all the "file_content" type prompts away from `ADVERSARIAL_QA` to the new enum
1516

1617
## 1.8.0 (2025-05-29)
1718

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_adversarial_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AdversarialScenario(Enum):
2222
"""
2323

2424
ADVERSARIAL_QA = "adv_qa"
25-
ADVERSARIAL_QA_ENTERPRISE = "adv_qa_enterprise"
25+
ADVERSARIAL_QA_DOCUMENTS = "adv_qa_documents"
2626
ADVERSARIAL_CONVERSATION = "adv_conversation"
2727
ADVERSARIAL_SUMMARIZATION = "adv_summarization"
2828
ADVERSARIAL_SEARCH = "adv_search"

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_model_tools/_template_handler.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ async def _get_content_harm_template_collections(self, collection_key: str) -> L
167167
if self.categorized_ch_parameters is None:
168168
categorized_parameters: Dict[str, _CategorizedParameter] = {}
169169
util = ContentHarmTemplatesUtils
170-
171170
if isinstance(self.rai_client, RAIClient):
172171
parameters = await self.rai_client.get_contentharm_parameters()
173172
elif isinstance(self.rai_client, AIProjectClient):
@@ -183,24 +182,30 @@ async def _get_content_harm_template_collections(self, collection_key: str) -> L
183182
self.categorized_ch_parameters = categorized_parameters
184183

185184
template_category = collection_key.split("adv_")[-1]
186-
if template_category == "qa_enterprise":
185+
186+
# Handle both qa_enterprise and qa_documents mapping to qa
187+
if template_category in ["qa_enterprise", "qa_documents"]:
187188
template_category = "qa"
188189

189190
plist = self.categorized_ch_parameters
190191
ch_templates = []
192+
191193
for key, value in plist.items():
194+
# Skip enterprise templates for ADVERSARIAL_QA
192195
if collection_key == AdversarialScenario.ADVERSARIAL_QA.value and "enterprise" in key:
193196
continue
194-
if collection_key == AdversarialScenario.ADVERSARIAL_QA_ENTERPRISE.value and "enterprise" not in key:
197+
# Skip non-enterprise templates for ADVERSARIAL_QA_DOCUMENTS
198+
if collection_key == AdversarialScenario.ADVERSARIAL_QA_DOCUMENTS.value and "enterprise" not in key:
195199
continue
200+
196201
if value["category"] == template_category:
197202
params = value["parameters"]
198203
for p in params:
199204
p.update({"ch_template_placeholder": "{{ch_template_placeholder}}"})
200205

201206
template = AdversarialTemplate(template_name=key, text=None, context_key=[], template_parameters=params)
202-
203207
ch_templates.append(template)
208+
204209
return ch_templates
205210

206211
def get_template(self, template_name: str) -> Optional[AdversarialTemplate]:

0 commit comments

Comments
 (0)