azure-ai-evaluation 1.0.0b2__py3-none-any.whl → 1.13.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of azure-ai-evaluation might be problematic. Click here for more details.

Files changed (299) hide show
  1. azure/ai/evaluation/__init__.py +100 -5
  2. azure/ai/evaluation/{_evaluators/_chat → _aoai}/__init__.py +3 -2
  3. azure/ai/evaluation/_aoai/aoai_grader.py +140 -0
  4. azure/ai/evaluation/_aoai/label_grader.py +68 -0
  5. azure/ai/evaluation/_aoai/python_grader.py +86 -0
  6. azure/ai/evaluation/_aoai/score_model_grader.py +94 -0
  7. azure/ai/evaluation/_aoai/string_check_grader.py +66 -0
  8. azure/ai/evaluation/_aoai/text_similarity_grader.py +80 -0
  9. azure/ai/evaluation/_azure/__init__.py +3 -0
  10. azure/ai/evaluation/_azure/_clients.py +204 -0
  11. azure/ai/evaluation/_azure/_envs.py +207 -0
  12. azure/ai/evaluation/_azure/_models.py +227 -0
  13. azure/ai/evaluation/_azure/_token_manager.py +129 -0
  14. azure/ai/evaluation/_common/__init__.py +9 -1
  15. azure/ai/evaluation/{simulator/_helpers → _common}/_experimental.py +24 -9
  16. azure/ai/evaluation/_common/constants.py +131 -2
  17. azure/ai/evaluation/_common/evaluation_onedp_client.py +169 -0
  18. azure/ai/evaluation/_common/math.py +89 -0
  19. azure/ai/evaluation/_common/onedp/__init__.py +32 -0
  20. azure/ai/evaluation/_common/onedp/_client.py +166 -0
  21. azure/ai/evaluation/_common/onedp/_configuration.py +72 -0
  22. azure/ai/evaluation/_common/onedp/_model_base.py +1232 -0
  23. azure/ai/evaluation/_common/onedp/_patch.py +21 -0
  24. azure/ai/evaluation/_common/onedp/_serialization.py +2032 -0
  25. azure/ai/evaluation/_common/onedp/_types.py +21 -0
  26. azure/ai/evaluation/_common/onedp/_utils/__init__.py +6 -0
  27. azure/ai/evaluation/_common/onedp/_utils/model_base.py +1232 -0
  28. azure/ai/evaluation/_common/onedp/_utils/serialization.py +2032 -0
  29. azure/ai/evaluation/_common/onedp/_validation.py +66 -0
  30. azure/ai/evaluation/_common/onedp/_vendor.py +50 -0
  31. azure/ai/evaluation/_common/onedp/_version.py +9 -0
  32. azure/ai/evaluation/_common/onedp/aio/__init__.py +29 -0
  33. azure/ai/evaluation/_common/onedp/aio/_client.py +168 -0
  34. azure/ai/evaluation/_common/onedp/aio/_configuration.py +72 -0
  35. azure/ai/evaluation/_common/onedp/aio/_patch.py +21 -0
  36. azure/ai/evaluation/_common/onedp/aio/operations/__init__.py +49 -0
  37. azure/ai/evaluation/_common/onedp/aio/operations/_operations.py +7143 -0
  38. azure/ai/evaluation/_common/onedp/aio/operations/_patch.py +21 -0
  39. azure/ai/evaluation/_common/onedp/models/__init__.py +358 -0
  40. azure/ai/evaluation/_common/onedp/models/_enums.py +447 -0
  41. azure/ai/evaluation/_common/onedp/models/_models.py +5963 -0
  42. azure/ai/evaluation/_common/onedp/models/_patch.py +21 -0
  43. azure/ai/evaluation/_common/onedp/operations/__init__.py +49 -0
  44. azure/ai/evaluation/_common/onedp/operations/_operations.py +8951 -0
  45. azure/ai/evaluation/_common/onedp/operations/_patch.py +21 -0
  46. azure/ai/evaluation/_common/onedp/py.typed +1 -0
  47. azure/ai/evaluation/_common/onedp/servicepatterns/__init__.py +1 -0
  48. azure/ai/evaluation/_common/onedp/servicepatterns/aio/__init__.py +1 -0
  49. azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/__init__.py +25 -0
  50. azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/_operations.py +34 -0
  51. azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/_patch.py +20 -0
  52. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/__init__.py +1 -0
  53. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/__init__.py +1 -0
  54. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/__init__.py +22 -0
  55. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/_operations.py +29 -0
  56. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/_patch.py +20 -0
  57. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/__init__.py +22 -0
  58. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/_operations.py +29 -0
  59. azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/_patch.py +20 -0
  60. azure/ai/evaluation/_common/onedp/servicepatterns/operations/__init__.py +25 -0
  61. azure/ai/evaluation/_common/onedp/servicepatterns/operations/_operations.py +34 -0
  62. azure/ai/evaluation/_common/onedp/servicepatterns/operations/_patch.py +20 -0
  63. azure/ai/evaluation/_common/rai_service.py +831 -142
  64. azure/ai/evaluation/_common/raiclient/__init__.py +34 -0
  65. azure/ai/evaluation/_common/raiclient/_client.py +128 -0
  66. azure/ai/evaluation/_common/raiclient/_configuration.py +87 -0
  67. azure/ai/evaluation/_common/raiclient/_model_base.py +1235 -0
  68. azure/ai/evaluation/_common/raiclient/_patch.py +20 -0
  69. azure/ai/evaluation/_common/raiclient/_serialization.py +2050 -0
  70. azure/ai/evaluation/_common/raiclient/_version.py +9 -0
  71. azure/ai/evaluation/_common/raiclient/aio/__init__.py +29 -0
  72. azure/ai/evaluation/_common/raiclient/aio/_client.py +130 -0
  73. azure/ai/evaluation/_common/raiclient/aio/_configuration.py +87 -0
  74. azure/ai/evaluation/_common/raiclient/aio/_patch.py +20 -0
  75. azure/ai/evaluation/_common/raiclient/aio/operations/__init__.py +25 -0
  76. azure/ai/evaluation/_common/raiclient/aio/operations/_operations.py +981 -0
  77. azure/ai/evaluation/_common/raiclient/aio/operations/_patch.py +20 -0
  78. azure/ai/evaluation/_common/raiclient/models/__init__.py +60 -0
  79. azure/ai/evaluation/_common/raiclient/models/_enums.py +18 -0
  80. azure/ai/evaluation/_common/raiclient/models/_models.py +651 -0
  81. azure/ai/evaluation/_common/raiclient/models/_patch.py +20 -0
  82. azure/ai/evaluation/_common/raiclient/operations/__init__.py +25 -0
  83. azure/ai/evaluation/_common/raiclient/operations/_operations.py +1238 -0
  84. azure/ai/evaluation/_common/raiclient/operations/_patch.py +20 -0
  85. azure/ai/evaluation/_common/raiclient/py.typed +1 -0
  86. azure/ai/evaluation/_common/utils.py +870 -34
  87. azure/ai/evaluation/_constants.py +167 -6
  88. azure/ai/evaluation/_converters/__init__.py +3 -0
  89. azure/ai/evaluation/_converters/_ai_services.py +899 -0
  90. azure/ai/evaluation/_converters/_models.py +467 -0
  91. azure/ai/evaluation/_converters/_sk_services.py +495 -0
  92. azure/ai/evaluation/_eval_mapping.py +83 -0
  93. azure/ai/evaluation/_evaluate/_batch_run/__init__.py +17 -0
  94. azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py +176 -0
  95. azure/ai/evaluation/_evaluate/_batch_run/batch_clients.py +82 -0
  96. azure/ai/evaluation/_evaluate/{_batch_run_client → _batch_run}/code_client.py +47 -25
  97. azure/ai/evaluation/_evaluate/{_batch_run_client/batch_run_context.py → _batch_run/eval_run_context.py} +42 -13
  98. azure/ai/evaluation/_evaluate/_batch_run/proxy_client.py +124 -0
  99. azure/ai/evaluation/_evaluate/_batch_run/target_run_context.py +62 -0
  100. azure/ai/evaluation/_evaluate/_eval_run.py +102 -59
  101. azure/ai/evaluation/_evaluate/_evaluate.py +2134 -311
  102. azure/ai/evaluation/_evaluate/_evaluate_aoai.py +992 -0
  103. azure/ai/evaluation/_evaluate/_telemetry/__init__.py +14 -99
  104. azure/ai/evaluation/_evaluate/_utils.py +289 -40
  105. azure/ai/evaluation/_evaluator_definition.py +76 -0
  106. azure/ai/evaluation/_evaluators/_bleu/_bleu.py +93 -42
  107. azure/ai/evaluation/_evaluators/_code_vulnerability/__init__.py +5 -0
  108. azure/ai/evaluation/_evaluators/_code_vulnerability/_code_vulnerability.py +119 -0
  109. azure/ai/evaluation/_evaluators/_coherence/_coherence.py +117 -91
  110. azure/ai/evaluation/_evaluators/_coherence/coherence.prompty +76 -39
  111. azure/ai/evaluation/_evaluators/_common/__init__.py +15 -0
  112. azure/ai/evaluation/_evaluators/_common/_base_eval.py +742 -0
  113. azure/ai/evaluation/_evaluators/_common/_base_multi_eval.py +63 -0
  114. azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py +345 -0
  115. azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py +198 -0
  116. azure/ai/evaluation/_evaluators/_common/_conversation_aggregators.py +49 -0
  117. azure/ai/evaluation/_evaluators/_content_safety/__init__.py +0 -4
  118. azure/ai/evaluation/_evaluators/_content_safety/_content_safety.py +144 -86
  119. azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py +138 -57
  120. azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py +123 -55
  121. azure/ai/evaluation/_evaluators/_content_safety/_sexual.py +133 -54
  122. azure/ai/evaluation/_evaluators/_content_safety/_violence.py +134 -54
  123. azure/ai/evaluation/_evaluators/_document_retrieval/__init__.py +7 -0
  124. azure/ai/evaluation/_evaluators/_document_retrieval/_document_retrieval.py +442 -0
  125. azure/ai/evaluation/_evaluators/_eci/_eci.py +49 -56
  126. azure/ai/evaluation/_evaluators/_f1_score/_f1_score.py +102 -60
  127. azure/ai/evaluation/_evaluators/_fluency/_fluency.py +115 -92
  128. azure/ai/evaluation/_evaluators/_fluency/fluency.prompty +66 -41
  129. azure/ai/evaluation/_evaluators/_gleu/_gleu.py +90 -37
  130. azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py +318 -82
  131. azure/ai/evaluation/_evaluators/_groundedness/groundedness_with_query.prompty +114 -0
  132. azure/ai/evaluation/_evaluators/_groundedness/groundedness_without_query.prompty +104 -0
  133. azure/ai/evaluation/{_evaluate/_batch_run_client → _evaluators/_intent_resolution}/__init__.py +3 -4
  134. azure/ai/evaluation/_evaluators/_intent_resolution/_intent_resolution.py +196 -0
  135. azure/ai/evaluation/_evaluators/_intent_resolution/intent_resolution.prompty +275 -0
  136. azure/ai/evaluation/_evaluators/_meteor/_meteor.py +107 -61
  137. azure/ai/evaluation/_evaluators/_protected_material/_protected_material.py +104 -77
  138. azure/ai/evaluation/_evaluators/_qa/_qa.py +115 -63
  139. azure/ai/evaluation/_evaluators/_relevance/_relevance.py +182 -98
  140. azure/ai/evaluation/_evaluators/_relevance/relevance.prompty +178 -49
  141. azure/ai/evaluation/_evaluators/_response_completeness/__init__.py +7 -0
  142. azure/ai/evaluation/_evaluators/_response_completeness/_response_completeness.py +202 -0
  143. azure/ai/evaluation/_evaluators/_response_completeness/response_completeness.prompty +84 -0
  144. azure/ai/evaluation/_evaluators/{_chat/retrieval → _retrieval}/__init__.py +2 -2
  145. azure/ai/evaluation/_evaluators/_retrieval/_retrieval.py +148 -0
  146. azure/ai/evaluation/_evaluators/_retrieval/retrieval.prompty +93 -0
  147. azure/ai/evaluation/_evaluators/_rouge/_rouge.py +189 -50
  148. azure/ai/evaluation/_evaluators/_service_groundedness/__init__.py +9 -0
  149. azure/ai/evaluation/_evaluators/_service_groundedness/_service_groundedness.py +179 -0
  150. azure/ai/evaluation/_evaluators/_similarity/_similarity.py +102 -91
  151. azure/ai/evaluation/_evaluators/_similarity/similarity.prompty +0 -5
  152. azure/ai/evaluation/_evaluators/_task_adherence/__init__.py +7 -0
  153. azure/ai/evaluation/_evaluators/_task_adherence/_task_adherence.py +226 -0
  154. azure/ai/evaluation/_evaluators/_task_adherence/task_adherence.prompty +101 -0
  155. azure/ai/evaluation/_evaluators/_task_completion/__init__.py +7 -0
  156. azure/ai/evaluation/_evaluators/_task_completion/_task_completion.py +177 -0
  157. azure/ai/evaluation/_evaluators/_task_completion/task_completion.prompty +220 -0
  158. azure/ai/evaluation/_evaluators/_task_navigation_efficiency/__init__.py +7 -0
  159. azure/ai/evaluation/_evaluators/_task_navigation_efficiency/_task_navigation_efficiency.py +384 -0
  160. azure/ai/evaluation/_evaluators/_tool_call_accuracy/__init__.py +9 -0
  161. azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py +298 -0
  162. azure/ai/evaluation/_evaluators/_tool_call_accuracy/tool_call_accuracy.prompty +166 -0
  163. azure/ai/evaluation/_evaluators/_tool_input_accuracy/__init__.py +9 -0
  164. azure/ai/evaluation/_evaluators/_tool_input_accuracy/_tool_input_accuracy.py +263 -0
  165. azure/ai/evaluation/_evaluators/_tool_input_accuracy/tool_input_accuracy.prompty +76 -0
  166. azure/ai/evaluation/_evaluators/_tool_output_utilization/__init__.py +7 -0
  167. azure/ai/evaluation/_evaluators/_tool_output_utilization/_tool_output_utilization.py +225 -0
  168. azure/ai/evaluation/_evaluators/_tool_output_utilization/tool_output_utilization.prompty +221 -0
  169. azure/ai/evaluation/_evaluators/_tool_selection/__init__.py +9 -0
  170. azure/ai/evaluation/_evaluators/_tool_selection/_tool_selection.py +266 -0
  171. azure/ai/evaluation/_evaluators/_tool_selection/tool_selection.prompty +104 -0
  172. azure/ai/evaluation/_evaluators/_tool_success/__init__.py +7 -0
  173. azure/ai/evaluation/_evaluators/_tool_success/_tool_success.py +301 -0
  174. azure/ai/evaluation/_evaluators/_tool_success/tool_success.prompty +321 -0
  175. azure/ai/evaluation/_evaluators/_ungrounded_attributes/__init__.py +5 -0
  176. azure/ai/evaluation/_evaluators/_ungrounded_attributes/_ungrounded_attributes.py +102 -0
  177. azure/ai/evaluation/_evaluators/_xpia/xpia.py +109 -107
  178. azure/ai/evaluation/_exceptions.py +51 -7
  179. azure/ai/evaluation/_http_utils.py +210 -137
  180. azure/ai/evaluation/_legacy/__init__.py +3 -0
  181. azure/ai/evaluation/_legacy/_adapters/__init__.py +7 -0
  182. azure/ai/evaluation/_legacy/_adapters/_check.py +17 -0
  183. azure/ai/evaluation/_legacy/_adapters/_configuration.py +45 -0
  184. azure/ai/evaluation/_legacy/_adapters/_constants.py +10 -0
  185. azure/ai/evaluation/_legacy/_adapters/_errors.py +29 -0
  186. azure/ai/evaluation/_legacy/_adapters/_flows.py +28 -0
  187. azure/ai/evaluation/_legacy/_adapters/_service.py +16 -0
  188. azure/ai/evaluation/_legacy/_adapters/client.py +51 -0
  189. azure/ai/evaluation/_legacy/_adapters/entities.py +26 -0
  190. azure/ai/evaluation/_legacy/_adapters/tracing.py +28 -0
  191. azure/ai/evaluation/_legacy/_adapters/types.py +15 -0
  192. azure/ai/evaluation/_legacy/_adapters/utils.py +31 -0
  193. azure/ai/evaluation/_legacy/_batch_engine/__init__.py +9 -0
  194. azure/ai/evaluation/_legacy/_batch_engine/_config.py +48 -0
  195. azure/ai/evaluation/_legacy/_batch_engine/_engine.py +477 -0
  196. azure/ai/evaluation/_legacy/_batch_engine/_exceptions.py +88 -0
  197. azure/ai/evaluation/_legacy/_batch_engine/_openai_injector.py +132 -0
  198. azure/ai/evaluation/_legacy/_batch_engine/_result.py +107 -0
  199. azure/ai/evaluation/_legacy/_batch_engine/_run.py +127 -0
  200. azure/ai/evaluation/_legacy/_batch_engine/_run_storage.py +128 -0
  201. azure/ai/evaluation/_legacy/_batch_engine/_run_submitter.py +262 -0
  202. azure/ai/evaluation/_legacy/_batch_engine/_status.py +25 -0
  203. azure/ai/evaluation/_legacy/_batch_engine/_trace.py +97 -0
  204. azure/ai/evaluation/_legacy/_batch_engine/_utils.py +97 -0
  205. azure/ai/evaluation/_legacy/_batch_engine/_utils_deprecated.py +131 -0
  206. azure/ai/evaluation/_legacy/_common/__init__.py +3 -0
  207. azure/ai/evaluation/_legacy/_common/_async_token_provider.py +117 -0
  208. azure/ai/evaluation/_legacy/_common/_logging.py +292 -0
  209. azure/ai/evaluation/_legacy/_common/_thread_pool_executor_with_context.py +17 -0
  210. azure/ai/evaluation/_legacy/prompty/__init__.py +36 -0
  211. azure/ai/evaluation/_legacy/prompty/_connection.py +119 -0
  212. azure/ai/evaluation/_legacy/prompty/_exceptions.py +139 -0
  213. azure/ai/evaluation/_legacy/prompty/_prompty.py +430 -0
  214. azure/ai/evaluation/_legacy/prompty/_utils.py +663 -0
  215. azure/ai/evaluation/_legacy/prompty/_yaml_utils.py +99 -0
  216. azure/ai/evaluation/_model_configurations.py +130 -8
  217. azure/ai/evaluation/_safety_evaluation/__init__.py +3 -0
  218. azure/ai/evaluation/_safety_evaluation/_generated_rai_client.py +0 -0
  219. azure/ai/evaluation/_safety_evaluation/_safety_evaluation.py +917 -0
  220. azure/ai/evaluation/_user_agent.py +32 -1
  221. azure/ai/evaluation/_vendor/__init__.py +3 -0
  222. azure/ai/evaluation/_vendor/rouge_score/__init__.py +14 -0
  223. azure/ai/evaluation/_vendor/rouge_score/rouge_scorer.py +324 -0
  224. azure/ai/evaluation/_vendor/rouge_score/scoring.py +59 -0
  225. azure/ai/evaluation/_vendor/rouge_score/tokenize.py +59 -0
  226. azure/ai/evaluation/_vendor/rouge_score/tokenizers.py +53 -0
  227. azure/ai/evaluation/_version.py +2 -1
  228. azure/ai/evaluation/red_team/__init__.py +22 -0
  229. azure/ai/evaluation/red_team/_agent/__init__.py +3 -0
  230. azure/ai/evaluation/red_team/_agent/_agent_functions.py +261 -0
  231. azure/ai/evaluation/red_team/_agent/_agent_tools.py +461 -0
  232. azure/ai/evaluation/red_team/_agent/_agent_utils.py +89 -0
  233. azure/ai/evaluation/red_team/_agent/_semantic_kernel_plugin.py +228 -0
  234. azure/ai/evaluation/red_team/_attack_objective_generator.py +268 -0
  235. azure/ai/evaluation/red_team/_attack_strategy.py +49 -0
  236. azure/ai/evaluation/red_team/_callback_chat_target.py +115 -0
  237. azure/ai/evaluation/red_team/_default_converter.py +21 -0
  238. azure/ai/evaluation/red_team/_evaluation_processor.py +505 -0
  239. azure/ai/evaluation/red_team/_mlflow_integration.py +430 -0
  240. azure/ai/evaluation/red_team/_orchestrator_manager.py +803 -0
  241. azure/ai/evaluation/red_team/_red_team.py +1717 -0
  242. azure/ai/evaluation/red_team/_red_team_result.py +661 -0
  243. azure/ai/evaluation/red_team/_result_processor.py +1708 -0
  244. azure/ai/evaluation/red_team/_utils/__init__.py +37 -0
  245. azure/ai/evaluation/red_team/_utils/_rai_service_eval_chat_target.py +128 -0
  246. azure/ai/evaluation/red_team/_utils/_rai_service_target.py +601 -0
  247. azure/ai/evaluation/red_team/_utils/_rai_service_true_false_scorer.py +114 -0
  248. azure/ai/evaluation/red_team/_utils/constants.py +72 -0
  249. azure/ai/evaluation/red_team/_utils/exception_utils.py +345 -0
  250. azure/ai/evaluation/red_team/_utils/file_utils.py +266 -0
  251. azure/ai/evaluation/red_team/_utils/formatting_utils.py +365 -0
  252. azure/ai/evaluation/red_team/_utils/logging_utils.py +139 -0
  253. azure/ai/evaluation/red_team/_utils/metric_mapping.py +73 -0
  254. azure/ai/evaluation/red_team/_utils/objective_utils.py +46 -0
  255. azure/ai/evaluation/red_team/_utils/progress_utils.py +252 -0
  256. azure/ai/evaluation/red_team/_utils/retry_utils.py +218 -0
  257. azure/ai/evaluation/red_team/_utils/strategy_utils.py +218 -0
  258. azure/ai/evaluation/simulator/__init__.py +2 -1
  259. azure/ai/evaluation/simulator/_adversarial_scenario.py +26 -1
  260. azure/ai/evaluation/simulator/_adversarial_simulator.py +270 -144
  261. azure/ai/evaluation/simulator/_constants.py +12 -1
  262. azure/ai/evaluation/simulator/_conversation/__init__.py +151 -23
  263. azure/ai/evaluation/simulator/_conversation/_conversation.py +10 -6
  264. azure/ai/evaluation/simulator/_conversation/constants.py +1 -1
  265. azure/ai/evaluation/simulator/_data_sources/__init__.py +3 -0
  266. azure/ai/evaluation/simulator/_data_sources/grounding.json +1150 -0
  267. azure/ai/evaluation/simulator/_direct_attack_simulator.py +54 -75
  268. azure/ai/evaluation/simulator/_helpers/__init__.py +1 -2
  269. azure/ai/evaluation/simulator/_helpers/_language_suffix_mapping.py +1 -0
  270. azure/ai/evaluation/simulator/_helpers/_simulator_data_classes.py +26 -5
  271. azure/ai/evaluation/simulator/_indirect_attack_simulator.py +145 -104
  272. azure/ai/evaluation/simulator/_model_tools/__init__.py +2 -1
  273. azure/ai/evaluation/simulator/_model_tools/_generated_rai_client.py +225 -0
  274. azure/ai/evaluation/simulator/_model_tools/_identity_manager.py +80 -30
  275. azure/ai/evaluation/simulator/_model_tools/_proxy_completion_model.py +117 -45
  276. azure/ai/evaluation/simulator/_model_tools/_rai_client.py +109 -7
  277. azure/ai/evaluation/simulator/_model_tools/_template_handler.py +97 -33
  278. azure/ai/evaluation/simulator/_model_tools/models.py +30 -27
  279. azure/ai/evaluation/simulator/_prompty/task_query_response.prompty +6 -10
  280. azure/ai/evaluation/simulator/_prompty/task_simulate.prompty +6 -5
  281. azure/ai/evaluation/simulator/_simulator.py +302 -208
  282. azure/ai/evaluation/simulator/_utils.py +31 -13
  283. azure_ai_evaluation-1.13.3.dist-info/METADATA +939 -0
  284. azure_ai_evaluation-1.13.3.dist-info/RECORD +305 -0
  285. {azure_ai_evaluation-1.0.0b2.dist-info → azure_ai_evaluation-1.13.3.dist-info}/WHEEL +1 -1
  286. azure_ai_evaluation-1.13.3.dist-info/licenses/NOTICE.txt +70 -0
  287. azure/ai/evaluation/_evaluate/_batch_run_client/proxy_client.py +0 -71
  288. azure/ai/evaluation/_evaluators/_chat/_chat.py +0 -357
  289. azure/ai/evaluation/_evaluators/_chat/retrieval/_retrieval.py +0 -157
  290. azure/ai/evaluation/_evaluators/_chat/retrieval/retrieval.prompty +0 -48
  291. azure/ai/evaluation/_evaluators/_content_safety/_content_safety_base.py +0 -65
  292. azure/ai/evaluation/_evaluators/_content_safety/_content_safety_chat.py +0 -301
  293. azure/ai/evaluation/_evaluators/_groundedness/groundedness.prompty +0 -54
  294. azure/ai/evaluation/_evaluators/_protected_materials/__init__.py +0 -5
  295. azure/ai/evaluation/_evaluators/_protected_materials/_protected_materials.py +0 -104
  296. azure/ai/evaluation/simulator/_tracing.py +0 -89
  297. azure_ai_evaluation-1.0.0b2.dist-info/METADATA +0 -449
  298. azure_ai_evaluation-1.0.0b2.dist-info/RECORD +0 -99
  299. {azure_ai_evaluation-1.0.0b2.dist-info → azure_ai_evaluation-1.13.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,939 @@
1
+ Metadata-Version: 2.4
2
+ Name: azure-ai-evaluation
3
+ Version: 1.13.3
4
+ Summary: Microsoft Azure Evaluation Library for Python
5
+ Home-page: https://github.com/Azure/azure-sdk-for-python
6
+ Author: Microsoft Corporation
7
+ Author-email: azuresdkengsysadmins@microsoft.com
8
+ License: MIT License
9
+ Project-URL: Bug Reports, https://github.com/Azure/azure-sdk-for-python/issues
10
+ Project-URL: Source, https://github.com/Azure/azure-sdk-for-python
11
+ Keywords: azure,azure sdk
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: NOTICE.txt
24
+ Requires-Dist: pyjwt>=2.8.0
25
+ Requires-Dist: azure-identity>=1.19.0
26
+ Requires-Dist: azure-core>=1.31.0
27
+ Requires-Dist: nltk>=3.9.1
28
+ Requires-Dist: azure-storage-blob>=12.19.0
29
+ Requires-Dist: httpx>=0.27.2
30
+ Requires-Dist: pandas<3.0.0,>=2.1.2; python_version < "3.13"
31
+ Requires-Dist: pandas<3.0.0,>=2.2.3; python_version == "3.13"
32
+ Requires-Dist: pandas<3.0.0,>=2.3.3; python_version >= "3.14"
33
+ Requires-Dist: openai>=1.108.0
34
+ Requires-Dist: ruamel.yaml<1.0.0,>=0.17.10
35
+ Requires-Dist: msrest>=0.6.21
36
+ Requires-Dist: Jinja2>=3.1.6
37
+ Requires-Dist: aiohttp>=3.0
38
+ Provides-Extra: redteam
39
+ Requires-Dist: pyrit==0.8.1; python_version >= "3.10" and extra == "redteam"
40
+ Requires-Dist: duckdb==1.3.2; python_version >= "3.10" and extra == "redteam"
41
+ Provides-Extra: opentelemetry
42
+ Requires-Dist: opentelemetry-sdk>=1.17.0; extra == "opentelemetry"
43
+ Requires-Dist: azure-monitor-opentelemetry-exporter>=1.0.0b17; extra == "opentelemetry"
44
+ Dynamic: author
45
+ Dynamic: author-email
46
+ Dynamic: classifier
47
+ Dynamic: description
48
+ Dynamic: description-content-type
49
+ Dynamic: home-page
50
+ Dynamic: keywords
51
+ Dynamic: license
52
+ Dynamic: license-file
53
+ Dynamic: project-url
54
+ Dynamic: provides-extra
55
+ Dynamic: requires-dist
56
+ Dynamic: requires-python
57
+ Dynamic: summary
58
+
59
+ # Azure AI Evaluation client library for Python
60
+
61
+ Use Azure AI Evaluation SDK to assess the performance of your generative AI applications. Generative AI application generations are quantitatively measured with mathematical based metrics, AI-assisted quality and safety metrics. Metrics are defined as `evaluators`. Built-in or custom evaluators can provide comprehensive insights into the application's capabilities and limitations.
62
+
63
+ Use Azure AI Evaluation SDK to:
64
+ - Evaluate existing data from generative AI applications
65
+ - Evaluate generative AI applications
66
+ - Evaluate by generating mathematical, AI-assisted quality and safety metrics
67
+
68
+ Azure AI SDK provides following to evaluate Generative AI Applications:
69
+ - [Evaluators][evaluators] - Generate scores individually or when used together with `evaluate` API.
70
+ - [Evaluate API][evaluate_api] - Python API to evaluate dataset or application using built-in or custom evaluators.
71
+
72
+ [Source code][source_code]
73
+ | [Package (PyPI)][evaluation_pypi]
74
+ | [API reference documentation][evaluation_ref_docs]
75
+ | [Product documentation][product_documentation]
76
+ | [Samples][evaluation_samples]
77
+
78
+
79
+ ## Getting started
80
+
81
+ ### Prerequisites
82
+
83
+ - Python 3.9 or later is required to use this package.
84
+ - [Optional] You must have [Azure AI Foundry Project][ai_project] or [Azure Open AI][azure_openai] to use AI-assisted evaluators
85
+
86
+ ### Install the package
87
+
88
+ Install the Azure AI Evaluation SDK for Python with [pip][pip_link]:
89
+
90
+ ```bash
91
+ pip install azure-ai-evaluation
92
+ ```
93
+
94
+ ## Key concepts
95
+
96
+ ### Evaluators
97
+
98
+ Evaluators are custom or prebuilt classes or functions that are designed to measure the quality of the outputs from language models or generative AI applications.
99
+
100
+ #### Built-in evaluators
101
+
102
+ Built-in evaluators are out of box evaluators provided by Microsoft:
103
+ | Category | Evaluator class |
104
+ |-----------|------------------------------------------------------------------------------------------------------------------------------------|
105
+ | [Performance and quality][performance_and_quality_evaluators] (AI-assisted) | `GroundednessEvaluator`, `RelevanceEvaluator`, `CoherenceEvaluator`, `FluencyEvaluator`, `SimilarityEvaluator`, `RetrievalEvaluator` |
106
+ | [Performance and quality][performance_and_quality_evaluators] (NLP) | `F1ScoreEvaluator`, `RougeScoreEvaluator`, `GleuScoreEvaluator`, `BleuScoreEvaluator`, `MeteorScoreEvaluator`|
107
+ | [Risk and safety][risk_and_safety_evaluators] (AI-assisted) | `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator`, `IndirectAttackEvaluator`, `ProtectedMaterialEvaluator` |
108
+ | [Composite][composite_evaluators] | `QAEvaluator`, `ContentSafetyEvaluator` |
109
+
110
+ For more in-depth information on each evaluator definition and how it's calculated, see [Evaluation and monitoring metrics for generative AI][evaluation_metrics].
111
+
112
+ ```python
113
+ import os
114
+
115
+ from azure.ai.evaluation import evaluate, RelevanceEvaluator, ViolenceEvaluator, BleuScoreEvaluator
116
+
117
+ # NLP bleu score evaluator
118
+ bleu_score_evaluator = BleuScoreEvaluator()
119
+ result = bleu_score(
120
+ response="Tokyo is the capital of Japan.",
121
+ ground_truth="The capital of Japan is Tokyo."
122
+ )
123
+
124
+ # AI assisted quality evaluator
125
+ model_config = {
126
+ "azure_endpoint": os.environ.get("AZURE_OPENAI_ENDPOINT"),
127
+ "api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
128
+ "azure_deployment": os.environ.get("AZURE_OPENAI_DEPLOYMENT"),
129
+ }
130
+
131
+ relevance_evaluator = RelevanceEvaluator(model_config)
132
+ result = relevance_evaluator(
133
+ query="What is the capital of Japan?",
134
+ response="The capital of Japan is Tokyo."
135
+ )
136
+
137
+ # There are two ways to provide Azure AI Project.
138
+ # Option #1 : Using Azure AI Project Details
139
+ azure_ai_project = {
140
+ "subscription_id": "<subscription_id>",
141
+ "resource_group_name": "<resource_group_name>",
142
+ "project_name": "<project_name>",
143
+ }
144
+
145
+ violence_evaluator = ViolenceEvaluator(azure_ai_project)
146
+ result = violence_evaluator(
147
+ query="What is the capital of France?",
148
+ response="Paris."
149
+ )
150
+
151
+ # Option # 2 : Using Azure AI Project Url
152
+ azure_ai_project = "https://{resource_name}.services.ai.azure.com/api/projects/{project_name}"
153
+
154
+ violence_evaluator = ViolenceEvaluator(azure_ai_project)
155
+ result = violence_evaluator(
156
+ query="What is the capital of France?",
157
+ response="Paris."
158
+ )
159
+ ```
160
+
161
+ #### Custom evaluators
162
+
163
+ Built-in evaluators are great out of the box to start evaluating your application's generations. However you can build your own code-based or prompt-based evaluator to cater to your specific evaluation needs.
164
+
165
+ ```python
166
+
167
+ # Custom evaluator as a function to calculate response length
168
+ def response_length(response, **kwargs):
169
+ return len(response)
170
+
171
+ # Custom class based evaluator to check for blocked words
172
+ class BlocklistEvaluator:
173
+ def __init__(self, blocklist):
174
+ self._blocklist = blocklist
175
+
176
+ def __call__(self, *, response: str, **kwargs):
177
+ score = any([word in answer for word in self._blocklist])
178
+ return {"score": score}
179
+
180
+ blocklist_evaluator = BlocklistEvaluator(blocklist=["bad, worst, terrible"])
181
+
182
+ result = response_length("The capital of Japan is Tokyo.")
183
+ result = blocklist_evaluator(answer="The capital of Japan is Tokyo.")
184
+
185
+ ```
186
+
187
+ ### Evaluate API
188
+ The package provides an `evaluate` API which can be used to run multiple evaluators together to evaluate generative AI application response.
189
+
190
+ #### Evaluate existing dataset
191
+
192
+ ```python
193
+ from azure.ai.evaluation import evaluate
194
+
195
+ result = evaluate(
196
+ data="data.jsonl", # provide your data here
197
+ evaluators={
198
+ "blocklist": blocklist_evaluator,
199
+ "relevance": relevance_evaluator
200
+ },
201
+ # column mapping
202
+ evaluator_config={
203
+ "relevance": {
204
+ "column_mapping": {
205
+ "query": "${data.queries}"
206
+ "ground_truth": "${data.ground_truth}"
207
+ "response": "${outputs.response}"
208
+ }
209
+ }
210
+ }
211
+ # Optionally provide your AI Foundry project information to track your evaluation results in your Azure AI Foundry project
212
+ azure_ai_project = azure_ai_project,
213
+ # Optionally provide an output path to dump a json of metric summary, row level data and metric and AI Foundry URL
214
+ output_path="./evaluation_results.json"
215
+ )
216
+ ```
217
+ For more details refer to [Evaluate on test dataset using evaluate()][evaluate_dataset]
218
+
219
+ #### Evaluate generative AI application
220
+ ```python
221
+ from askwiki import askwiki
222
+
223
+ result = evaluate(
224
+ data="data.jsonl",
225
+ target=askwiki,
226
+ evaluators={
227
+ "relevance": relevance_eval
228
+ },
229
+ evaluator_config={
230
+ "default": {
231
+ "column_mapping": {
232
+ "query": "${data.queries}"
233
+ "context": "${outputs.context}"
234
+ "response": "${outputs.response}"
235
+ }
236
+ }
237
+ }
238
+ )
239
+ ```
240
+ Above code snippet refers to askwiki application in this [sample][evaluate_app].
241
+
242
+ For more details refer to [Evaluate on a target][evaluate_target]
243
+
244
+ ### Simulator
245
+
246
+
247
+ Simulators allow users to generate synthentic data using their application. Simulator expects the user to have a callback method that invokes their AI application. The intergration between your AI application and the simulator happens at the callback method. Here's how a sample callback would look like:
248
+
249
+
250
+ ```python
251
+ async def callback(
252
+ messages: Dict[str, List[Dict]],
253
+ stream: bool = False,
254
+ session_state: Any = None,
255
+ context: Optional[Dict[str, Any]] = None,
256
+ ) -> dict:
257
+ messages_list = messages["messages"]
258
+ # Get the last message from the user
259
+ latest_message = messages_list[-1]
260
+ query = latest_message["content"]
261
+ # Call your endpoint or AI application here
262
+ # response should be a string
263
+ response = call_to_your_application(query, messages_list, context)
264
+ formatted_response = {
265
+ "content": response,
266
+ "role": "assistant",
267
+ "context": "",
268
+ }
269
+ messages["messages"].append(formatted_response)
270
+ return {"messages": messages["messages"], "stream": stream, "session_state": session_state, "context": context}
271
+ ```
272
+
273
+ The simulator initialization and invocation looks like this:
274
+ ```python
275
+ from azure.ai.evaluation.simulator import Simulator
276
+ model_config = {
277
+ "azure_endpoint": os.environ.get("AZURE_ENDPOINT"),
278
+ "azure_deployment": os.environ.get("AZURE_DEPLOYMENT_NAME"),
279
+ "api_version": os.environ.get("AZURE_API_VERSION"),
280
+ }
281
+ custom_simulator = Simulator(model_config=model_config)
282
+ outputs = asyncio.run(custom_simulator(
283
+ target=callback,
284
+ conversation_turns=[
285
+ [
286
+ "What should I know about the public gardens in the US?",
287
+ ],
288
+ [
289
+ "How do I simulate data against LLMs",
290
+ ],
291
+ ],
292
+ max_conversation_turns=2,
293
+ ))
294
+ with open("simulator_output.jsonl", "w") as f:
295
+ for output in outputs:
296
+ f.write(output.to_eval_qr_json_lines())
297
+ ```
298
+
299
+ #### Adversarial Simulator
300
+
301
+ ```python
302
+ from azure.ai.evaluation.simulator import AdversarialSimulator, AdversarialScenario
303
+ from azure.identity import DefaultAzureCredential
304
+
305
+ # There are two ways to provide Azure AI Project.
306
+ # Option #1 : Using Azure AI Project
307
+ azure_ai_project = {
308
+ "subscription_id": <subscription_id>,
309
+ "resource_group_name": <resource_group_name>,
310
+ "project_name": <project_name>
311
+ }
312
+
313
+ # Option #2 : Using Azure AI Project Url
314
+ azure_ai_project = "https://{resource_name}.services.ai.azure.com/api/projects/{project_name}"
315
+
316
+ scenario = AdversarialScenario.ADVERSARIAL_QA
317
+ simulator = AdversarialSimulator(azure_ai_project=azure_ai_project, credential=DefaultAzureCredential())
318
+
319
+ outputs = asyncio.run(
320
+ simulator(
321
+ scenario=scenario,
322
+ max_conversation_turns=1,
323
+ max_simulation_results=3,
324
+ target=callback
325
+ )
326
+ )
327
+
328
+ print(outputs.to_eval_qr_json_lines())
329
+ ```
330
+
331
+ For more details about the simulator, visit the following links:
332
+ - [Adversarial Simulation docs][adversarial_simulation_docs]
333
+ - [Adversarial scenarios][adversarial_simulation_scenarios]
334
+ - [Simulating jailbreak attacks][adversarial_jailbreak]
335
+
336
+ ## Examples
337
+
338
+ In following section you will find examples of:
339
+ - [Evaluate an application][evaluate_app]
340
+ - [Evaluate different models][evaluate_models]
341
+ - [Custom Evaluators][custom_evaluators]
342
+ - [Adversarial Simulation][adversarial_simulation]
343
+ - [Simulate with conversation starter][simulate_with_conversation_starter]
344
+
345
+ More examples can be found [here][evaluate_samples].
346
+
347
+ ## Troubleshooting
348
+
349
+ ### General
350
+
351
+ Please refer to [troubleshooting][evaluation_tsg] for common issues.
352
+
353
+ ### Logging
354
+
355
+ This library uses the standard
356
+ [logging][python_logging] library for logging.
357
+ Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO
358
+ level.
359
+
360
+ Detailed DEBUG level logging, including request/response bodies and unredacted
361
+ headers, can be enabled on a client with the `logging_enable` argument.
362
+
363
+ See full SDK logging documentation with examples [here][sdk_logging_docs].
364
+
365
+ ## Next steps
366
+
367
+ - View our [samples][evaluation_samples].
368
+ - View our [documentation][product_documentation]
369
+
370
+ ## Contributing
371
+
372
+ This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].
373
+
374
+ When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
375
+
376
+ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.
377
+
378
+ <!-- LINKS -->
379
+
380
+ [source_code]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/evaluation/azure-ai-evaluation
381
+ [evaluation_pypi]: https://pypi.org/project/azure-ai-evaluation/
382
+ [evaluation_ref_docs]: https://learn.microsoft.com/python/api/azure-ai-evaluation/azure.ai.evaluation?view=azure-python-preview
383
+ [evaluation_samples]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios
384
+ [product_documentation]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk
385
+ [python_logging]: https://docs.python.org/3/library/logging.html
386
+ [sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging
387
+ [azure_core_readme]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md
388
+ [pip_link]: https://pypi.org/project/pip/
389
+ [azure_core_ref_docs]: https://aka.ms/azsdk-python-core-policies
390
+ [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md
391
+ [azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
392
+ [cla]: https://cla.microsoft.com
393
+ [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
394
+ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
395
+ [coc_contact]: mailto:opencode@microsoft.com
396
+ [evaluate_target]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk#evaluate-on-a-target
397
+ [evaluate_dataset]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk#evaluate-on-test-dataset-using-evaluate
398
+ [evaluators]: https://learn.microsoft.com/python/api/azure-ai-evaluation/azure.ai.evaluation?view=azure-python-preview
399
+ [evaluate_api]: https://learn.microsoft.com/python/api/azure-ai-evaluation/azure.ai.evaluation?view=azure-python-preview#azure-ai-evaluation-evaluate
400
+ [evaluate_app]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate/Supported_Evaluation_Targets/Evaluate_App_Endpoint
401
+ [evaluation_tsg]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/evaluation/azure-ai-evaluation/TROUBLESHOOTING.md
402
+ [ai_studio]: https://learn.microsoft.com/azure/ai-studio/what-is-ai-studio
403
+ [ai_project]: https://learn.microsoft.com/azure/ai-studio/how-to/create-projects?tabs=ai-studio
404
+ [azure_openai]: https://learn.microsoft.com/azure/ai-services/openai/
405
+ [evaluate_models]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate/Supported_Evaluation_Targets/Evaluate_Base_Model_Endpoint
406
+ [custom_evaluators]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate/Supported_Evaluation_Metrics/Custom_Evaluators
407
+ [evaluate_samples]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate
408
+ [evaluation_metrics]: https://learn.microsoft.com/azure/ai-studio/concepts/evaluation-metrics-built-in
409
+ [performance_and_quality_evaluators]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk#performance-and-quality-evaluators
410
+ [risk_and_safety_evaluators]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk#risk-and-safety-evaluators
411
+ [composite_evaluators]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk#composite-evaluators
412
+ [adversarial_simulation_docs]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/simulator-interaction-data#generate-adversarial-simulations-for-safety-evaluation
413
+ [adversarial_simulation_scenarios]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/simulator-interaction-data#supported-adversarial-simulation-scenarios
414
+ [adversarial_simulation]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate/Simulators/Simulate_Adversarial_Data
415
+ [simulate_with_conversation_starter]: https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/evaluate/Simulators/Simulate_Context-Relevant_Data/Simulate_From_Conversation_Starter
416
+ [adversarial_jailbreak]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/simulator-interaction-data#simulating-jailbreak-attacks
417
+
418
+
419
+ # Release History
420
+
421
+ ## 1.13.3 (2025-11-08)
422
+
423
+ ### Other Changes
424
+
425
+ - Added `scenario` property to red team evaluation request to align scores with red team concepts of attack success.
426
+
427
+ ## 1.13.2 (2025-11-07)
428
+
429
+ ### Bugs Fixed
430
+
431
+ - Added App Insights redaction for agent safety run telemetry so adversarial prompts are not stored in collected logs.
432
+
433
+ ## 1.13.1 (2025-11-05)
434
+
435
+ ### Features Added
436
+
437
+ - Improved RedTeam coverage across risk sub-categories to ensure comprehensive security testing
438
+ - Made RedTeam's `AttackStrategy.Tense` seed prompts dynamic to allow use of this strategy with additional risk categories
439
+ - Refactors error handling and result semantics in the RedTeam evaluation system to improve clarity and align with Attack Success Rate (ASR) conventions (passed=False means attack success)
440
+
441
+ ### Bugs Fixed
442
+
443
+ - Fixed RedTeam evaluation error related to context handling for context-dependent risk categories
444
+ - Fixed RedTeam prompt application for model targets during Indirect Jailbreak XPIA (Cross-Platform Indirect Attack)
445
+
446
+ ## 1.13.0 (2025-10-30)
447
+
448
+ ### Features Added
449
+
450
+ - Updated `IndirectAttack` risk category for RedTeam to `IndirectJailbreak` to better reflect its purpose. This change allows users to apply cross-domain prompt injection (XPIA) attack strategies across all risk categories, enabling more comprehensive security testing of AI systems against indirect prompt injection attacks during red teaming.
451
+ - Added `TaskAdherence`, `SensitiveDataLeakage`, and `ProhibitedActions` as cloud-only agent safety risk categories for red teaming.
452
+ - Updated all evaluators' output to be of the following schema:
453
+ - `gpt_{evaluator_name}`, `{evaluator_name}`: float score,
454
+ - `{evaluator_name}_result`: pass/fail based on threshold,
455
+ - `{evaluator_name}_reason`, `{evaluator_name}_threshold`
456
+ - `{evaluator_name}_prompt_tokens`, `{evaluator_name}_completion_tokens`, `{evaluator_name}_total_tokens`, `{evaluator_name}_finish_reason`
457
+ - `{evaluator_name}_model`: model used for evaluation
458
+ - `{evaluator_name}_sample_input`, `{evaluator_name}_sample_output`: input and output used for evaluation
459
+
460
+ This change standardizes the output format across all evaluators and follows OTel convention.
461
+
462
+ ### Bugs Fixed
463
+
464
+ - `image_tag` parameter in `AzureOpenAIPythonGrader` is now optional.
465
+
466
+ ## 1.11.2 (2025-10-09)
467
+
468
+ ### Bugs Fixed
469
+
470
+ - **kwargs in an evaluator signature receives input columns that are not otherwise named in the evaluator's signature
471
+
472
+ ## 1.12.0 (2025-10-02)
473
+
474
+ ### Features Added
475
+ - AOAI Graders now accept a "credential" parameter that can be used for authentication with an AzureOpenAIModelConfiguration
476
+ - Added `is_reasoning_model` parameter support to `CoherenceEvaluator`, `FluencyEvaluator`, `SimilarityEvaluator`, `GroundednessEvaluator`, `RetrievalEvaluator`, and `RelevanceEvaluator` to enable reasoning model configuration for o1/o3 models.
477
+
478
+ ### Bugs Fixed
479
+ - Support for multi-level nesting in OpenAI grader (experimental)
480
+
481
+ ## 1.11.1 (2025-09-19)
482
+
483
+ ### Bugs Fixed
484
+ - Pinning duckdb version to 1.3.2 for redteam extra to fix error `TypeError: unhashable type: '_duckdb.typing.DuckDBPyType'`
485
+
486
+ ## 1.11.0 (2025-09-03)
487
+
488
+ ### Features Added
489
+ - Added support for user-supplied tags in the `evaluate` function. Tags are key-value pairs that can be used for experiment tracking, A/B testing, filtering, and organizing evaluation runs. The function accepts a `tags` parameter.
490
+ - Added support for user-supplied TokenCredentials with LLM based evaluators.
491
+ - Enhanced `GroundednessEvaluator` to support AI agent evaluation with tool calls. The evaluator now accepts agent response data containing tool calls and can extract context from `file_search` tool results for groundedness assessment. This enables evaluation of AI agents that use tools to retrieve information and generate responses. Note: Agent groundedness evaluation is currently supported only when the `file_search` tool is used.
492
+ - Added `language` parameter to `RedTeam` class for multilingual red team scanning support. The parameter accepts values from `SupportedLanguages` enum including English, Spanish, French, German, Italian, Portuguese, Japanese, Korean, and Simplified Chinese, enabling red team attacks to be generated and conducted in multiple languages.
493
+ - Added support for IndirectAttack and UngroundedAttributes risk categories in `RedTeam` scanning. These new risk categories expand red team capabilities to detect cross-platform indirect attacks and evaluate ungrounded inferences about human attributes including emotional state and protected class information.
494
+
495
+ ### Bugs Fixed
496
+ - Fixed issue where evaluation results were not properly aligned with input data, leading to incorrect metrics being reported.
497
+
498
+ ### Other Changes
499
+ - Deprecating `AdversarialSimulator` in favor of the [AI Red Teaming Agent](https://aka.ms/airedteamingagent-sample). `AdversarialSimulator` will be removed in the next minor release.
500
+ - Moved retry configuration constants (`MAX_RETRY_ATTEMPTS`, `MAX_RETRY_WAIT_SECONDS`, `MIN_RETRY_WAIT_SECONDS`) from `RedTeam` class to new `RetryManager` class for better code organization and configurability.
501
+
502
+ ## 1.10.0 (2025-07-31)
503
+
504
+ ### Breaking Changes
505
+
506
+ - Added `evaluate_query` parameter to all RAI service evaluators that can be passed as a keyword argument. This parameter controls whether queries are included in evaluation data when evaluating query-response pairs. Previously, queries were always included in evaluations. When set to `True`, both query and response will be evaluated; when set to `False` (default), only the response will be evaluated. This parameter is available across all RAI service evaluators including `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator`, `ProtectedMaterialEvaluator`, `IndirectAttackEvaluator`, `CodeVulnerabilityEvaluator`, `UngroundedAttributesEvaluator`, `GroundednessProEvaluator`, and `EciEvaluator`. Existing code that relies on queries being evaluated will need to explicitly set `evaluate_query=True` to maintain the previous behavior.
507
+
508
+ ### Features Added
509
+
510
+ - Added support for Azure OpenAI Python grader via `AzureOpenAIPythonGrader` class, which serves as a wrapper around Azure Open AI Python grader configurations. This new grader object can be supplied to the main `evaluate` method as if it were a normal callable evaluator.
511
+ - Added `attack_success_thresholds` parameter to `RedTeam` class for configuring custom thresholds that determine attack success. This allows users to set specific threshold values for each risk category, with scores greater than the threshold considered successful attacks (i.e. higher threshold means higher
512
+ tolerance for harmful responses).
513
+ - Enhanced threshold reporting in RedTeam results to include default threshold values when custom thresholds aren't specified, providing better transparency about the evaluation criteria used.
514
+
515
+
516
+ ### Bugs Fixed
517
+
518
+ - Fixed red team scan `output_path` issue where individual evaluation results were overwriting each other instead of being preserved as separate files. Individual evaluations now create unique files while the user's `output_path` is reserved for final aggregated results.
519
+ - Significant improvements to TaskAdherence evaluator. New version has less variance, is much faster and consumes fewer tokens.
520
+ - Significant improvements to Relevance evaluator. New version has more concrete rubrics and has less variance, is much faster and consumes fewer tokens.
521
+
522
+
523
+ ### Other Changes
524
+
525
+ - The default engine for evaluation was changed from `promptflow` (PFClient) to an in-SDK batch client (RunSubmitterClient)
526
+ - Note: We've temporarily kept an escape hatch to fall back to the legacy `promptflow` implementation by setting `_use_pf_client=True` when invoking `evaluate()`.
527
+ This is due to be removed in a future release.
528
+
529
+
530
+ ## 1.9.0 (2025-07-02)
531
+
532
+ ### Features Added
533
+
534
+ - 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.
535
+ - Added new experimental risk categories ProtectedMaterial and CodeVulnerability for redteam agent scan.
536
+
537
+
538
+ ### Bugs Fixed
539
+
540
+ - Significant improvements to IntentResolution evaluator. New version has less variance, is nearly 2x faster and consumes fewer tokens.
541
+
542
+ - Fixes and improvements to ToolCallAccuracy evaluator. New version has less variance. and now works on all tool calls that happen in a turn at once. Previously, it worked on each tool call independently without having context on the other tool calls that happen in the same turn, and then aggregated the results to a score in the range [0-1]. The score range is now [1-5].
543
+ - 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)
544
+ - Added a new enum `ADVERSARIAL_QA_DOCUMENTS` which moves all the "file_content" type prompts away from `ADVERSARIAL_QA` to the new enum
545
+ - `AzureOpenAIScoreModelGrader` evaluator now supports `pass_threshold` parameter to set the minimum score required for a response to be considered passing. This allows users to define custom thresholds for evaluation results, enhancing flexibility in grading AI model responses.
546
+
547
+ ## 1.8.0 (2025-05-29)
548
+
549
+ ### Features Added
550
+
551
+ - Introduces `AttackStrategy.MultiTurn` and `AttackStrategy.Crescendo` to `RedTeam`. These strategies attack the target of a `RedTeam` scan over the course of multi-turn conversations.
552
+
553
+ ### Bugs Fixed
554
+ - AdversarialSimulator in `ADVERSARIAL_CONVERSATION` mode was broken. It is now fixed.
555
+
556
+ ## 1.7.0 (2025-05-12)
557
+
558
+ ### Bugs Fixed
559
+ - azure-ai-evaluation failed with module not found [#40992](https://github.com/Azure/azure-sdk-for-python/issues/40992)
560
+
561
+ ## 1.6.0 (2025-05-07)
562
+
563
+ ### Features Added
564
+ - New `<evaluator>.binary_aggregate` field added to evaluation result metrics. This field contains the aggregated binary evaluation results for each evaluator, providing a summary of the evaluation outcomes.
565
+ - Added support for Azure Open AI evaluation via 4 new 'grader' classes, which serve as wrappers around Azure Open AI grader configurations. These new grader objects can be supplied to the main `evaluate` method as if they were normal callable evaluators. The new classes are:
566
+ - AzureOpenAIGrader (general class for experienced users)
567
+ - AzureOpenAILabelGrader
568
+ - AzureOpenAIStringCheckGrader
569
+ - AzureOpenAITextSimilarityGrader
570
+
571
+ ### Breaking Changes
572
+ - In the experimental RedTeam's scan method, the `data_only` param has been replaced with `skip_evals` and if you do not want data to be uploaded, use the `skip_upload` flag.
573
+
574
+ ### Bugs Fixed
575
+ - Fixed error in `evaluate` where data fields could not contain numeric characters. Previously, a data file with schema:
576
+ ```
577
+ "query1": "some query", "response": "some response"
578
+ ```
579
+ throws error when passed into `evaluator_config` as `{"evaluator_name": {"column_mapping": {"query": "${data.query1}", "response": "${data.response}"}},}`.
580
+ Now, users may import data containing fields with numeric characters.
581
+
582
+
583
+ ## 1.5.0 (2025-04-04)
584
+
585
+ ### Features Added
586
+
587
+ - New `RedTeam` agent functionality to assess the safety and resilience of AI systems against adversarial prompt attacks
588
+
589
+ ## 1.4.0 (2025-03-27)
590
+
591
+ ### Features Added
592
+ - Enhanced binary evaluation results with customizable thresholds
593
+ - Added threshold support for QA and ContentSafety evaluators
594
+ - Evaluation results now include both the score and threshold values
595
+ - Configurable threshold parameter allows custom binary classification boundaries
596
+ - Default thresholds provided for backward compatibility
597
+ - Quality evaluators use "higher is better" scoring (score ≥ threshold is positive)
598
+ - Content safety evaluators use "lower is better" scoring (score ≤ threshold is positive)
599
+ - New Built-in evaluator called CodeVulnerabilityEvaluator is added.
600
+ - It provides capabilities to identify the following code vulnerabilities.
601
+ - path-injection
602
+ - sql-injection
603
+ - code-injection
604
+ - stack-trace-exposure
605
+ - incomplete-url-substring-sanitization
606
+ - flask-debug
607
+ - clear-text-logging-sensitive-data
608
+ - incomplete-hostname-regexp
609
+ - server-side-unvalidated-url-redirection
610
+ - weak-cryptographic-algorithm
611
+ - full-ssrf
612
+ - bind-socket-all-network-interfaces
613
+ - client-side-unvalidated-url-redirection
614
+ - likely-bugs
615
+ - reflected-xss
616
+ - clear-text-storage-sensitive-data
617
+ - tarslip
618
+ - hardcoded-credentials
619
+ - insecure-randomness
620
+ - It also supports multiple coding languages such as (Python, Java, C++, C#, Go, Javascript, SQL)
621
+
622
+ - New Built-in evaluator called UngroundedAttributesEvaluator is added.
623
+ - It evaluates ungrounded inference of human attributes for a given query, response, and context for a single-turn evaluation only,
624
+ - where query represents the user query and response represents the AI system response given the provided context.
625
+
626
+ - Ungrounded Attributes checks for whether a response is first, ungrounded, and checks if it contains information about protected class
627
+ - or emotional state of a person.
628
+
629
+ - It identifies the following attributes:
630
+
631
+ - emotional_state
632
+ - protected_class
633
+ - groundedness
634
+ - New Built-in evaluators for Agent Evaluation (Preview)
635
+ - IntentResolutionEvaluator - Evaluates the intent resolution of an agent's response to a user query.
636
+ - ResponseCompletenessEvaluator - Evaluates the response completeness of an agent's response to a user query.
637
+ - TaskAdherenceEvaluator - Evaluates the task adherence of an agent's response to a user query.
638
+ - ToolCallAccuracyEvaluator - Evaluates the accuracy of tool calls made by an agent in response to a user query.
639
+
640
+ ### Bugs Fixed
641
+ - Fixed error in `GroundednessProEvaluator` when handling non-numeric values like "n/a" returned from the service.
642
+ - Uploading local evaluation results from `evaluate` with the same run name will no longer result in each online run sharing (and bashing) result files.
643
+
644
+ ## 1.3.0 (2025-02-28)
645
+
646
+ ### Breaking Changes
647
+ - Multimodal specific evaluators `ContentSafetyMultimodalEvaluator`, `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` has been removed. Please use `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator` and `ProtectedMaterialEvaluator` instead.
648
+ - Metric name in ProtectedMaterialEvaluator's output is changed from `protected_material.fictional_characters_label` to `protected_material.fictional_characters_defect_rate`. It's now consistent with other evaluator's metric names (ending with `_defect_rate`).
649
+
650
+ ## 1.2.0 (2025-01-27)
651
+
652
+ ### Features Added
653
+ - CSV files are now supported as data file inputs with `evaluate()` API. The CSV file should have a header row with column names that match the `data` and `target` fields in the `evaluate()` method and the filename should be passed as the `data` parameter. Column name 'Conversation' in CSV file is not fully supported yet.
654
+
655
+ ### Breaking Changes
656
+ - `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be removed in next release.
657
+
658
+ ### Bugs Fixed
659
+ - Removed `[remote]` extra. This is no longer needed when tracking results in Azure AI Studio.
660
+ - Fixed `AttributeError: 'NoneType' object has no attribute 'get'` while running simulator with 1000+ results
661
+ - Fixed the non adversarial simulator to run in task-free mode
662
+ - Content safety evaluators (violence, self harm, sexual, hate/unfairness) return the maximum result as the
663
+ main score when aggregating per-turn evaluations from a conversation into an overall
664
+ evaluation score. Other conversation-capable evaluators still default to a mean for aggregation.
665
+ - Fixed bug in non adversarial simulator sample where `tasks` undefined
666
+
667
+ ### Other Changes
668
+ - Changed minimum required python version to use this package from 3.8 to 3.9
669
+ - Stop dependency on the local promptflow service. No promptflow service will automatically start when running evaluation.
670
+ - Evaluators internally allow for custom aggregation. However, this causes serialization failures if evaluated while the
671
+ environment variable `AI_EVALS_BATCH_USE_ASYNC` is set to false.
672
+
673
+ ## 1.1.0 (2024-12-12)
674
+
675
+ ### Features Added
676
+ - Added image support in `ContentSafetyEvaluator`, `ViolenceEvaluator`, `SexualEvaluator`, `SelfHarmEvaluator`, `HateUnfairnessEvaluator` and `ProtectedMaterialEvaluator`. Provide image URLs or base64 encoded images in `conversation` input for image evaluation. See below for an example:
677
+
678
+ ```python
679
+ evaluator = ContentSafetyEvaluator(credential=azure_cred, azure_ai_project=project_scope)
680
+ conversation = {
681
+ "messages": [
682
+ {
683
+ "role": "system",
684
+ "content": [
685
+ {"type": "text", "text": "You are an AI assistant that understands images."}
686
+ ],
687
+ },
688
+ {
689
+ "role": "user",
690
+ "content": [
691
+ {"type": "text", "text": "Can you describe this image?"},
692
+ {
693
+ "type": "image_url",
694
+ "image_url": {
695
+ "url": "https://cdn.britannica.com/68/178268-050-5B4E7FB6/Tom-Cruise-2013.jpg"
696
+ },
697
+ },
698
+ ],
699
+ },
700
+ {
701
+ "role": "assistant",
702
+ "content": [
703
+ {
704
+ "type": "text",
705
+ "text": "The image shows a man with short brown hair smiling, wearing a dark-colored shirt.",
706
+ }
707
+ ],
708
+ },
709
+ ]
710
+ }
711
+ print("Calling Content Safety Evaluator for multi-modal")
712
+ score = evaluator(conversation=conversation)
713
+ ```
714
+
715
+ - Please switch to generic evaluators for image evaluations as mentioned above. `ContentSafetyMultimodalEvaluator`, `ContentSafetyMultimodalEvaluatorBase`, `ViolenceMultimodalEvaluator`, `SexualMultimodalEvaluator`, `SelfHarmMultimodalEvaluator`, `HateUnfairnessMultimodalEvaluator` and `ProtectedMaterialMultimodalEvaluator` will be deprecated in the next release.
716
+
717
+ ### Bugs Fixed
718
+ - Removed `[remote]` extra. This is no longer needed when tracking results in Azure AI Foundry portal.
719
+ - Fixed `AttributeError: 'NoneType' object has no attribute 'get'` while running simulator with 1000+ results
720
+
721
+ ## 1.0.1 (2024-11-15)
722
+
723
+ ### Bugs Fixed
724
+ - Removing `azure-ai-inference` as dependency.
725
+ - Fixed `AttributeError: 'NoneType' object has no attribute 'get'` while running simulator with 1000+ results
726
+
727
+ ## 1.0.0 (2024-11-13)
728
+
729
+ ### Breaking Changes
730
+ - The `parallel` parameter has been removed from composite evaluators: `QAEvaluator`, `ContentSafetyChatEvaluator`, and `ContentSafetyMultimodalEvaluator`. To control evaluator parallelism, you can now use the `_parallel` keyword argument, though please note that this private parameter may change in the future.
731
+ - Parameters `query_response_generating_prompty_kwargs` and `user_simulator_prompty_kwargs` have been renamed to `query_response_generating_prompty_options` and `user_simulator_prompty_options` in the Simulator's __call__ method.
732
+
733
+ ### Bugs Fixed
734
+ - Fixed an issue where the `output_path` parameter in the `evaluate` API did not support relative path.
735
+ - Output of adversarial simulators are of type `JsonLineList` and the helper function `to_eval_qr_json_lines` now outputs context from both user and assistant turns along with `category` if it exists in the conversation
736
+ - Fixed an issue where during long-running simulations, API token expires causing "Forbidden" error. Instead, users can now set an environment variable `AZURE_TOKEN_REFRESH_INTERVAL` to refresh the token more frequently to prevent expiration and ensure continuous operation of the simulation.
737
+ - Fixed an issue with the `ContentSafetyEvaluator` that caused parallel execution of sub-evaluators to fail. Parallel execution is now enabled by default again, but can still be disabled via the '_parallel' boolean keyword argument during class initialization.
738
+ - Fix `evaluate` function not producing aggregated metrics if ANY values to be aggregated were None, NaN, or
739
+ otherwise difficult to process. Such values are ignored fully, so the aggregated metric of `[1, 2, 3, NaN]`
740
+ would be 2, not 1.5.
741
+
742
+ ### Other Changes
743
+ - Refined error messages for serviced-based evaluators and simulators.
744
+ - Tracing has been disabled due to Cosmos DB initialization issue.
745
+ - Introduced environment variable `AI_EVALS_DISABLE_EXPERIMENTAL_WARNING` to disable the warning message for experimental features.
746
+ - Changed the randomization pattern for `AdversarialSimulator` such that there is an almost equal number of Adversarial harm categories (e.g. Hate + Unfairness, Self-Harm, Violence, Sex) represented in the `AdversarialSimulator` outputs. Previously, for 200 `max_simulation_results` a user might see 140 results belonging to the 'Hate + Unfairness' category and 40 results belonging to the 'Self-Harm' category. Now, user will see 50 results for each of Hate + Unfairness, Self-Harm, Violence, and Sex.
747
+ - For the `DirectAttackSimulator`, the prompt templates used to generate simulated outputs for each Adversarial harm category will no longer be in a randomized order by default. To override this behavior, pass `randomize_order=True` when you call the `DirectAttackSimulator`, for example:
748
+ ```python
749
+ adversarial_simulator = DirectAttackSimulator(azure_ai_project=azure_ai_project, credential=DefaultAzureCredential())
750
+ outputs = asyncio.run(
751
+ adversarial_simulator(
752
+ scenario=scenario,
753
+ target=callback,
754
+ randomize_order=True
755
+ )
756
+ )
757
+ ```
758
+
759
+ ## 1.0.0b5 (2024-10-28)
760
+
761
+ ### Features Added
762
+ - Added `GroundednessProEvaluator`, which is a service-based evaluator for determining response groundedness.
763
+ - Groundedness detection in Non Adversarial Simulator via query/context pairs
764
+ ```python
765
+ import importlib.resources as pkg_resources
766
+ package = "azure.ai.evaluation.simulator._data_sources"
767
+ resource_name = "grounding.json"
768
+ custom_simulator = Simulator(model_config=model_config)
769
+ conversation_turns = []
770
+ with pkg_resources.path(package, resource_name) as grounding_file:
771
+ with open(grounding_file, "r") as file:
772
+ data = json.load(file)
773
+ for item in data:
774
+ conversation_turns.append([item])
775
+ outputs = asyncio.run(custom_simulator(
776
+ target=callback,
777
+ conversation_turns=conversation_turns,
778
+ max_conversation_turns=1,
779
+ ))
780
+ ```
781
+ - Adding evaluator for multimodal use cases
782
+
783
+ ### Breaking Changes
784
+ - Renamed environment variable `PF_EVALS_BATCH_USE_ASYNC` to `AI_EVALS_BATCH_USE_ASYNC`.
785
+ - `RetrievalEvaluator` now requires a `context` input in addition to `query` in single-turn evaluation.
786
+ - `RelevanceEvaluator` no longer takes `context` as an input. It now only takes `query` and `response` in single-turn evaluation.
787
+ - `FluencyEvaluator` no longer takes `query` as an input. It now only takes `response` in single-turn evaluation.
788
+ - AdversarialScenario enum does not include `ADVERSARIAL_INDIRECT_JAILBREAK`, invoking IndirectJailbreak or XPIA should be done with `IndirectAttackSimulator`
789
+ - Outputs of `Simulator` and `AdversarialSimulator` previously had `to_eval_qa_json_lines` and now has `to_eval_qr_json_lines`. Where `to_eval_qa_json_lines` had:
790
+ ```json
791
+ {"question": <user_message>, "answer": <assistant_message>}
792
+ ```
793
+ `to_eval_qr_json_lines` now has:
794
+ ```json
795
+ {"query": <user_message>, "response": assistant_message}
796
+ ```
797
+
798
+ ### Bugs Fixed
799
+ - Non adversarial simulator works with `gpt-4o` models using the `json_schema` response format
800
+ - Fixed an issue where the `evaluate` API would fail with "[WinError 32] The process cannot access the file because it is being used by another process" when venv folder and target function file are in the same directory.
801
+ - Fix evaluate API failure when `trace.destination` is set to `none`
802
+ - Non adversarial simulator now accepts context from the callback
803
+
804
+ ### Other Changes
805
+ - Improved error messages for the `evaluate` API by enhancing the validation of input parameters. This update provides more detailed and actionable error descriptions.
806
+ - `GroundednessEvaluator` now supports `query` as an optional input in single-turn evaluation. If `query` is provided, a different prompt template will be used for the evaluation.
807
+ - To align with our support of a diverse set of models, the following evaluators will now have a new key in their result output without the `gpt_` prefix. To maintain backwards compatibility, the old key with the `gpt_` prefix will still be present in the output; however, it is recommended to use the new key moving forward as the old key will be deprecated in the future.
808
+ - `CoherenceEvaluator`
809
+ - `RelevanceEvaluator`
810
+ - `FluencyEvaluator`
811
+ - `GroundednessEvaluator`
812
+ - `SimilarityEvaluator`
813
+ - `RetrievalEvaluator`
814
+ - The following evaluators will now have a new key in their result output including LLM reasoning behind the score. The new key will follow the pattern "<metric_name>_reason". The reasoning is the result of a more detailed prompt template being used to generate the LLM response. Note that this requires the maximum number of tokens used to run these evaluators to be increased.
815
+
816
+ | Evaluator | New `max_token` for Generation |
817
+ | --- | --- |
818
+ | `CoherenceEvaluator` | 800 |
819
+ | `RelevanceEvaluator` | 800 |
820
+ | `FluencyEvaluator` | 800 |
821
+ | `GroundednessEvaluator` | 800 |
822
+ | `RetrievalEvaluator` | 1600 |
823
+ - Improved the error message for storage access permission issues to provide clearer guidance for users.
824
+
825
+ ## 1.0.0b4 (2024-10-16)
826
+
827
+ ### Breaking Changes
828
+
829
+ - Removed `numpy` dependency. All NaN values returned by the SDK have been changed to from `numpy.nan` to `math.nan`.
830
+ - `credential` is now required to be passed in for all content safety evaluators and `ProtectedMaterialsEvaluator`. `DefaultAzureCredential` will no longer be chosen if a credential is not passed.
831
+ - Changed package extra name from "pf-azure" to "remote".
832
+
833
+ ### Bugs Fixed
834
+ - Adversarial Conversation simulations would fail with `Forbidden`. Added logic to re-fetch token in the exponential retry logic to retrive RAI Service response.
835
+ - Fixed an issue where the Evaluate API did not fail due to missing inputs when the target did not return columns required by the evaluators.
836
+
837
+ ### Other Changes
838
+ - Enhance the error message to provide clearer instruction when required packages for the remote tracking feature are missing.
839
+ - Print the per-evaluator run summary at the end of the Evaluate API call to make troubleshooting row-level failures easier.
840
+
841
+ ## 1.0.0b3 (2024-10-01)
842
+
843
+ ### Features Added
844
+
845
+ - Added `type` field to `AzureOpenAIModelConfiguration` and `OpenAIModelConfiguration`
846
+ - The following evaluators now support `conversation` as an alternative input to their usual single-turn inputs:
847
+ - `ViolenceEvaluator`
848
+ - `SexualEvaluator`
849
+ - `SelfHarmEvaluator`
850
+ - `HateUnfairnessEvaluator`
851
+ - `ProtectedMaterialEvaluator`
852
+ - `IndirectAttackEvaluator`
853
+ - `CoherenceEvaluator`
854
+ - `RelevanceEvaluator`
855
+ - `FluencyEvaluator`
856
+ - `GroundednessEvaluator`
857
+ - Surfaced `RetrievalScoreEvaluator`, formally an internal part of `ChatEvaluator` as a standalone conversation-only evaluator.
858
+
859
+ ### Breaking Changes
860
+
861
+ - Removed `ContentSafetyChatEvaluator` and `ChatEvaluator`
862
+ - The `evaluator_config` parameter of `evaluate` now maps in evaluator name to a dictionary `EvaluatorConfig`, which is a `TypedDict`. The
863
+ `column_mapping` between `data` or `target` and evaluator field names should now be specified inside this new dictionary:
864
+
865
+ Before:
866
+ ```python
867
+ evaluate(
868
+ ...,
869
+ evaluator_config={
870
+ "hate_unfairness": {
871
+ "query": "${data.question}",
872
+ "response": "${data.answer}",
873
+ }
874
+ },
875
+ ...
876
+ )
877
+ ```
878
+
879
+ After
880
+ ```python
881
+ evaluate(
882
+ ...,
883
+ evaluator_config={
884
+ "hate_unfairness": {
885
+ "column_mapping": {
886
+ "query": "${data.question}",
887
+ "response": "${data.answer}",
888
+ }
889
+ }
890
+ },
891
+ ...
892
+ )
893
+ ```
894
+
895
+ - Simulator now requires a model configuration to call the prompty instead of an Azure AI project scope. This enables the usage of simulator with Entra ID based auth.
896
+ Before:
897
+ ```python
898
+ azure_ai_project = {
899
+ "subscription_id": os.environ.get("AZURE_SUBSCRIPTION_ID"),
900
+ "resource_group_name": os.environ.get("RESOURCE_GROUP"),
901
+ "project_name": os.environ.get("PROJECT_NAME"),
902
+ }
903
+ sim = Simulator(azure_ai_project=azure_ai_project, credentails=DefaultAzureCredentials())
904
+ ```
905
+ After:
906
+ ```python
907
+ model_config = {
908
+ "azure_endpoint": os.environ.get("AZURE_OPENAI_ENDPOINT"),
909
+ "azure_deployment": os.environ.get("AZURE_DEPLOYMENT"),
910
+ }
911
+ sim = Simulator(model_config=model_config)
912
+ ```
913
+ If `api_key` is not included in the `model_config`, the prompty runtime in `promptflow-core` will pick up `DefaultAzureCredential`.
914
+
915
+ ### Bugs Fixed
916
+
917
+ - Fixed issue where Entra ID authentication was not working with `AzureOpenAIModelConfiguration`
918
+
919
+ ## 1.0.0b2 (2024-09-24)
920
+
921
+ ### Breaking Changes
922
+
923
+ - `data` and `evaluators` are now required keywords in `evaluate`.
924
+
925
+ ## 1.0.0b1 (2024-09-20)
926
+
927
+ ### Breaking Changes
928
+
929
+ - The `synthetic` namespace has been renamed to `simulator`, and sub-namespaces under this module have been removed
930
+ - The `evaluate` and `evaluators` namespaces have been removed, and everything previously exposed in those modules has been added to the root namespace `azure.ai.evaluation`
931
+ - The parameter name `project_scope` in content safety evaluators have been renamed to `azure_ai_project` for consistency with evaluate API and simulators.
932
+ - Model configurations classes are now of type `TypedDict` and are exposed in the `azure.ai.evaluation` module instead of coming from `promptflow.core`.
933
+ - Updated the parameter names for `question` and `answer` in built-in evaluators to more generic terms: `query` and `response`.
934
+
935
+ ### Features Added
936
+
937
+ - First preview
938
+ - This package is port of `promptflow-evals`. New features will be added only to this package moving forward.
939
+ - Added a `TypedDict` for `AzureAIProject` that allows for better intellisense and type checking when passing in project information