azure-ai-evaluation 1.8.0__py3-none-any.whl → 1.10.0__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 (142) hide show
  1. azure/ai/evaluation/__init__.py +51 -6
  2. azure/ai/evaluation/_aoai/__init__.py +1 -1
  3. azure/ai/evaluation/_aoai/aoai_grader.py +21 -11
  4. azure/ai/evaluation/_aoai/label_grader.py +3 -2
  5. azure/ai/evaluation/_aoai/python_grader.py +84 -0
  6. azure/ai/evaluation/_aoai/score_model_grader.py +91 -0
  7. azure/ai/evaluation/_aoai/string_check_grader.py +3 -2
  8. azure/ai/evaluation/_aoai/text_similarity_grader.py +3 -2
  9. azure/ai/evaluation/_azure/_envs.py +9 -10
  10. azure/ai/evaluation/_azure/_token_manager.py +7 -1
  11. azure/ai/evaluation/_common/constants.py +11 -2
  12. azure/ai/evaluation/_common/evaluation_onedp_client.py +32 -26
  13. azure/ai/evaluation/_common/onedp/__init__.py +32 -32
  14. azure/ai/evaluation/_common/onedp/_client.py +136 -139
  15. azure/ai/evaluation/_common/onedp/_configuration.py +70 -73
  16. azure/ai/evaluation/_common/onedp/_patch.py +21 -21
  17. azure/ai/evaluation/_common/onedp/_utils/__init__.py +6 -0
  18. azure/ai/evaluation/_common/onedp/_utils/model_base.py +1232 -0
  19. azure/ai/evaluation/_common/onedp/_utils/serialization.py +2032 -0
  20. azure/ai/evaluation/_common/onedp/_validation.py +50 -50
  21. azure/ai/evaluation/_common/onedp/_version.py +9 -9
  22. azure/ai/evaluation/_common/onedp/aio/__init__.py +29 -29
  23. azure/ai/evaluation/_common/onedp/aio/_client.py +138 -143
  24. azure/ai/evaluation/_common/onedp/aio/_configuration.py +70 -75
  25. azure/ai/evaluation/_common/onedp/aio/_patch.py +21 -21
  26. azure/ai/evaluation/_common/onedp/aio/operations/__init__.py +37 -39
  27. azure/ai/evaluation/_common/onedp/aio/operations/_operations.py +4832 -4494
  28. azure/ai/evaluation/_common/onedp/aio/operations/_patch.py +21 -21
  29. azure/ai/evaluation/_common/onedp/models/__init__.py +168 -142
  30. azure/ai/evaluation/_common/onedp/models/_enums.py +230 -162
  31. azure/ai/evaluation/_common/onedp/models/_models.py +2685 -2228
  32. azure/ai/evaluation/_common/onedp/models/_patch.py +21 -21
  33. azure/ai/evaluation/_common/onedp/operations/__init__.py +37 -39
  34. azure/ai/evaluation/_common/onedp/operations/_operations.py +6106 -5657
  35. azure/ai/evaluation/_common/onedp/operations/_patch.py +21 -21
  36. azure/ai/evaluation/_common/rai_service.py +88 -52
  37. azure/ai/evaluation/_common/raiclient/__init__.py +1 -1
  38. azure/ai/evaluation/_common/raiclient/operations/_operations.py +14 -1
  39. azure/ai/evaluation/_common/utils.py +188 -10
  40. azure/ai/evaluation/_constants.py +2 -1
  41. azure/ai/evaluation/_converters/__init__.py +1 -1
  42. azure/ai/evaluation/_converters/_ai_services.py +9 -8
  43. azure/ai/evaluation/_converters/_models.py +46 -0
  44. azure/ai/evaluation/_converters/_sk_services.py +495 -0
  45. azure/ai/evaluation/_eval_mapping.py +2 -2
  46. azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py +73 -25
  47. azure/ai/evaluation/_evaluate/_batch_run/eval_run_context.py +2 -2
  48. azure/ai/evaluation/_evaluate/_evaluate.py +210 -94
  49. azure/ai/evaluation/_evaluate/_evaluate_aoai.py +132 -89
  50. azure/ai/evaluation/_evaluate/_telemetry/__init__.py +0 -1
  51. azure/ai/evaluation/_evaluate/_utils.py +25 -17
  52. azure/ai/evaluation/_evaluators/_bleu/_bleu.py +4 -4
  53. azure/ai/evaluation/_evaluators/_code_vulnerability/_code_vulnerability.py +20 -12
  54. azure/ai/evaluation/_evaluators/_coherence/_coherence.py +6 -6
  55. azure/ai/evaluation/_evaluators/_common/_base_eval.py +45 -11
  56. azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py +24 -9
  57. azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py +24 -9
  58. azure/ai/evaluation/_evaluators/_content_safety/_content_safety.py +28 -18
  59. azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py +11 -8
  60. azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py +11 -8
  61. azure/ai/evaluation/_evaluators/_content_safety/_sexual.py +12 -9
  62. azure/ai/evaluation/_evaluators/_content_safety/_violence.py +10 -7
  63. azure/ai/evaluation/_evaluators/_document_retrieval/__init__.py +1 -5
  64. azure/ai/evaluation/_evaluators/_document_retrieval/_document_retrieval.py +37 -64
  65. azure/ai/evaluation/_evaluators/_eci/_eci.py +6 -3
  66. azure/ai/evaluation/_evaluators/_f1_score/_f1_score.py +5 -5
  67. azure/ai/evaluation/_evaluators/_fluency/_fluency.py +3 -3
  68. azure/ai/evaluation/_evaluators/_gleu/_gleu.py +4 -4
  69. azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py +12 -8
  70. azure/ai/evaluation/_evaluators/_intent_resolution/_intent_resolution.py +31 -26
  71. azure/ai/evaluation/_evaluators/_intent_resolution/intent_resolution.prompty +210 -96
  72. azure/ai/evaluation/_evaluators/_meteor/_meteor.py +3 -4
  73. azure/ai/evaluation/_evaluators/_protected_material/_protected_material.py +14 -7
  74. azure/ai/evaluation/_evaluators/_qa/_qa.py +5 -5
  75. azure/ai/evaluation/_evaluators/_relevance/_relevance.py +62 -15
  76. azure/ai/evaluation/_evaluators/_relevance/relevance.prompty +140 -59
  77. azure/ai/evaluation/_evaluators/_response_completeness/_response_completeness.py +21 -26
  78. azure/ai/evaluation/_evaluators/_retrieval/_retrieval.py +5 -5
  79. azure/ai/evaluation/_evaluators/_rouge/_rouge.py +22 -22
  80. azure/ai/evaluation/_evaluators/_service_groundedness/_service_groundedness.py +7 -6
  81. azure/ai/evaluation/_evaluators/_similarity/_similarity.py +4 -4
  82. azure/ai/evaluation/_evaluators/_task_adherence/_task_adherence.py +27 -24
  83. azure/ai/evaluation/_evaluators/_task_adherence/task_adherence.prompty +354 -66
  84. azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py +175 -183
  85. azure/ai/evaluation/_evaluators/_tool_call_accuracy/tool_call_accuracy.prompty +99 -21
  86. azure/ai/evaluation/_evaluators/_ungrounded_attributes/_ungrounded_attributes.py +20 -12
  87. azure/ai/evaluation/_evaluators/_xpia/xpia.py +10 -7
  88. azure/ai/evaluation/_exceptions.py +10 -0
  89. azure/ai/evaluation/_http_utils.py +3 -3
  90. azure/ai/evaluation/_legacy/_batch_engine/_config.py +6 -3
  91. azure/ai/evaluation/_legacy/_batch_engine/_engine.py +117 -32
  92. azure/ai/evaluation/_legacy/_batch_engine/_openai_injector.py +5 -2
  93. azure/ai/evaluation/_legacy/_batch_engine/_result.py +2 -0
  94. azure/ai/evaluation/_legacy/_batch_engine/_run.py +2 -2
  95. azure/ai/evaluation/_legacy/_batch_engine/_run_submitter.py +33 -41
  96. azure/ai/evaluation/_legacy/_batch_engine/_utils.py +1 -4
  97. azure/ai/evaluation/_legacy/_common/_async_token_provider.py +12 -19
  98. azure/ai/evaluation/_legacy/_common/_thread_pool_executor_with_context.py +2 -0
  99. azure/ai/evaluation/_legacy/prompty/_prompty.py +11 -5
  100. azure/ai/evaluation/_safety_evaluation/__init__.py +1 -1
  101. azure/ai/evaluation/_safety_evaluation/_safety_evaluation.py +195 -111
  102. azure/ai/evaluation/_user_agent.py +32 -1
  103. azure/ai/evaluation/_version.py +1 -1
  104. azure/ai/evaluation/red_team/__init__.py +3 -1
  105. azure/ai/evaluation/red_team/_agent/__init__.py +1 -1
  106. azure/ai/evaluation/red_team/_agent/_agent_functions.py +68 -71
  107. azure/ai/evaluation/red_team/_agent/_agent_tools.py +103 -145
  108. azure/ai/evaluation/red_team/_agent/_agent_utils.py +26 -6
  109. azure/ai/evaluation/red_team/_agent/_semantic_kernel_plugin.py +62 -71
  110. azure/ai/evaluation/red_team/_attack_objective_generator.py +94 -52
  111. azure/ai/evaluation/red_team/_attack_strategy.py +2 -1
  112. azure/ai/evaluation/red_team/_callback_chat_target.py +4 -9
  113. azure/ai/evaluation/red_team/_default_converter.py +1 -1
  114. azure/ai/evaluation/red_team/_red_team.py +1947 -1040
  115. azure/ai/evaluation/red_team/_red_team_result.py +49 -38
  116. azure/ai/evaluation/red_team/_utils/__init__.py +1 -1
  117. azure/ai/evaluation/red_team/_utils/_rai_service_eval_chat_target.py +39 -34
  118. azure/ai/evaluation/red_team/_utils/_rai_service_target.py +163 -138
  119. azure/ai/evaluation/red_team/_utils/_rai_service_true_false_scorer.py +14 -14
  120. azure/ai/evaluation/red_team/_utils/constants.py +1 -13
  121. azure/ai/evaluation/red_team/_utils/formatting_utils.py +41 -44
  122. azure/ai/evaluation/red_team/_utils/logging_utils.py +17 -17
  123. azure/ai/evaluation/red_team/_utils/metric_mapping.py +31 -4
  124. azure/ai/evaluation/red_team/_utils/strategy_utils.py +33 -25
  125. azure/ai/evaluation/simulator/_adversarial_scenario.py +2 -0
  126. azure/ai/evaluation/simulator/_adversarial_simulator.py +31 -17
  127. azure/ai/evaluation/simulator/_conversation/__init__.py +2 -2
  128. azure/ai/evaluation/simulator/_direct_attack_simulator.py +8 -8
  129. azure/ai/evaluation/simulator/_indirect_attack_simulator.py +18 -6
  130. azure/ai/evaluation/simulator/_model_tools/_generated_rai_client.py +54 -24
  131. azure/ai/evaluation/simulator/_model_tools/_identity_manager.py +7 -1
  132. azure/ai/evaluation/simulator/_model_tools/_proxy_completion_model.py +30 -10
  133. azure/ai/evaluation/simulator/_model_tools/_rai_client.py +19 -31
  134. azure/ai/evaluation/simulator/_model_tools/_template_handler.py +20 -6
  135. azure/ai/evaluation/simulator/_model_tools/models.py +1 -1
  136. azure/ai/evaluation/simulator/_simulator.py +21 -8
  137. {azure_ai_evaluation-1.8.0.dist-info → azure_ai_evaluation-1.10.0.dist-info}/METADATA +46 -3
  138. {azure_ai_evaluation-1.8.0.dist-info → azure_ai_evaluation-1.10.0.dist-info}/RECORD +141 -136
  139. azure/ai/evaluation/_common/onedp/aio/_vendor.py +0 -40
  140. {azure_ai_evaluation-1.8.0.dist-info → azure_ai_evaluation-1.10.0.dist-info}/NOTICE.txt +0 -0
  141. {azure_ai_evaluation-1.8.0.dist-info → azure_ai_evaluation-1.10.0.dist-info}/WHEEL +0 -0
  142. {azure_ai_evaluation-1.8.0.dist-info → azure_ai_evaluation-1.10.0.dist-info}/top_level.txt +0 -0
@@ -1,162 +1,230 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) Python Code Generator.
6
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- # --------------------------------------------------------------------------
8
-
9
- from enum import Enum
10
- from azure.core import CaseInsensitiveEnumMeta
11
-
12
-
13
- class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
14
- """Strategies for attacks."""
15
-
16
- EASY = "easy"
17
- """Represents a default set of easy complexity attacks. Easy complexity attack strategies are
18
- defined as attacks that do not require any Large Language Model to convert or orchestrate."""
19
- ASCII_ART = "ascii_art"
20
- """Represents ASCII art, a graphic design technique that uses printable characters."""
21
- ASCII_SMUGGLER = "ascii_smuggler"
22
- """Represents ASCII smuggling, a technique for encoding or hiding data."""
23
- ATBASH = "atbash"
24
- """Represents the Atbash cipher, a substitution cipher that reverses the alphabet."""
25
- BASE64 = "base64"
26
- """Represents Base64 encoding, a method for encoding binary data as text."""
27
- BINARY = "binary"
28
- """Represents binary encoding, a representation of data in binary format."""
29
- CAESAR = "caesar"
30
- """Represents the Caesar cipher, a substitution cipher that shifts characters."""
31
- CHARACTER_SPACE = "character_space"
32
- """Represents character space manipulation, a technique involving spacing between characters."""
33
- JAILBREAK = "jailbreak"
34
- """Represents character swapping, a technique for rearranging characters in text."""
35
-
36
-
37
- class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
38
- """The Type (or category) of the connection."""
39
-
40
- AZURE_OPEN_AI = "AzureOpenAI"
41
- """Azure OpenAI Service"""
42
- AZURE_BLOB_STORAGE = "AzureBlob"
43
- """Azure Blob Storage, with specified container"""
44
- AZURE_STORAGE_ACCOUNT = "AzureStorageAccount"
45
- """Azure Blob Storage, with container not specified (used by Assistants)"""
46
- AZURE_AI_SEARCH = "CognitiveSearch"
47
- """Azure AI Search"""
48
- COSMOS_DB = "CosmosDB"
49
- """CosmosDB"""
50
- API_KEY = "ApiKey"
51
- """Generic connection that uses API Key authentication"""
52
- APPLICATION_CONFIGURATION = "AppConfig"
53
- """Application Configuration"""
54
- APPLICATION_INSIGHTS = "AppInsights"
55
- """Application Insights"""
56
- CUSTOM = "CustomKeys"
57
- """Custom Keys"""
58
-
59
-
60
- class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
61
- """The credential type used by the connection."""
62
-
63
- API_KEY = "ApiKey"
64
- """API Key credential"""
65
- ENTRA_ID = "AAD"
66
- """Entra ID credential (formerly known as AAD)"""
67
- SAS = "SAS"
68
- """Shared Access Signature (SAS) credential"""
69
- CUSTOM = "CustomKeys"
70
- """Custom credential"""
71
- NONE = "None"
72
- """No credential"""
73
-
74
-
75
- class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
76
- """Enum to determine the type of data."""
77
-
78
- URI_FILE = "uri_file"
79
- """URI file."""
80
- URI_FOLDER = "uri_folder"
81
- """URI folder."""
82
-
83
-
84
- class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
85
- """Type of DeploymentType."""
86
-
87
- MODEL_DEPLOYMENT = "ModelDeployment"
88
- """Model deployment"""
89
-
90
-
91
- class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
92
- """Type of IndexType."""
93
-
94
- AZURE_SEARCH = "AzureSearch"
95
- """Azure search"""
96
- COSMOS_DB = "CosmosDBNoSqlVectorStore"
97
- """CosmosDB"""
98
- MANAGED_AZURE_SEARCH = "ManagedAzureSearch"
99
- """Managed Azure Search"""
100
-
101
-
102
- class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
103
- """List View Type Definition."""
104
-
105
- ACTIVE_ONLY = "ActiveOnly"
106
- """List only active items."""
107
- ARCHIVED_ONLY = "ArchivedOnly"
108
- """List only archived items."""
109
- ALL = "All"
110
- """List all items."""
111
-
112
-
113
- class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
114
- """The type of pending upload."""
115
-
116
- NONE = "None"
117
- """No pending upload."""
118
- TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference"
119
- """Temporary Blob Reference is the only supported type."""
120
-
121
-
122
- class ResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
123
- """Type of Evaluation result."""
124
-
125
- BENCHMARK = "Benchmark"
126
- """Benchmark result"""
127
- EVALUATION = "Evaluation"
128
- """Evaluations Result"""
129
- REDTEAM = "Redteam"
130
- """Red Team Result"""
131
- SIMULATION = "Simulation"
132
- """Simulation Result"""
133
-
134
-
135
- class RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta):
136
- """Risk category for the attack objective."""
137
-
138
- HATE_UNFAIRNESS = "HateUnfairness"
139
- """Represents content related to hate or unfairness."""
140
- VIOLENCE = "Violence"
141
- """Represents content related to violence."""
142
- SEXUAL = "Sexual"
143
- """Represents content of a sexual nature."""
144
- SELF_HARM = "SelfHarm"
145
- """Represents content related to self-harm."""
146
- PROTECTED_MATERIAL = "ProtectedMaterial"
147
- """Represents content involving protected material."""
148
- CODE_VULNERABILITY = "CodeVulnerability"
149
- """Represents content related to code vulnerabilities."""
150
- UNGROUNDED_ATTRIBUTES = "UngroundedAttributes"
151
- """Represents content with ungrounded attributes."""
152
-
153
-
154
- class SimulationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
155
- """Simulation type."""
156
-
157
- DEFAULT = "Default"
158
- """Default simulation type."""
159
- CUSTOM_PERSONA = "CustomPersona"
160
- """Custom persona simulation type."""
161
- HARM_TURN_GENERATOR = "HarmTurnGenerator"
162
- """Harm turn generator simulation type."""
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) Python Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ from enum import Enum
10
+ from azure.core import CaseInsensitiveEnumMeta
11
+
12
+
13
+ class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
14
+ """Strategies for attacks."""
15
+
16
+ EASY = "easy"
17
+ """Represents a default set of easy complexity attacks. Easy complexity attacks require less
18
+ effort, such as translation of a prompt into some encoding, and does not require any Large
19
+ Language Model to convert or orchestrate."""
20
+ MODERATE = "moderate"
21
+ """Represents a default set of moderate complexity attacks. Moderate complexity attacks require
22
+ having access to resources such as another generative AI model."""
23
+ DIFFICULT = "difficult"
24
+ """Represents a default set of difficult complexity attacks. Difficult complexity attacks include
25
+ attacks that require access to significant resources and effort to execute an attack such as
26
+ knowledge of search-based algorithms in addition to a generative AI model."""
27
+ ASCII_ART = "ascii_art"
28
+ """Generates visual art using ASCII characters, often used for creative or obfuscation purposes."""
29
+ ASCII_SMUGGLER = "ascii_smuggler"
30
+ """Conceals data within ASCII characters, making it harder to detect."""
31
+ ATBASH = "atbash"
32
+ """Implements the Atbash cipher, a simple substitution cipher where each letter is mapped to its
33
+ reverse."""
34
+ BASE64 = "base64"
35
+ """Encodes binary data into a text format using Base64, commonly used for data transmission."""
36
+ BINARY = "binary"
37
+ """Converts text into binary code, representing data in a series of 0s and 1s."""
38
+ CAESAR = "caesar"
39
+ """Applies the Caesar cipher, a substitution cipher that shifts characters by a fixed number of
40
+ positions."""
41
+ CHARACTER_SPACE = "character_space"
42
+ """Alters text by adding spaces between characters, often used for obfuscation."""
43
+ JAILBREAK = "jailbreak"
44
+ """Injects specially crafted prompts to bypass AI safeguards, known as User Injected Prompt
45
+ Attacks (UPIA)."""
46
+ ANSII_ATTACK = "ansii_attack"
47
+ """Utilizes ANSI escape sequences to manipulate text appearance and behavior."""
48
+ CHARACTER_SWAP = "character_swap"
49
+ """Swaps characters within text to create variations or obfuscate the original content."""
50
+ SUFFIX_APPEND = "suffix_append"
51
+ """Appends an adversarial suffix to the prompt."""
52
+ STRING_JOIN = "string_join"
53
+ """Joins multiple strings together, often used for concatenation or obfuscation."""
54
+ UNICODE_CONFUSABLE = "unicode_confusable"
55
+ """Uses Unicode characters that look similar to standard characters, creating visual confusion."""
56
+ UNICODE_SUBSTITUTION = "unicode_substitution"
57
+ """Substitutes standard characters with Unicode equivalents, often for obfuscation."""
58
+ DIACRITIC = "diacritic"
59
+ """Adds diacritical marks to characters, changing their appearance and sometimes their meaning."""
60
+ FLIP = "flip"
61
+ """Flips characters from front to back, creating a mirrored effect."""
62
+ LEETSPEAK = "leetspeak"
63
+ """Transforms text into Leetspeak, a form of encoding that replaces letters with similar-looking
64
+ numbers or symbols."""
65
+ ROT13 = "rot13"
66
+ """Applies the ROT13 cipher, a simple substitution cipher that shifts characters by 13 positions."""
67
+ MORSE = "morse"
68
+ """Encodes text into Morse code, using dots and dashes to represent characters."""
69
+ URL = "url"
70
+ """Encodes text into URL format."""
71
+ BASELINE = "baseline"
72
+ """Represents the baseline direct adversarial probing, which is used by attack strategies as the
73
+ attack objective."""
74
+
75
+
76
+ class ChatRole(str, Enum, metaclass=CaseInsensitiveEnumMeta):
77
+ """A description of the intended purpose of a message within a chat completions interaction."""
78
+
79
+ SYSTEM = "system"
80
+ """The role that instructs or sets the behavior of the assistant."""
81
+ DEVELOPER = "developer"
82
+ """The role that provides instructions to the model prioritized ahead of user messages."""
83
+ USER = "user"
84
+ """The role that provides input for chat completions."""
85
+ ASSISTANT = "assistant"
86
+ """The role that provides responses to system-instructed, user-prompted input."""
87
+ TOOL = "tool"
88
+ """The role that represents extension tool activity within a chat completions operation."""
89
+
90
+
91
+ class CompletionsFinishReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
92
+ """Representation of the manner in which a completions response concluded."""
93
+
94
+ STOPPED = "stop"
95
+ """Completions ended normally and reached its end of token generation."""
96
+ TOKEN_LIMIT_REACHED = "length"
97
+ """Completions exhausted available token limits before generation could complete."""
98
+ CONTENT_FILTERED = "content_filter"
99
+ """Completions generated a response that was identified as potentially sensitive per content
100
+ moderation policies."""
101
+ TOOL_CALLS = "tool_calls"
102
+ """Completion ended with the model calling a provided tool for output."""
103
+
104
+
105
+ class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
106
+ """The Type (or category) of the connection."""
107
+
108
+ AZURE_OPEN_AI = "AzureOpenAI"
109
+ """Azure OpenAI Service"""
110
+ AZURE_BLOB_STORAGE = "AzureBlob"
111
+ """Azure Blob Storage, with specified container"""
112
+ AZURE_STORAGE_ACCOUNT = "AzureStorageAccount"
113
+ """Azure Blob Storage, with container not specified (used by Agents)"""
114
+ AZURE_AI_SEARCH = "CognitiveSearch"
115
+ """Azure AI Search"""
116
+ COSMOS_DB = "CosmosDB"
117
+ """CosmosDB"""
118
+ API_KEY = "ApiKey"
119
+ """Generic connection that uses API Key authentication"""
120
+ APPLICATION_CONFIGURATION = "AppConfig"
121
+ """Application Configuration"""
122
+ APPLICATION_INSIGHTS = "AppInsights"
123
+ """Application Insights"""
124
+ CUSTOM = "CustomKeys"
125
+ """Custom Keys"""
126
+
127
+
128
+ class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
129
+ """The credential type used by the connection."""
130
+
131
+ API_KEY = "ApiKey"
132
+ """API Key credential"""
133
+ ENTRA_ID = "AAD"
134
+ """Entra ID credential (formerly known as AAD)"""
135
+ SAS = "SAS"
136
+ """Shared Access Signature (SAS) credential"""
137
+ CUSTOM = "CustomKeys"
138
+ """Custom credential"""
139
+ NONE = "None"
140
+ """No credential"""
141
+
142
+
143
+ class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
144
+ """Enum to determine the type of data."""
145
+
146
+ URI_FILE = "uri_file"
147
+ """URI file."""
148
+ URI_FOLDER = "uri_folder"
149
+ """URI folder."""
150
+
151
+
152
+ class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
153
+ """Type of DeploymentType."""
154
+
155
+ MODEL_DEPLOYMENT = "ModelDeployment"
156
+ """Model deployment"""
157
+
158
+
159
+ class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
160
+ """Type of IndexType."""
161
+
162
+ AZURE_SEARCH = "AzureSearch"
163
+ """Azure search"""
164
+ COSMOS_DB = "CosmosDBNoSqlVectorStore"
165
+ """CosmosDB"""
166
+ MANAGED_AZURE_SEARCH = "ManagedAzureSearch"
167
+ """Managed Azure Search"""
168
+
169
+
170
+ class ListViewType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
171
+ """List View Type Definition."""
172
+
173
+ ACTIVE_ONLY = "ActiveOnly"
174
+ """List only active items."""
175
+ ARCHIVED_ONLY = "ArchivedOnly"
176
+ """List only archived items."""
177
+ ALL = "All"
178
+ """List all items."""
179
+
180
+
181
+ class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
182
+ """The type of pending upload."""
183
+
184
+ NONE = "None"
185
+ """No pending upload."""
186
+ TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference"
187
+ """Temporary Blob Reference is the only supported type."""
188
+
189
+
190
+ class ResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
191
+ """Type of Evaluation result."""
192
+
193
+ BENCHMARK = "Benchmark"
194
+ """Benchmark result"""
195
+ EVALUATION = "Evaluation"
196
+ """Evaluations Result"""
197
+ REDTEAM = "Redteam"
198
+ """Red Team Result"""
199
+ SIMULATION = "Simulation"
200
+ """Simulation Result"""
201
+
202
+
203
+ class RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta):
204
+ """Risk category for the attack objective."""
205
+
206
+ HATE_UNFAIRNESS = "HateUnfairness"
207
+ """Represents content related to hate or unfairness."""
208
+ VIOLENCE = "Violence"
209
+ """Represents content related to violence."""
210
+ SEXUAL = "Sexual"
211
+ """Represents content of a sexual nature."""
212
+ SELF_HARM = "SelfHarm"
213
+ """Represents content related to self-harm."""
214
+ PROTECTED_MATERIAL = "ProtectedMaterial"
215
+ """Represents content involving protected material."""
216
+ CODE_VULNERABILITY = "CodeVulnerability"
217
+ """Represents content related to code vulnerabilities."""
218
+ UNGROUNDED_ATTRIBUTES = "UngroundedAttributes"
219
+ """Represents content with ungrounded attributes."""
220
+
221
+
222
+ class SimulationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
223
+ """Simulation type."""
224
+
225
+ DEFAULT = "Default"
226
+ """Default simulation type."""
227
+ CUSTOM_PERSONA = "CustomPersona"
228
+ """Custom persona simulation type."""
229
+ HARM_TURN_GENERATOR = "HarmTurnGenerator"
230
+ """Harm turn generator simulation type."""