azure-ai-evaluation 1.3.0__py3-none-any.whl → 1.5.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.
- azure/ai/evaluation/__init__.py +27 -1
- azure/ai/evaluation/_azure/_models.py +6 -6
- azure/ai/evaluation/_common/constants.py +6 -2
- azure/ai/evaluation/_common/rai_service.py +39 -5
- azure/ai/evaluation/_common/raiclient/__init__.py +34 -0
- azure/ai/evaluation/_common/raiclient/_client.py +128 -0
- azure/ai/evaluation/_common/raiclient/_configuration.py +87 -0
- azure/ai/evaluation/_common/raiclient/_model_base.py +1235 -0
- azure/ai/evaluation/_common/raiclient/_patch.py +20 -0
- azure/ai/evaluation/_common/raiclient/_serialization.py +2050 -0
- azure/ai/evaluation/_common/raiclient/_version.py +9 -0
- azure/ai/evaluation/_common/raiclient/aio/__init__.py +29 -0
- azure/ai/evaluation/_common/raiclient/aio/_client.py +130 -0
- azure/ai/evaluation/_common/raiclient/aio/_configuration.py +87 -0
- azure/ai/evaluation/_common/raiclient/aio/_patch.py +20 -0
- azure/ai/evaluation/_common/raiclient/aio/operations/__init__.py +25 -0
- azure/ai/evaluation/_common/raiclient/aio/operations/_operations.py +981 -0
- azure/ai/evaluation/_common/raiclient/aio/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/raiclient/models/__init__.py +60 -0
- azure/ai/evaluation/_common/raiclient/models/_enums.py +18 -0
- azure/ai/evaluation/_common/raiclient/models/_models.py +651 -0
- azure/ai/evaluation/_common/raiclient/models/_patch.py +20 -0
- azure/ai/evaluation/_common/raiclient/operations/__init__.py +25 -0
- azure/ai/evaluation/_common/raiclient/operations/_operations.py +1225 -0
- azure/ai/evaluation/_common/raiclient/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/raiclient/py.typed +1 -0
- azure/ai/evaluation/_common/utils.py +23 -3
- azure/ai/evaluation/_constants.py +7 -0
- azure/ai/evaluation/_converters/__init__.py +3 -0
- azure/ai/evaluation/_converters/_ai_services.py +804 -0
- azure/ai/evaluation/_converters/_models.py +302 -0
- azure/ai/evaluation/_evaluate/_batch_run/__init__.py +10 -3
- azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py +104 -0
- azure/ai/evaluation/_evaluate/_batch_run/batch_clients.py +82 -0
- azure/ai/evaluation/_evaluate/_batch_run/code_client.py +18 -12
- azure/ai/evaluation/_evaluate/_batch_run/eval_run_context.py +9 -4
- azure/ai/evaluation/_evaluate/_batch_run/proxy_client.py +42 -22
- azure/ai/evaluation/_evaluate/_batch_run/target_run_context.py +1 -1
- azure/ai/evaluation/_evaluate/_eval_run.py +2 -2
- azure/ai/evaluation/_evaluate/_evaluate.py +109 -64
- azure/ai/evaluation/_evaluate/_telemetry/__init__.py +5 -89
- azure/ai/evaluation/_evaluate/_utils.py +3 -3
- azure/ai/evaluation/_evaluators/_bleu/_bleu.py +23 -3
- azure/ai/evaluation/_evaluators/_code_vulnerability/__init__.py +5 -0
- azure/ai/evaluation/_evaluators/_code_vulnerability/_code_vulnerability.py +120 -0
- azure/ai/evaluation/_evaluators/_coherence/_coherence.py +21 -2
- azure/ai/evaluation/_evaluators/_common/_base_eval.py +44 -4
- azure/ai/evaluation/_evaluators/_common/_base_multi_eval.py +4 -2
- azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py +44 -5
- azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py +16 -4
- azure/ai/evaluation/_evaluators/_content_safety/_content_safety.py +42 -5
- azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py +15 -0
- azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py +15 -0
- azure/ai/evaluation/_evaluators/_content_safety/_sexual.py +15 -0
- azure/ai/evaluation/_evaluators/_content_safety/_violence.py +15 -0
- azure/ai/evaluation/_evaluators/_f1_score/_f1_score.py +28 -4
- azure/ai/evaluation/_evaluators/_fluency/_fluency.py +21 -2
- azure/ai/evaluation/_evaluators/_gleu/_gleu.py +26 -3
- azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py +22 -4
- azure/ai/evaluation/_evaluators/_intent_resolution/__init__.py +7 -0
- azure/ai/evaluation/_evaluators/_intent_resolution/_intent_resolution.py +152 -0
- azure/ai/evaluation/_evaluators/_intent_resolution/intent_resolution.prompty +161 -0
- azure/ai/evaluation/_evaluators/_meteor/_meteor.py +26 -3
- azure/ai/evaluation/_evaluators/_qa/_qa.py +51 -7
- azure/ai/evaluation/_evaluators/_relevance/_relevance.py +26 -2
- azure/ai/evaluation/_evaluators/_response_completeness/__init__.py +7 -0
- azure/ai/evaluation/_evaluators/_response_completeness/_response_completeness.py +158 -0
- azure/ai/evaluation/_evaluators/_response_completeness/response_completeness.prompty +99 -0
- azure/ai/evaluation/_evaluators/_retrieval/_retrieval.py +21 -2
- azure/ai/evaluation/_evaluators/_rouge/_rouge.py +113 -4
- azure/ai/evaluation/_evaluators/_service_groundedness/_service_groundedness.py +23 -3
- azure/ai/evaluation/_evaluators/_similarity/_similarity.py +24 -5
- azure/ai/evaluation/_evaluators/_task_adherence/__init__.py +7 -0
- azure/ai/evaluation/_evaluators/_task_adherence/_task_adherence.py +148 -0
- azure/ai/evaluation/_evaluators/_task_adherence/task_adherence.prompty +117 -0
- azure/ai/evaluation/_evaluators/_tool_call_accuracy/__init__.py +9 -0
- azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py +292 -0
- azure/ai/evaluation/_evaluators/_tool_call_accuracy/tool_call_accuracy.prompty +71 -0
- azure/ai/evaluation/_evaluators/_ungrounded_attributes/__init__.py +5 -0
- azure/ai/evaluation/_evaluators/_ungrounded_attributes/_ungrounded_attributes.py +103 -0
- azure/ai/evaluation/_evaluators/_xpia/xpia.py +2 -0
- azure/ai/evaluation/_exceptions.py +5 -0
- azure/ai/evaluation/_legacy/__init__.py +3 -0
- azure/ai/evaluation/_legacy/_adapters/__init__.py +21 -0
- azure/ai/evaluation/_legacy/_adapters/_configuration.py +45 -0
- azure/ai/evaluation/_legacy/_adapters/_constants.py +10 -0
- azure/ai/evaluation/_legacy/_adapters/_errors.py +29 -0
- azure/ai/evaluation/_legacy/_adapters/_flows.py +28 -0
- azure/ai/evaluation/_legacy/_adapters/_service.py +16 -0
- azure/ai/evaluation/_legacy/_adapters/client.py +51 -0
- azure/ai/evaluation/_legacy/_adapters/entities.py +26 -0
- azure/ai/evaluation/_legacy/_adapters/tracing.py +28 -0
- azure/ai/evaluation/_legacy/_adapters/types.py +15 -0
- azure/ai/evaluation/_legacy/_adapters/utils.py +31 -0
- azure/ai/evaluation/_legacy/_batch_engine/__init__.py +9 -0
- azure/ai/evaluation/_legacy/_batch_engine/_config.py +45 -0
- azure/ai/evaluation/_legacy/_batch_engine/_engine.py +368 -0
- azure/ai/evaluation/_legacy/_batch_engine/_exceptions.py +88 -0
- azure/ai/evaluation/_legacy/_batch_engine/_logging.py +292 -0
- azure/ai/evaluation/_legacy/_batch_engine/_openai_injector.py +23 -0
- azure/ai/evaluation/_legacy/_batch_engine/_result.py +99 -0
- azure/ai/evaluation/_legacy/_batch_engine/_run.py +121 -0
- azure/ai/evaluation/_legacy/_batch_engine/_run_storage.py +128 -0
- azure/ai/evaluation/_legacy/_batch_engine/_run_submitter.py +217 -0
- azure/ai/evaluation/_legacy/_batch_engine/_status.py +25 -0
- azure/ai/evaluation/_legacy/_batch_engine/_trace.py +105 -0
- azure/ai/evaluation/_legacy/_batch_engine/_utils.py +82 -0
- azure/ai/evaluation/_legacy/_batch_engine/_utils_deprecated.py +131 -0
- azure/ai/evaluation/_legacy/prompty/__init__.py +36 -0
- azure/ai/evaluation/_legacy/prompty/_connection.py +182 -0
- azure/ai/evaluation/_legacy/prompty/_exceptions.py +59 -0
- azure/ai/evaluation/_legacy/prompty/_prompty.py +313 -0
- azure/ai/evaluation/_legacy/prompty/_utils.py +545 -0
- azure/ai/evaluation/_legacy/prompty/_yaml_utils.py +99 -0
- azure/ai/evaluation/_safety_evaluation/__init__.py +1 -1
- azure/ai/evaluation/_safety_evaluation/_generated_rai_client.py +0 -0
- azure/ai/evaluation/_safety_evaluation/_safety_evaluation.py +251 -150
- azure/ai/evaluation/_version.py +1 -1
- azure/ai/evaluation/red_team/__init__.py +19 -0
- azure/ai/evaluation/red_team/_attack_objective_generator.py +195 -0
- azure/ai/evaluation/red_team/_attack_strategy.py +45 -0
- azure/ai/evaluation/red_team/_callback_chat_target.py +74 -0
- azure/ai/evaluation/red_team/_default_converter.py +21 -0
- azure/ai/evaluation/red_team/_red_team.py +1887 -0
- azure/ai/evaluation/red_team/_red_team_result.py +382 -0
- azure/ai/evaluation/red_team/_utils/__init__.py +3 -0
- azure/ai/evaluation/red_team/_utils/constants.py +65 -0
- azure/ai/evaluation/red_team/_utils/formatting_utils.py +165 -0
- azure/ai/evaluation/red_team/_utils/logging_utils.py +139 -0
- azure/ai/evaluation/red_team/_utils/strategy_utils.py +192 -0
- azure/ai/evaluation/simulator/_adversarial_scenario.py +3 -1
- azure/ai/evaluation/simulator/_adversarial_simulator.py +54 -27
- azure/ai/evaluation/simulator/_model_tools/_generated_rai_client.py +145 -0
- azure/ai/evaluation/simulator/_model_tools/_rai_client.py +71 -1
- azure/ai/evaluation/simulator/_simulator.py +1 -1
- {azure_ai_evaluation-1.3.0.dist-info → azure_ai_evaluation-1.5.0.dist-info}/METADATA +80 -15
- azure_ai_evaluation-1.5.0.dist-info/RECORD +207 -0
- {azure_ai_evaluation-1.3.0.dist-info → azure_ai_evaluation-1.5.0.dist-info}/WHEEL +1 -1
- azure/ai/evaluation/simulator/_tracing.py +0 -89
- azure_ai_evaluation-1.3.0.dist-info/RECORD +0 -119
- {azure_ai_evaluation-1.3.0.dist-info → azure_ai_evaluation-1.5.0.dist-info}/NOTICE.txt +0 -0
- {azure_ai_evaluation-1.3.0.dist-info → azure_ai_evaluation-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,651 @@
|
|
|
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
|
+
# pylint: disable=useless-super-delegation
|
|
9
|
+
|
|
10
|
+
from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload
|
|
11
|
+
|
|
12
|
+
from .. import _model_base
|
|
13
|
+
from .._model_base import rest_field
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from .. import models as _models
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AnnotationDTO(_model_base.Model):
|
|
20
|
+
"""AnnotationDTO.
|
|
21
|
+
|
|
22
|
+
:ivar annotation_task: Required.
|
|
23
|
+
:vartype annotation_task: str
|
|
24
|
+
:ivar content_type: Required.
|
|
25
|
+
:vartype content_type: str
|
|
26
|
+
:ivar user_text_list: Required.
|
|
27
|
+
:vartype user_text_list: list[str]
|
|
28
|
+
:ivar contents: Required.
|
|
29
|
+
:vartype contents: list[~raiclient.models.Content]
|
|
30
|
+
:ivar metric_list: Required.
|
|
31
|
+
:vartype metric_list: list[str]
|
|
32
|
+
:ivar prompt_version: Required.
|
|
33
|
+
:vartype prompt_version: str
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
annotation_task: str = rest_field(name="AnnotationTask", visibility=["read", "create", "update", "delete", "query"])
|
|
37
|
+
"""Required."""
|
|
38
|
+
content_type: str = rest_field(name="ContentType", visibility=["read", "create", "update", "delete", "query"])
|
|
39
|
+
"""Required."""
|
|
40
|
+
user_text_list: List[str] = rest_field(
|
|
41
|
+
name="UserTextList", visibility=["read", "create", "update", "delete", "query"]
|
|
42
|
+
)
|
|
43
|
+
"""Required."""
|
|
44
|
+
contents: List["_models.Content"] = rest_field(
|
|
45
|
+
name="Contents", visibility=["read", "create", "update", "delete", "query"]
|
|
46
|
+
)
|
|
47
|
+
"""Required."""
|
|
48
|
+
metric_list: List[str] = rest_field(name="MetricList", visibility=["read", "create", "update", "delete", "query"])
|
|
49
|
+
"""Required."""
|
|
50
|
+
prompt_version: str = rest_field(name="PromptVersion", visibility=["read", "create", "update", "delete", "query"])
|
|
51
|
+
"""Required."""
|
|
52
|
+
|
|
53
|
+
@overload
|
|
54
|
+
def __init__(
|
|
55
|
+
self,
|
|
56
|
+
*,
|
|
57
|
+
annotation_task: str,
|
|
58
|
+
content_type: str,
|
|
59
|
+
user_text_list: List[str],
|
|
60
|
+
contents: List["_models.Content"],
|
|
61
|
+
metric_list: List[str],
|
|
62
|
+
prompt_version: str,
|
|
63
|
+
) -> None: ...
|
|
64
|
+
|
|
65
|
+
@overload
|
|
66
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
67
|
+
"""
|
|
68
|
+
:param mapping: raw JSON to initialize the model.
|
|
69
|
+
:type mapping: Mapping[str, Any]
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
73
|
+
super().__init__(*args, **kwargs)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class AttackObjective(_model_base.Model):
|
|
77
|
+
"""Attack Objective.
|
|
78
|
+
|
|
79
|
+
:ivar id: The unique identifier. Required.
|
|
80
|
+
:vartype id: str
|
|
81
|
+
:ivar metadata: The metadata.
|
|
82
|
+
:vartype metadata: ~raiclient.models.Metadata
|
|
83
|
+
:ivar source: List of sources. Required.
|
|
84
|
+
:vartype source: list[str]
|
|
85
|
+
:ivar modality: The modality. Required.
|
|
86
|
+
:vartype modality: str
|
|
87
|
+
:ivar messages: The messages. Required.
|
|
88
|
+
:vartype messages: list[~raiclient.models.Message]
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
id: str = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
|
|
92
|
+
"""The unique identifier. Required."""
|
|
93
|
+
metadata: Optional["_models.Metadata"] = rest_field(
|
|
94
|
+
name="Metadata", visibility=["read", "create", "update", "delete", "query"]
|
|
95
|
+
)
|
|
96
|
+
"""The metadata."""
|
|
97
|
+
source: List[str] = rest_field(name="Source", visibility=["read", "create", "update", "delete", "query"])
|
|
98
|
+
"""List of sources. Required."""
|
|
99
|
+
modality: str = rest_field(name="Modality", visibility=["read", "create", "update", "delete", "query"])
|
|
100
|
+
"""The modality. Required."""
|
|
101
|
+
messages: List["_models.Message"] = rest_field(
|
|
102
|
+
name="Messages", visibility=["read", "create", "update", "delete", "query"]
|
|
103
|
+
)
|
|
104
|
+
"""The messages. Required."""
|
|
105
|
+
|
|
106
|
+
@overload
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
*,
|
|
110
|
+
id: str, # pylint: disable=redefined-builtin
|
|
111
|
+
source: List[str],
|
|
112
|
+
modality: str,
|
|
113
|
+
messages: List["_models.Message"],
|
|
114
|
+
metadata: Optional["_models.Metadata"] = None,
|
|
115
|
+
) -> None: ...
|
|
116
|
+
|
|
117
|
+
@overload
|
|
118
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
119
|
+
"""
|
|
120
|
+
:param mapping: raw JSON to initialize the model.
|
|
121
|
+
:type mapping: Mapping[str, Any]
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
125
|
+
super().__init__(*args, **kwargs)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class Content(_model_base.Model):
|
|
129
|
+
"""Content.
|
|
130
|
+
|
|
131
|
+
:ivar messages: Required.
|
|
132
|
+
:vartype messages: list[any]
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
messages: List[Any] = rest_field(name="Messages", visibility=["read", "create", "update", "delete", "query"])
|
|
136
|
+
"""Required."""
|
|
137
|
+
|
|
138
|
+
@overload
|
|
139
|
+
def __init__(
|
|
140
|
+
self,
|
|
141
|
+
*,
|
|
142
|
+
messages: List[Any],
|
|
143
|
+
) -> None: ...
|
|
144
|
+
|
|
145
|
+
@overload
|
|
146
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
147
|
+
"""
|
|
148
|
+
:param mapping: raw JSON to initialize the model.
|
|
149
|
+
:type mapping: Mapping[str, Any]
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
153
|
+
super().__init__(*args, **kwargs)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class CustomizationParameters(_model_base.Model):
|
|
157
|
+
"""Customization Parameters.
|
|
158
|
+
|
|
159
|
+
:ivar application_scenario: Application scenario.
|
|
160
|
+
:vartype application_scenario: str
|
|
161
|
+
:ivar harm_categories: List of harm categories. Required.
|
|
162
|
+
:vartype harm_categories: list[str]
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
application_scenario: Optional[str] = rest_field(
|
|
166
|
+
name="ApplicationScenario", visibility=["read", "create", "update", "delete", "query"]
|
|
167
|
+
)
|
|
168
|
+
"""Application scenario."""
|
|
169
|
+
harm_categories: List[str] = rest_field(
|
|
170
|
+
name="HarmCategories", visibility=["read", "create", "update", "delete", "query"]
|
|
171
|
+
)
|
|
172
|
+
"""List of harm categories. Required."""
|
|
173
|
+
|
|
174
|
+
@overload
|
|
175
|
+
def __init__(
|
|
176
|
+
self,
|
|
177
|
+
*,
|
|
178
|
+
harm_categories: List[str],
|
|
179
|
+
application_scenario: Optional[str] = None,
|
|
180
|
+
) -> None: ...
|
|
181
|
+
|
|
182
|
+
@overload
|
|
183
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
184
|
+
"""
|
|
185
|
+
:param mapping: raw JSON to initialize the model.
|
|
186
|
+
:type mapping: Mapping[str, Any]
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
190
|
+
super().__init__(*args, **kwargs)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class Data(_model_base.Model):
|
|
194
|
+
"""Data.
|
|
195
|
+
|
|
196
|
+
:ivar asset_id: Required.
|
|
197
|
+
:vartype asset_id: str
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
asset_id: str = rest_field(name="assetId", visibility=["read", "create", "update", "delete", "query"])
|
|
201
|
+
"""Required."""
|
|
202
|
+
|
|
203
|
+
@overload
|
|
204
|
+
def __init__(
|
|
205
|
+
self,
|
|
206
|
+
*,
|
|
207
|
+
asset_id: str,
|
|
208
|
+
) -> None: ...
|
|
209
|
+
|
|
210
|
+
@overload
|
|
211
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
212
|
+
"""
|
|
213
|
+
:param mapping: raw JSON to initialize the model.
|
|
214
|
+
:type mapping: Mapping[str, Any]
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
218
|
+
super().__init__(*args, **kwargs)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class Grader(_model_base.Model):
|
|
222
|
+
"""Grader.
|
|
223
|
+
|
|
224
|
+
:ivar name: Required.
|
|
225
|
+
:vartype name: str
|
|
226
|
+
:ivar description: Required.
|
|
227
|
+
:vartype description: str
|
|
228
|
+
:ivar config: Required.
|
|
229
|
+
:vartype config: ~raiclient.models.GraderConfigBase
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
name: str = rest_field(name="Name", visibility=["read", "create", "update", "delete", "query"])
|
|
233
|
+
"""Required."""
|
|
234
|
+
description: str = rest_field(name="Description", visibility=["read", "create", "update", "delete", "query"])
|
|
235
|
+
"""Required."""
|
|
236
|
+
config: "_models.GraderConfigBase" = rest_field(
|
|
237
|
+
name="Config", visibility=["read", "create", "update", "delete", "query"]
|
|
238
|
+
)
|
|
239
|
+
"""Required."""
|
|
240
|
+
|
|
241
|
+
@overload
|
|
242
|
+
def __init__(
|
|
243
|
+
self,
|
|
244
|
+
*,
|
|
245
|
+
name: str,
|
|
246
|
+
description: str,
|
|
247
|
+
config: "_models.GraderConfigBase",
|
|
248
|
+
) -> None: ...
|
|
249
|
+
|
|
250
|
+
@overload
|
|
251
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
252
|
+
"""
|
|
253
|
+
:param mapping: raw JSON to initialize the model.
|
|
254
|
+
:type mapping: Mapping[str, Any]
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
258
|
+
super().__init__(*args, **kwargs)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class GraderConfigBase(_model_base.Model):
|
|
262
|
+
"""GraderConfigBase.
|
|
263
|
+
|
|
264
|
+
:ivar type: Required.
|
|
265
|
+
:vartype type: str
|
|
266
|
+
"""
|
|
267
|
+
|
|
268
|
+
type: str = rest_field(name="Type", visibility=["read", "create", "update", "delete", "query"])
|
|
269
|
+
"""Required."""
|
|
270
|
+
|
|
271
|
+
@overload
|
|
272
|
+
def __init__(
|
|
273
|
+
self,
|
|
274
|
+
*,
|
|
275
|
+
type: str,
|
|
276
|
+
) -> None: ...
|
|
277
|
+
|
|
278
|
+
@overload
|
|
279
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
280
|
+
"""
|
|
281
|
+
:param mapping: raw JSON to initialize the model.
|
|
282
|
+
:type mapping: Mapping[str, Any]
|
|
283
|
+
"""
|
|
284
|
+
|
|
285
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
286
|
+
super().__init__(*args, **kwargs)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
class GradersDTO(_model_base.Model):
|
|
290
|
+
"""GradersDTO.
|
|
291
|
+
|
|
292
|
+
:ivar data: Required.
|
|
293
|
+
:vartype data: ~raiclient.models.Data
|
|
294
|
+
:ivar model_config: Required.
|
|
295
|
+
:vartype model_config: ~raiclient.models.ModelConfig
|
|
296
|
+
:ivar sample_generators: Required.
|
|
297
|
+
:vartype sample_generators: list[~raiclient.models.SampleGenerator]
|
|
298
|
+
:ivar graders: Required.
|
|
299
|
+
:vartype graders: list[~raiclient.models.Grader]
|
|
300
|
+
"""
|
|
301
|
+
|
|
302
|
+
data: "_models.Data" = rest_field(name="Data", visibility=["read", "create", "update", "delete", "query"])
|
|
303
|
+
"""Required."""
|
|
304
|
+
model_config: "_models.ModelConfig" = rest_field(
|
|
305
|
+
name="ModelConfig", visibility=["read", "create", "update", "delete", "query"]
|
|
306
|
+
)
|
|
307
|
+
"""Required."""
|
|
308
|
+
sample_generators: List["_models.SampleGenerator"] = rest_field(
|
|
309
|
+
name="SampleGenerators", visibility=["read", "create", "update", "delete", "query"]
|
|
310
|
+
)
|
|
311
|
+
"""Required."""
|
|
312
|
+
graders: List["_models.Grader"] = rest_field(
|
|
313
|
+
name="Graders", visibility=["read", "create", "update", "delete", "query"]
|
|
314
|
+
)
|
|
315
|
+
"""Required."""
|
|
316
|
+
|
|
317
|
+
@overload
|
|
318
|
+
def __init__(
|
|
319
|
+
self,
|
|
320
|
+
*,
|
|
321
|
+
data: "_models.Data",
|
|
322
|
+
model_config: "_models.ModelConfig",
|
|
323
|
+
sample_generators: List["_models.SampleGenerator"],
|
|
324
|
+
graders: List["_models.Grader"],
|
|
325
|
+
) -> None: ...
|
|
326
|
+
|
|
327
|
+
@overload
|
|
328
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
329
|
+
"""
|
|
330
|
+
:param mapping: raw JSON to initialize the model.
|
|
331
|
+
:type mapping: Mapping[str, Any]
|
|
332
|
+
"""
|
|
333
|
+
|
|
334
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
335
|
+
super().__init__(*args, **kwargs)
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
class LongRunningResponse(_model_base.Model):
|
|
339
|
+
"""LongRunningResponse.
|
|
340
|
+
|
|
341
|
+
:ivar location: Required.
|
|
342
|
+
:vartype location: str
|
|
343
|
+
:ivar operation_result: Required.
|
|
344
|
+
:vartype operation_result: any
|
|
345
|
+
"""
|
|
346
|
+
|
|
347
|
+
location: str = rest_field(name="Location", visibility=["read", "create", "update", "delete", "query"])
|
|
348
|
+
"""Required."""
|
|
349
|
+
operation_result: Any = rest_field(
|
|
350
|
+
name="OperationResult", visibility=["read", "create", "update", "delete", "query"]
|
|
351
|
+
)
|
|
352
|
+
"""Required."""
|
|
353
|
+
|
|
354
|
+
@overload
|
|
355
|
+
def __init__(
|
|
356
|
+
self,
|
|
357
|
+
*,
|
|
358
|
+
location: str,
|
|
359
|
+
operation_result: Any,
|
|
360
|
+
) -> None: ...
|
|
361
|
+
|
|
362
|
+
@overload
|
|
363
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
364
|
+
"""
|
|
365
|
+
:param mapping: raw JSON to initialize the model.
|
|
366
|
+
:type mapping: Mapping[str, Any]
|
|
367
|
+
"""
|
|
368
|
+
|
|
369
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
370
|
+
super().__init__(*args, **kwargs)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
class Message(_model_base.Model):
|
|
374
|
+
"""Message.
|
|
375
|
+
|
|
376
|
+
:ivar role: The role.
|
|
377
|
+
:vartype role: str
|
|
378
|
+
:ivar content: The content.
|
|
379
|
+
:vartype content: str
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
role: Optional[str] = rest_field(name="Role", visibility=["read", "create", "update", "delete", "query"])
|
|
383
|
+
"""The role."""
|
|
384
|
+
content: Optional[str] = rest_field(name="Content", visibility=["read", "create", "update", "delete", "query"])
|
|
385
|
+
"""The content."""
|
|
386
|
+
|
|
387
|
+
@overload
|
|
388
|
+
def __init__(
|
|
389
|
+
self,
|
|
390
|
+
*,
|
|
391
|
+
role: Optional[str] = None,
|
|
392
|
+
content: Optional[str] = None,
|
|
393
|
+
) -> None: ...
|
|
394
|
+
|
|
395
|
+
@overload
|
|
396
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
397
|
+
"""
|
|
398
|
+
:param mapping: raw JSON to initialize the model.
|
|
399
|
+
:type mapping: Mapping[str, Any]
|
|
400
|
+
"""
|
|
401
|
+
|
|
402
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
403
|
+
super().__init__(*args, **kwargs)
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
class Metadata(_model_base.Model):
|
|
407
|
+
"""Metadata.
|
|
408
|
+
|
|
409
|
+
:ivar target_harms: List of target harms. Required.
|
|
410
|
+
:vartype target_harms: list[~raiclient.models.TargetHarm]
|
|
411
|
+
:ivar language: The language. Required.
|
|
412
|
+
:vartype language: str
|
|
413
|
+
"""
|
|
414
|
+
|
|
415
|
+
target_harms: List["_models.TargetHarm"] = rest_field(
|
|
416
|
+
name="TargetHarms", visibility=["read", "create", "update", "delete", "query"]
|
|
417
|
+
)
|
|
418
|
+
"""List of target harms. Required."""
|
|
419
|
+
language: str = rest_field(name="Language", visibility=["read", "create", "update", "delete", "query"])
|
|
420
|
+
"""The language. Required."""
|
|
421
|
+
|
|
422
|
+
@overload
|
|
423
|
+
def __init__(
|
|
424
|
+
self,
|
|
425
|
+
*,
|
|
426
|
+
target_harms: List["_models.TargetHarm"],
|
|
427
|
+
language: str,
|
|
428
|
+
) -> None: ...
|
|
429
|
+
|
|
430
|
+
@overload
|
|
431
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
432
|
+
"""
|
|
433
|
+
:param mapping: raw JSON to initialize the model.
|
|
434
|
+
:type mapping: Mapping[str, Any]
|
|
435
|
+
"""
|
|
436
|
+
|
|
437
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
438
|
+
super().__init__(*args, **kwargs)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
class ModelConfig(_model_base.Model):
|
|
442
|
+
"""ModelConfig.
|
|
443
|
+
|
|
444
|
+
:ivar azure_endpoint: Required.
|
|
445
|
+
:vartype azure_endpoint: str
|
|
446
|
+
"""
|
|
447
|
+
|
|
448
|
+
azure_endpoint: str = rest_field(name="AzureEndpoint", visibility=["read", "create", "update", "delete", "query"])
|
|
449
|
+
"""Required."""
|
|
450
|
+
|
|
451
|
+
@overload
|
|
452
|
+
def __init__(
|
|
453
|
+
self,
|
|
454
|
+
*,
|
|
455
|
+
azure_endpoint: str,
|
|
456
|
+
) -> None: ...
|
|
457
|
+
|
|
458
|
+
@overload
|
|
459
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
460
|
+
"""
|
|
461
|
+
:param mapping: raw JSON to initialize the model.
|
|
462
|
+
:type mapping: Mapping[str, Any]
|
|
463
|
+
"""
|
|
464
|
+
|
|
465
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
466
|
+
super().__init__(*args, **kwargs)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
class SampleGenerator(_model_base.Model):
|
|
470
|
+
"""SampleGenerator.
|
|
471
|
+
|
|
472
|
+
:ivar model_name: Required.
|
|
473
|
+
:vartype model_name: str
|
|
474
|
+
:ivar type: Required.
|
|
475
|
+
:vartype type: str
|
|
476
|
+
:ivar sampling_params: Required.
|
|
477
|
+
:vartype sampling_params: any
|
|
478
|
+
:ivar trajectory_template: Required.
|
|
479
|
+
:vartype trajectory_template: any
|
|
480
|
+
"""
|
|
481
|
+
|
|
482
|
+
model_name: str = rest_field(name="ModelName", visibility=["read", "create", "update", "delete", "query"])
|
|
483
|
+
"""Required."""
|
|
484
|
+
type: str = rest_field(name="Type", visibility=["read", "create", "update", "delete", "query"])
|
|
485
|
+
"""Required."""
|
|
486
|
+
sampling_params: Any = rest_field(name="SamplingParams", visibility=["read", "create", "update", "delete", "query"])
|
|
487
|
+
"""Required."""
|
|
488
|
+
trajectory_template: Any = rest_field(
|
|
489
|
+
name="TrajectoryTemplate", visibility=["read", "create", "update", "delete", "query"]
|
|
490
|
+
)
|
|
491
|
+
"""Required."""
|
|
492
|
+
|
|
493
|
+
@overload
|
|
494
|
+
def __init__(
|
|
495
|
+
self,
|
|
496
|
+
*,
|
|
497
|
+
model_name: str,
|
|
498
|
+
type: str,
|
|
499
|
+
sampling_params: Any,
|
|
500
|
+
trajectory_template: Any,
|
|
501
|
+
) -> None: ...
|
|
502
|
+
|
|
503
|
+
@overload
|
|
504
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
505
|
+
"""
|
|
506
|
+
:param mapping: raw JSON to initialize the model.
|
|
507
|
+
:type mapping: Mapping[str, Any]
|
|
508
|
+
"""
|
|
509
|
+
|
|
510
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
511
|
+
super().__init__(*args, **kwargs)
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
class SimulationDTO(_model_base.Model):
|
|
515
|
+
"""Customization Parameters.
|
|
516
|
+
|
|
517
|
+
:ivar headers: Additional headers.
|
|
518
|
+
:vartype headers: dict[str, str]
|
|
519
|
+
:ivar params: Parameters.
|
|
520
|
+
:vartype params: dict[str, str]
|
|
521
|
+
:ivar template_parameters: Template parameters.
|
|
522
|
+
:vartype template_parameters: dict[str, str]
|
|
523
|
+
:ivar customization_parameters: Customization parameters.
|
|
524
|
+
:vartype customization_parameters: ~raiclient.models.CustomizationParameters
|
|
525
|
+
:ivar json: Json.
|
|
526
|
+
:vartype json: str
|
|
527
|
+
:ivar url: Url.
|
|
528
|
+
:vartype url: str
|
|
529
|
+
:ivar template_key: Template key.
|
|
530
|
+
:vartype template_key: str
|
|
531
|
+
:ivar simulation_type: Type of Simulation. Known values are: "Default", "CustomPersona", and
|
|
532
|
+
"HarmTurnGenerator".
|
|
533
|
+
:vartype simulation_type: str or ~raiclient.models.SimulationType
|
|
534
|
+
:ivar is_microsoft_tenant: 'True' if Microsoft internal tenant and 'False' otherwise.
|
|
535
|
+
:vartype is_microsoft_tenant: bool
|
|
536
|
+
:ivar subscription_id: Azure subscription id.
|
|
537
|
+
:vartype subscription_id: str
|
|
538
|
+
:ivar resource_group_name: Resource group name.
|
|
539
|
+
:vartype resource_group_name: str
|
|
540
|
+
:ivar workspace_name: Workspace name.
|
|
541
|
+
:vartype workspace_name: str
|
|
542
|
+
"""
|
|
543
|
+
|
|
544
|
+
headers: Optional[Dict[str, str]] = rest_field(
|
|
545
|
+
name="Headers", visibility=["read", "create", "update", "delete", "query"]
|
|
546
|
+
)
|
|
547
|
+
"""Additional headers."""
|
|
548
|
+
params: Optional[Dict[str, str]] = rest_field(
|
|
549
|
+
name="Params", visibility=["read", "create", "update", "delete", "query"]
|
|
550
|
+
)
|
|
551
|
+
"""Parameters."""
|
|
552
|
+
template_parameters: Optional[Dict[str, str]] = rest_field(
|
|
553
|
+
name="TemplateParameters", visibility=["read", "create", "update", "delete", "query"]
|
|
554
|
+
)
|
|
555
|
+
"""Template parameters."""
|
|
556
|
+
customization_parameters: Optional["_models.CustomizationParameters"] = rest_field(
|
|
557
|
+
name="CustomizationParameters", visibility=["read", "create", "update", "delete", "query"]
|
|
558
|
+
)
|
|
559
|
+
"""Customization parameters."""
|
|
560
|
+
json: Optional[str] = rest_field(name="Json", visibility=["read", "create", "update", "delete", "query"])
|
|
561
|
+
"""Json."""
|
|
562
|
+
url: Optional[str] = rest_field(name="Url", visibility=["read", "create", "update", "delete", "query"])
|
|
563
|
+
"""Url."""
|
|
564
|
+
template_key: Optional[str] = rest_field(
|
|
565
|
+
name="TemplateKey", visibility=["read", "create", "update", "delete", "query"]
|
|
566
|
+
)
|
|
567
|
+
"""Template key."""
|
|
568
|
+
simulation_type: Optional[Union[str, "_models.SimulationType"]] = rest_field(
|
|
569
|
+
name="SimulationType", visibility=["read", "create", "update", "delete", "query"]
|
|
570
|
+
)
|
|
571
|
+
"""Type of Simulation. Known values are: \"Default\", \"CustomPersona\", and
|
|
572
|
+
\"HarmTurnGenerator\"."""
|
|
573
|
+
is_microsoft_tenant: Optional[bool] = rest_field(
|
|
574
|
+
name="IsMicrosoftTenant", visibility=["read", "create", "update", "delete", "query"]
|
|
575
|
+
)
|
|
576
|
+
"""'True' if Microsoft internal tenant and 'False' otherwise."""
|
|
577
|
+
subscription_id: Optional[str] = rest_field(
|
|
578
|
+
name="SubscriptionId", visibility=["read", "create", "update", "delete", "query"]
|
|
579
|
+
)
|
|
580
|
+
"""Azure subscription id."""
|
|
581
|
+
resource_group_name: Optional[str] = rest_field(
|
|
582
|
+
name="ResourceGroupName", visibility=["read", "create", "update", "delete", "query"]
|
|
583
|
+
)
|
|
584
|
+
"""Resource group name."""
|
|
585
|
+
workspace_name: Optional[str] = rest_field(
|
|
586
|
+
name="WorkspaceName", visibility=["read", "create", "update", "delete", "query"]
|
|
587
|
+
)
|
|
588
|
+
"""Workspace name."""
|
|
589
|
+
|
|
590
|
+
@overload
|
|
591
|
+
def __init__(
|
|
592
|
+
self,
|
|
593
|
+
*,
|
|
594
|
+
headers: Optional[Dict[str, str]] = None,
|
|
595
|
+
params: Optional[Dict[str, str]] = None,
|
|
596
|
+
template_parameters: Optional[Dict[str, str]] = None,
|
|
597
|
+
customization_parameters: Optional["_models.CustomizationParameters"] = None,
|
|
598
|
+
json: Optional[str] = None,
|
|
599
|
+
url: Optional[str] = None,
|
|
600
|
+
template_key: Optional[str] = None,
|
|
601
|
+
simulation_type: Optional[Union[str, "_models.SimulationType"]] = None,
|
|
602
|
+
is_microsoft_tenant: Optional[bool] = None,
|
|
603
|
+
subscription_id: Optional[str] = None,
|
|
604
|
+
resource_group_name: Optional[str] = None,
|
|
605
|
+
workspace_name: Optional[str] = None,
|
|
606
|
+
) -> None: ...
|
|
607
|
+
|
|
608
|
+
@overload
|
|
609
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
610
|
+
"""
|
|
611
|
+
:param mapping: raw JSON to initialize the model.
|
|
612
|
+
:type mapping: Mapping[str, Any]
|
|
613
|
+
"""
|
|
614
|
+
|
|
615
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
616
|
+
super().__init__(*args, **kwargs)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
class TargetHarm(_model_base.Model):
|
|
620
|
+
"""Target Harm.
|
|
621
|
+
|
|
622
|
+
:ivar risk_type: The risk type.
|
|
623
|
+
:vartype risk_type: str
|
|
624
|
+
:ivar risk_sub_type: The risk sub type.
|
|
625
|
+
:vartype risk_sub_type: str
|
|
626
|
+
"""
|
|
627
|
+
|
|
628
|
+
risk_type: Optional[str] = rest_field(name="RiskType", visibility=["read", "create", "update", "delete", "query"])
|
|
629
|
+
"""The risk type."""
|
|
630
|
+
risk_sub_type: Optional[str] = rest_field(
|
|
631
|
+
name="RiskSubType", visibility=["read", "create", "update", "delete", "query"]
|
|
632
|
+
)
|
|
633
|
+
"""The risk sub type."""
|
|
634
|
+
|
|
635
|
+
@overload
|
|
636
|
+
def __init__(
|
|
637
|
+
self,
|
|
638
|
+
*,
|
|
639
|
+
risk_type: Optional[str] = None,
|
|
640
|
+
risk_sub_type: Optional[str] = None,
|
|
641
|
+
) -> None: ...
|
|
642
|
+
|
|
643
|
+
@overload
|
|
644
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
645
|
+
"""
|
|
646
|
+
:param mapping: raw JSON to initialize the model.
|
|
647
|
+
:type mapping: Mapping[str, Any]
|
|
648
|
+
"""
|
|
649
|
+
|
|
650
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
651
|
+
super().__init__(*args, **kwargs)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation.
|
|
3
|
+
# Licensed under the MIT License.
|
|
4
|
+
# ------------------------------------
|
|
5
|
+
"""Customize generated code here.
|
|
6
|
+
|
|
7
|
+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
8
|
+
"""
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def patch_sdk():
|
|
15
|
+
"""Do not remove from this file.
|
|
16
|
+
|
|
17
|
+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
|
18
|
+
you can't accomplish using the techniques described in
|
|
19
|
+
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
20
|
+
"""
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
# pylint: disable=wrong-import-position
|
|
9
|
+
|
|
10
|
+
from typing import TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ._patch import * # pylint: disable=unused-wildcard-import
|
|
14
|
+
|
|
15
|
+
from ._operations import RAISvcOperations # type: ignore
|
|
16
|
+
|
|
17
|
+
from ._patch import __all__ as _patch_all
|
|
18
|
+
from ._patch import *
|
|
19
|
+
from ._patch import patch_sdk as _patch_sdk
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"RAISvcOperations",
|
|
23
|
+
]
|
|
24
|
+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
|
|
25
|
+
_patch_sdk()
|