azure-ai-evaluation 1.5.0__py3-none-any.whl → 1.6.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 +9 -0
- azure/ai/evaluation/_aoai/__init__.py +10 -0
- azure/ai/evaluation/_aoai/aoai_grader.py +89 -0
- azure/ai/evaluation/_aoai/label_grader.py +66 -0
- azure/ai/evaluation/_aoai/string_check_grader.py +65 -0
- azure/ai/evaluation/_aoai/text_similarity_grader.py +88 -0
- azure/ai/evaluation/_azure/_clients.py +4 -4
- azure/ai/evaluation/_azure/_envs.py +208 -0
- azure/ai/evaluation/_azure/_token_manager.py +12 -7
- azure/ai/evaluation/_common/__init__.py +5 -0
- azure/ai/evaluation/_common/evaluation_onedp_client.py +118 -0
- azure/ai/evaluation/_common/onedp/__init__.py +32 -0
- azure/ai/evaluation/_common/onedp/_client.py +139 -0
- azure/ai/evaluation/_common/onedp/_configuration.py +73 -0
- azure/ai/evaluation/_common/onedp/_model_base.py +1232 -0
- azure/ai/evaluation/_common/onedp/_patch.py +21 -0
- azure/ai/evaluation/_common/onedp/_serialization.py +2032 -0
- azure/ai/evaluation/_common/onedp/_types.py +21 -0
- azure/ai/evaluation/_common/onedp/_validation.py +50 -0
- azure/ai/evaluation/_common/onedp/_vendor.py +50 -0
- azure/ai/evaluation/_common/onedp/_version.py +9 -0
- azure/ai/evaluation/_common/onedp/aio/__init__.py +29 -0
- azure/ai/evaluation/_common/onedp/aio/_client.py +143 -0
- azure/ai/evaluation/_common/onedp/aio/_configuration.py +75 -0
- azure/ai/evaluation/_common/onedp/aio/_patch.py +21 -0
- azure/ai/evaluation/_common/onedp/aio/_vendor.py +40 -0
- azure/ai/evaluation/_common/onedp/aio/operations/__init__.py +39 -0
- azure/ai/evaluation/_common/onedp/aio/operations/_operations.py +4494 -0
- azure/ai/evaluation/_common/onedp/aio/operations/_patch.py +21 -0
- azure/ai/evaluation/_common/onedp/models/__init__.py +142 -0
- azure/ai/evaluation/_common/onedp/models/_enums.py +162 -0
- azure/ai/evaluation/_common/onedp/models/_models.py +2228 -0
- azure/ai/evaluation/_common/onedp/models/_patch.py +21 -0
- azure/ai/evaluation/_common/onedp/operations/__init__.py +39 -0
- azure/ai/evaluation/_common/onedp/operations/_operations.py +5655 -0
- azure/ai/evaluation/_common/onedp/operations/_patch.py +21 -0
- azure/ai/evaluation/_common/onedp/py.typed +1 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/__init__.py +1 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/aio/__init__.py +1 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/__init__.py +25 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/_operations.py +34 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/aio/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/__init__.py +1 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/__init__.py +1 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/__init__.py +22 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/_operations.py +29 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/aio/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/__init__.py +22 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/_operations.py +29 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/buildingblocks/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/operations/__init__.py +25 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/operations/_operations.py +34 -0
- azure/ai/evaluation/_common/onedp/servicepatterns/operations/_patch.py +20 -0
- azure/ai/evaluation/_common/rai_service.py +158 -28
- azure/ai/evaluation/_common/raiclient/_version.py +1 -1
- azure/ai/evaluation/_common/utils.py +79 -1
- azure/ai/evaluation/_constants.py +16 -0
- azure/ai/evaluation/_eval_mapping.py +71 -0
- azure/ai/evaluation/_evaluate/_batch_run/_run_submitter_client.py +30 -16
- azure/ai/evaluation/_evaluate/_batch_run/eval_run_context.py +8 -0
- azure/ai/evaluation/_evaluate/_batch_run/proxy_client.py +5 -0
- azure/ai/evaluation/_evaluate/_batch_run/target_run_context.py +17 -1
- azure/ai/evaluation/_evaluate/_eval_run.py +1 -1
- azure/ai/evaluation/_evaluate/_evaluate.py +325 -74
- azure/ai/evaluation/_evaluate/_evaluate_aoai.py +534 -0
- azure/ai/evaluation/_evaluate/_utils.py +117 -4
- azure/ai/evaluation/_evaluators/_common/_base_eval.py +8 -3
- azure/ai/evaluation/_evaluators/_common/_base_prompty_eval.py +12 -3
- azure/ai/evaluation/_evaluators/_common/_base_rai_svc_eval.py +2 -2
- azure/ai/evaluation/_evaluators/_document_retrieval/__init__.py +11 -0
- azure/ai/evaluation/_evaluators/_document_retrieval/_document_retrieval.py +467 -0
- azure/ai/evaluation/_evaluators/_fluency/_fluency.py +1 -1
- azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py +1 -1
- azure/ai/evaluation/_evaluators/_intent_resolution/_intent_resolution.py +6 -2
- azure/ai/evaluation/_evaluators/_relevance/_relevance.py +1 -1
- azure/ai/evaluation/_evaluators/_response_completeness/_response_completeness.py +7 -2
- azure/ai/evaluation/_evaluators/_response_completeness/response_completeness.prompty +31 -46
- azure/ai/evaluation/_evaluators/_similarity/_similarity.py +1 -1
- azure/ai/evaluation/_evaluators/_task_adherence/_task_adherence.py +5 -2
- azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py +6 -2
- azure/ai/evaluation/_exceptions.py +2 -0
- azure/ai/evaluation/_legacy/_adapters/__init__.py +0 -14
- azure/ai/evaluation/_legacy/_adapters/_check.py +17 -0
- azure/ai/evaluation/_legacy/_adapters/_flows.py +1 -1
- azure/ai/evaluation/_legacy/_batch_engine/_engine.py +51 -32
- azure/ai/evaluation/_legacy/_batch_engine/_openai_injector.py +114 -8
- azure/ai/evaluation/_legacy/_batch_engine/_result.py +6 -0
- azure/ai/evaluation/_legacy/_batch_engine/_run.py +6 -0
- azure/ai/evaluation/_legacy/_batch_engine/_run_submitter.py +69 -29
- azure/ai/evaluation/_legacy/_batch_engine/_trace.py +54 -62
- azure/ai/evaluation/_legacy/_batch_engine/_utils.py +19 -1
- azure/ai/evaluation/_legacy/_common/__init__.py +3 -0
- azure/ai/evaluation/_legacy/_common/_async_token_provider.py +124 -0
- azure/ai/evaluation/_legacy/_common/_thread_pool_executor_with_context.py +15 -0
- azure/ai/evaluation/_legacy/prompty/_connection.py +11 -74
- azure/ai/evaluation/_legacy/prompty/_exceptions.py +80 -0
- azure/ai/evaluation/_legacy/prompty/_prompty.py +119 -9
- azure/ai/evaluation/_legacy/prompty/_utils.py +72 -2
- azure/ai/evaluation/_safety_evaluation/_safety_evaluation.py +90 -17
- azure/ai/evaluation/_version.py +1 -1
- azure/ai/evaluation/red_team/_attack_strategy.py +1 -1
- azure/ai/evaluation/red_team/_red_team.py +825 -450
- azure/ai/evaluation/red_team/_utils/metric_mapping.py +23 -0
- azure/ai/evaluation/red_team/_utils/strategy_utils.py +1 -1
- azure/ai/evaluation/simulator/_adversarial_simulator.py +63 -39
- azure/ai/evaluation/simulator/_constants.py +1 -0
- azure/ai/evaluation/simulator/_conversation/__init__.py +13 -6
- azure/ai/evaluation/simulator/_conversation/_conversation.py +2 -1
- azure/ai/evaluation/simulator/_direct_attack_simulator.py +35 -22
- azure/ai/evaluation/simulator/_helpers/_language_suffix_mapping.py +1 -0
- azure/ai/evaluation/simulator/_indirect_attack_simulator.py +40 -25
- azure/ai/evaluation/simulator/_model_tools/__init__.py +2 -1
- azure/ai/evaluation/simulator/_model_tools/_generated_rai_client.py +24 -18
- azure/ai/evaluation/simulator/_model_tools/_identity_manager.py +5 -10
- azure/ai/evaluation/simulator/_model_tools/_proxy_completion_model.py +65 -41
- azure/ai/evaluation/simulator/_model_tools/_template_handler.py +9 -5
- azure/ai/evaluation/simulator/_model_tools/models.py +20 -17
- {azure_ai_evaluation-1.5.0.dist-info → azure_ai_evaluation-1.6.0.dist-info}/METADATA +25 -2
- {azure_ai_evaluation-1.5.0.dist-info → azure_ai_evaluation-1.6.0.dist-info}/RECORD +123 -65
- /azure/ai/evaluation/_legacy/{_batch_engine → _common}/_logging.py +0 -0
- {azure_ai_evaluation-1.5.0.dist-info → azure_ai_evaluation-1.6.0.dist-info}/NOTICE.txt +0 -0
- {azure_ai_evaluation-1.5.0.dist-info → azure_ai_evaluation-1.6.0.dist-info}/WHEEL +0 -0
- {azure_ai_evaluation-1.5.0.dist-info → azure_ai_evaluation-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,2228 @@
|
|
|
1
|
+
# pylint: disable=line-too-long,useless-suppression,too-many-lines
|
|
2
|
+
# coding=utf-8
|
|
3
|
+
# --------------------------------------------------------------------------
|
|
4
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
+
# Code generated by Microsoft (R) Python Code Generator.
|
|
7
|
+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
|
+
# --------------------------------------------------------------------------
|
|
9
|
+
# pylint: disable=useless-super-delegation
|
|
10
|
+
|
|
11
|
+
import datetime
|
|
12
|
+
from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload
|
|
13
|
+
|
|
14
|
+
from .. import _model_base
|
|
15
|
+
from .._model_base import rest_discriminator, rest_field
|
|
16
|
+
from ._enums import CredentialType, DatasetType, DeploymentType, IndexType, PendingUploadType
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from .. import models as _models
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AnnotationDTO(_model_base.Model):
|
|
23
|
+
"""Represents the data transfer object for an annotation.
|
|
24
|
+
|
|
25
|
+
:ivar annotation_task: The task associated with the annotation. Required.
|
|
26
|
+
:vartype annotation_task: str
|
|
27
|
+
:ivar content_type: The type of content being annotated. Required.
|
|
28
|
+
:vartype content_type: str
|
|
29
|
+
:ivar user_text_list: A list of user-provided text inputs. Required.
|
|
30
|
+
:vartype user_text_list: list[str]
|
|
31
|
+
:ivar contents: A collection of content objects related to the annotation. Required.
|
|
32
|
+
:vartype contents: list[~azure.ai.projects.onedp.models.Content]
|
|
33
|
+
:ivar metric_list: A list of metrics associated with the annotation. Required.
|
|
34
|
+
:vartype metric_list: list[str]
|
|
35
|
+
:ivar prompt_version: The version of the prompt used for the annotation. Required.
|
|
36
|
+
:vartype prompt_version: str
|
|
37
|
+
:ivar user_agent: The user agent information. Required.
|
|
38
|
+
:vartype user_agent: str
|
|
39
|
+
:ivar partner_id: The partner identifier. Required.
|
|
40
|
+
:vartype partner_id: str
|
|
41
|
+
:ivar model_id: The model identifier. Required.
|
|
42
|
+
:vartype model_id: str
|
|
43
|
+
:ivar inference_type: The type of inference performed. Required.
|
|
44
|
+
:vartype inference_type: str
|
|
45
|
+
:ivar client_request_id: The client request identifier. Required.
|
|
46
|
+
:vartype client_request_id: str
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
annotation_task: str = rest_field(name="AnnotationTask", visibility=["read", "create", "update", "delete", "query"])
|
|
50
|
+
"""The task associated with the annotation. Required."""
|
|
51
|
+
content_type: str = rest_field(name="ContentType", visibility=["read", "create", "update", "delete", "query"])
|
|
52
|
+
"""The type of content being annotated. Required."""
|
|
53
|
+
user_text_list: List[str] = rest_field(
|
|
54
|
+
name="UserTextList", visibility=["read", "create", "update", "delete", "query"]
|
|
55
|
+
)
|
|
56
|
+
"""A list of user-provided text inputs. Required."""
|
|
57
|
+
contents: List["_models.Content"] = rest_field(
|
|
58
|
+
name="Contents", visibility=["read", "create", "update", "delete", "query"]
|
|
59
|
+
)
|
|
60
|
+
"""A collection of content objects related to the annotation. Required."""
|
|
61
|
+
metric_list: List[str] = rest_field(name="MetricList", visibility=["read", "create", "update", "delete", "query"])
|
|
62
|
+
"""A list of metrics associated with the annotation. Required."""
|
|
63
|
+
prompt_version: str = rest_field(name="PromptVersion", visibility=["read", "create", "update", "delete", "query"])
|
|
64
|
+
"""The version of the prompt used for the annotation. Required."""
|
|
65
|
+
user_agent: str = rest_field(name="UserAgent", visibility=["read", "create", "update", "delete", "query"])
|
|
66
|
+
"""The user agent information. Required."""
|
|
67
|
+
partner_id: str = rest_field(name="PartnerId", visibility=["read", "create", "update", "delete", "query"])
|
|
68
|
+
"""The partner identifier. Required."""
|
|
69
|
+
model_id: str = rest_field(name="ModelId", visibility=["read", "create", "update", "delete", "query"])
|
|
70
|
+
"""The model identifier. Required."""
|
|
71
|
+
inference_type: str = rest_field(name="InferenceType", visibility=["read", "create", "update", "delete", "query"])
|
|
72
|
+
"""The type of inference performed. Required."""
|
|
73
|
+
client_request_id: str = rest_field(
|
|
74
|
+
name="ClientRequestId", visibility=["read", "create", "update", "delete", "query"]
|
|
75
|
+
)
|
|
76
|
+
"""The client request identifier. Required."""
|
|
77
|
+
|
|
78
|
+
@overload
|
|
79
|
+
def __init__(
|
|
80
|
+
self,
|
|
81
|
+
*,
|
|
82
|
+
annotation_task: str,
|
|
83
|
+
content_type: str,
|
|
84
|
+
user_text_list: List[str],
|
|
85
|
+
contents: List["_models.Content"],
|
|
86
|
+
metric_list: List[str],
|
|
87
|
+
prompt_version: str,
|
|
88
|
+
user_agent: str,
|
|
89
|
+
partner_id: str,
|
|
90
|
+
model_id: str,
|
|
91
|
+
inference_type: str,
|
|
92
|
+
client_request_id: str,
|
|
93
|
+
) -> None: ...
|
|
94
|
+
|
|
95
|
+
@overload
|
|
96
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
97
|
+
"""
|
|
98
|
+
:param mapping: raw JSON to initialize the model.
|
|
99
|
+
:type mapping: Mapping[str, Any]
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
103
|
+
super().__init__(*args, **kwargs)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class TargetModelConfig(_model_base.Model):
|
|
107
|
+
"""Abstract class for model configuration.
|
|
108
|
+
|
|
109
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
110
|
+
AOAIModelConfig, MAASModelConfig
|
|
111
|
+
|
|
112
|
+
:ivar type: Type of the model configuration. Required. Default value is None.
|
|
113
|
+
:vartype type: str
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
117
|
+
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
|
|
118
|
+
"""Type of the model configuration. Required. Default value is None."""
|
|
119
|
+
|
|
120
|
+
@overload
|
|
121
|
+
def __init__(
|
|
122
|
+
self,
|
|
123
|
+
*,
|
|
124
|
+
type: str,
|
|
125
|
+
) -> None: ...
|
|
126
|
+
|
|
127
|
+
@overload
|
|
128
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
129
|
+
"""
|
|
130
|
+
:param mapping: raw JSON to initialize the model.
|
|
131
|
+
:type mapping: Mapping[str, Any]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
135
|
+
super().__init__(*args, **kwargs)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class AOAIModelConfig(TargetModelConfig, discriminator="AOAI"):
|
|
139
|
+
"""Azure OpenAI model configuration. The API version would be selected by the service for querying
|
|
140
|
+
the model.
|
|
141
|
+
|
|
142
|
+
:ivar type: Required. Default value is "AOAI".
|
|
143
|
+
:vartype type: str
|
|
144
|
+
:ivar azure_endpoint: Endpoint targetURI for AOAI model. Required.
|
|
145
|
+
:vartype azure_endpoint: str
|
|
146
|
+
:ivar api_key: API Key for AOAI model. Required.
|
|
147
|
+
:vartype api_key: str
|
|
148
|
+
:ivar azure_deployment: Deployment name for AOAI model. Required.
|
|
149
|
+
:vartype azure_deployment: str
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
type: Literal["AOAI"] = rest_discriminator(name="type", visibility=["read"]) # type: ignore
|
|
153
|
+
"""Required. Default value is \"AOAI\"."""
|
|
154
|
+
azure_endpoint: str = rest_field(name="azureEndpoint", visibility=["read", "create", "update", "delete", "query"])
|
|
155
|
+
"""Endpoint targetURI for AOAI model. Required."""
|
|
156
|
+
api_key: str = rest_field(name="apiKey", visibility=["read", "create", "update", "delete", "query"])
|
|
157
|
+
"""API Key for AOAI model. Required."""
|
|
158
|
+
azure_deployment: str = rest_field(
|
|
159
|
+
name="azureDeployment", visibility=["read", "create", "update", "delete", "query"]
|
|
160
|
+
)
|
|
161
|
+
"""Deployment name for AOAI model. Required."""
|
|
162
|
+
|
|
163
|
+
@overload
|
|
164
|
+
def __init__(
|
|
165
|
+
self,
|
|
166
|
+
*,
|
|
167
|
+
azure_endpoint: str,
|
|
168
|
+
api_key: str,
|
|
169
|
+
azure_deployment: str,
|
|
170
|
+
) -> None: ...
|
|
171
|
+
|
|
172
|
+
@overload
|
|
173
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
174
|
+
"""
|
|
175
|
+
:param mapping: raw JSON to initialize the model.
|
|
176
|
+
:type mapping: Mapping[str, Any]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
180
|
+
super().__init__(*args, type="AOAI", **kwargs)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class BaseCredentials(_model_base.Model):
|
|
184
|
+
"""A base class for connection credentials.
|
|
185
|
+
|
|
186
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
187
|
+
EntraIDCredentials, ApiKeyCredentials, CustomCredential, NoAuthenticationCredentials,
|
|
188
|
+
SASCredentials
|
|
189
|
+
|
|
190
|
+
:ivar auth_type: The type of credential used by the connection. Required. Known values are:
|
|
191
|
+
"ApiKey", "AAD", "SAS", "CustomKeys", and "None".
|
|
192
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.CredentialType
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
196
|
+
auth_type: str = rest_discriminator(name="authType", visibility=["read"])
|
|
197
|
+
"""The type of credential used by the connection. Required. Known values are: \"ApiKey\", \"AAD\",
|
|
198
|
+
\"SAS\", \"CustomKeys\", and \"None\"."""
|
|
199
|
+
|
|
200
|
+
@overload
|
|
201
|
+
def __init__(
|
|
202
|
+
self,
|
|
203
|
+
*,
|
|
204
|
+
auth_type: str,
|
|
205
|
+
) -> None: ...
|
|
206
|
+
|
|
207
|
+
@overload
|
|
208
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
209
|
+
"""
|
|
210
|
+
:param mapping: raw JSON to initialize the model.
|
|
211
|
+
:type mapping: Mapping[str, Any]
|
|
212
|
+
"""
|
|
213
|
+
|
|
214
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
215
|
+
super().__init__(*args, **kwargs)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"):
|
|
219
|
+
"""API Key Credential definition.
|
|
220
|
+
|
|
221
|
+
:ivar auth_type: The credentail type. Required. API Key credential
|
|
222
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.API_KEY
|
|
223
|
+
:ivar api_key: API Key.
|
|
224
|
+
:vartype api_key: str
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
auth_type: Literal[CredentialType.API_KEY] = rest_discriminator(name="authType", visibility=["read"]) # type: ignore
|
|
228
|
+
"""The credentail type. Required. API Key credential"""
|
|
229
|
+
api_key: Optional[str] = rest_field(name="apiKey", visibility=["read"])
|
|
230
|
+
"""API Key."""
|
|
231
|
+
|
|
232
|
+
@overload
|
|
233
|
+
def __init__(
|
|
234
|
+
self,
|
|
235
|
+
) -> None: ...
|
|
236
|
+
|
|
237
|
+
@overload
|
|
238
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
239
|
+
"""
|
|
240
|
+
:param mapping: raw JSON to initialize the model.
|
|
241
|
+
:type mapping: Mapping[str, Any]
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
245
|
+
super().__init__(*args, auth_type=CredentialType.API_KEY, **kwargs)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class AssetCredentialRequest(_model_base.Model):
|
|
249
|
+
"""Asset Credential Request.
|
|
250
|
+
|
|
251
|
+
:ivar blob_uri: Blob URI. Required.
|
|
252
|
+
:vartype blob_uri: str
|
|
253
|
+
"""
|
|
254
|
+
|
|
255
|
+
blob_uri: str = rest_field(name="BlobUri", visibility=["read", "create", "update", "delete", "query"])
|
|
256
|
+
"""Blob URI. Required."""
|
|
257
|
+
|
|
258
|
+
@overload
|
|
259
|
+
def __init__(
|
|
260
|
+
self,
|
|
261
|
+
*,
|
|
262
|
+
blob_uri: str,
|
|
263
|
+
) -> None: ...
|
|
264
|
+
|
|
265
|
+
@overload
|
|
266
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
267
|
+
"""
|
|
268
|
+
:param mapping: raw JSON to initialize the model.
|
|
269
|
+
:type mapping: Mapping[str, Any]
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
273
|
+
super().__init__(*args, **kwargs)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class AssetCredentialResponse(_model_base.Model):
|
|
277
|
+
"""Represents a reference to a blob for consumption.
|
|
278
|
+
|
|
279
|
+
:ivar blob_reference_for_consumption: Credential info to access the storage account. Required.
|
|
280
|
+
:vartype blob_reference_for_consumption:
|
|
281
|
+
~azure.ai.projects.onedp.models.BlobReferenceForConsumption
|
|
282
|
+
"""
|
|
283
|
+
|
|
284
|
+
blob_reference_for_consumption: "_models.BlobReferenceForConsumption" = rest_field(
|
|
285
|
+
name="blobReferenceForConsumption", visibility=["read", "create", "update", "delete", "query"]
|
|
286
|
+
)
|
|
287
|
+
"""Credential info to access the storage account. Required."""
|
|
288
|
+
|
|
289
|
+
@overload
|
|
290
|
+
def __init__(
|
|
291
|
+
self,
|
|
292
|
+
*,
|
|
293
|
+
blob_reference_for_consumption: "_models.BlobReferenceForConsumption",
|
|
294
|
+
) -> None: ...
|
|
295
|
+
|
|
296
|
+
@overload
|
|
297
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
298
|
+
"""
|
|
299
|
+
:param mapping: raw JSON to initialize the model.
|
|
300
|
+
:type mapping: Mapping[str, Any]
|
|
301
|
+
"""
|
|
302
|
+
|
|
303
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
304
|
+
super().__init__(*args, **kwargs)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
class AttackObjective(_model_base.Model):
|
|
308
|
+
"""Attack Objective.
|
|
309
|
+
|
|
310
|
+
:ivar id: The unique identifier. Required.
|
|
311
|
+
:vartype id: str
|
|
312
|
+
:ivar metadata: The metadata.
|
|
313
|
+
:vartype metadata: ~azure.ai.projects.onedp.models.Metadata
|
|
314
|
+
:ivar source: List of sources. Required.
|
|
315
|
+
:vartype source: list[str]
|
|
316
|
+
:ivar modality: The modality. Required.
|
|
317
|
+
:vartype modality: str
|
|
318
|
+
:ivar messages: The messages. Required.
|
|
319
|
+
:vartype messages: list[~azure.ai.projects.onedp.models.Message]
|
|
320
|
+
"""
|
|
321
|
+
|
|
322
|
+
id: str = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
|
|
323
|
+
"""The unique identifier. Required."""
|
|
324
|
+
metadata: Optional["_models.Metadata"] = rest_field(
|
|
325
|
+
name="Metadata", visibility=["read", "create", "update", "delete", "query"]
|
|
326
|
+
)
|
|
327
|
+
"""The metadata."""
|
|
328
|
+
source: List[str] = rest_field(name="Source", visibility=["read", "create", "update", "delete", "query"])
|
|
329
|
+
"""List of sources. Required."""
|
|
330
|
+
modality: str = rest_field(name="Modality", visibility=["read", "create", "update", "delete", "query"])
|
|
331
|
+
"""The modality. Required."""
|
|
332
|
+
messages: List["_models.Message"] = rest_field(
|
|
333
|
+
name="Messages", visibility=["read", "create", "update", "delete", "query"]
|
|
334
|
+
)
|
|
335
|
+
"""The messages. Required."""
|
|
336
|
+
|
|
337
|
+
@overload
|
|
338
|
+
def __init__(
|
|
339
|
+
self,
|
|
340
|
+
*,
|
|
341
|
+
id: str, # pylint: disable=redefined-builtin
|
|
342
|
+
source: List[str],
|
|
343
|
+
modality: str,
|
|
344
|
+
messages: List["_models.Message"],
|
|
345
|
+
metadata: Optional["_models.Metadata"] = None,
|
|
346
|
+
) -> None: ...
|
|
347
|
+
|
|
348
|
+
@overload
|
|
349
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
350
|
+
"""
|
|
351
|
+
:param mapping: raw JSON to initialize the model.
|
|
352
|
+
:type mapping: Mapping[str, Any]
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
356
|
+
super().__init__(*args, **kwargs)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
class Index(_model_base.Model):
|
|
360
|
+
"""Index resource Definition.
|
|
361
|
+
|
|
362
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
363
|
+
AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex
|
|
364
|
+
|
|
365
|
+
:ivar type: Type of index. Required. Known values are: "AzureSearch",
|
|
366
|
+
"CosmosDBNoSqlVectorStore", and "ManagedAzureSearch".
|
|
367
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.IndexType
|
|
368
|
+
:ivar stage: Asset stage.
|
|
369
|
+
:vartype stage: str
|
|
370
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
371
|
+
:vartype id: str
|
|
372
|
+
:ivar name: The name of the resource. Required.
|
|
373
|
+
:vartype name: str
|
|
374
|
+
:ivar version: The version of the resource. Required.
|
|
375
|
+
:vartype version: str
|
|
376
|
+
:ivar description: The asset description text.
|
|
377
|
+
:vartype description: str
|
|
378
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
379
|
+
:vartype tags: dict[str, str]
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
383
|
+
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
|
|
384
|
+
"""Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and
|
|
385
|
+
\"ManagedAzureSearch\"."""
|
|
386
|
+
stage: Optional[str] = rest_field(visibility=["read", "create", "update"])
|
|
387
|
+
"""Asset stage."""
|
|
388
|
+
id: Optional[str] = rest_field(visibility=["read"])
|
|
389
|
+
"""A unique identifier for the asset, assetId probably?."""
|
|
390
|
+
name: str = rest_field(visibility=["read"])
|
|
391
|
+
"""The name of the resource. Required."""
|
|
392
|
+
version: str = rest_field(visibility=["read"])
|
|
393
|
+
"""The version of the resource. Required."""
|
|
394
|
+
description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
395
|
+
"""The asset description text."""
|
|
396
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
397
|
+
"""Tag dictionary. Tags can be added, removed, and updated."""
|
|
398
|
+
|
|
399
|
+
@overload
|
|
400
|
+
def __init__(
|
|
401
|
+
self,
|
|
402
|
+
*,
|
|
403
|
+
type: str,
|
|
404
|
+
stage: Optional[str] = None,
|
|
405
|
+
description: Optional[str] = None,
|
|
406
|
+
tags: Optional[Dict[str, str]] = None,
|
|
407
|
+
) -> None: ...
|
|
408
|
+
|
|
409
|
+
@overload
|
|
410
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
411
|
+
"""
|
|
412
|
+
:param mapping: raw JSON to initialize the model.
|
|
413
|
+
:type mapping: Mapping[str, Any]
|
|
414
|
+
"""
|
|
415
|
+
|
|
416
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
417
|
+
super().__init__(*args, **kwargs)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
class AzureAISearchIndex(Index, discriminator="AzureSearch"):
|
|
421
|
+
"""Azure AI Search Index Definition.
|
|
422
|
+
|
|
423
|
+
:ivar stage: Asset stage.
|
|
424
|
+
:vartype stage: str
|
|
425
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
426
|
+
:vartype id: str
|
|
427
|
+
:ivar name: The name of the resource. Required.
|
|
428
|
+
:vartype name: str
|
|
429
|
+
:ivar version: The version of the resource. Required.
|
|
430
|
+
:vartype version: str
|
|
431
|
+
:ivar description: The asset description text.
|
|
432
|
+
:vartype description: str
|
|
433
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
434
|
+
:vartype tags: dict[str, str]
|
|
435
|
+
:ivar type: Type of index. Required. Azure search
|
|
436
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.AZURE_SEARCH
|
|
437
|
+
:ivar connection_name: Name of connection to Azure AI Search. Required.
|
|
438
|
+
:vartype connection_name: str
|
|
439
|
+
:ivar index_name: Name of index in Azure AI Search resource to attach. Required.
|
|
440
|
+
:vartype index_name: str
|
|
441
|
+
"""
|
|
442
|
+
|
|
443
|
+
type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
444
|
+
"""Type of index. Required. Azure search"""
|
|
445
|
+
connection_name: str = rest_field(name="connectionName", visibility=["read", "create", "update", "delete", "query"])
|
|
446
|
+
"""Name of connection to Azure AI Search. Required."""
|
|
447
|
+
index_name: str = rest_field(name="indexName", visibility=["read", "create", "update", "delete", "query"])
|
|
448
|
+
"""Name of index in Azure AI Search resource to attach. Required."""
|
|
449
|
+
|
|
450
|
+
@overload
|
|
451
|
+
def __init__(
|
|
452
|
+
self,
|
|
453
|
+
*,
|
|
454
|
+
connection_name: str,
|
|
455
|
+
index_name: str,
|
|
456
|
+
stage: Optional[str] = None,
|
|
457
|
+
description: Optional[str] = None,
|
|
458
|
+
tags: Optional[Dict[str, str]] = None,
|
|
459
|
+
) -> None: ...
|
|
460
|
+
|
|
461
|
+
@overload
|
|
462
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
463
|
+
"""
|
|
464
|
+
:param mapping: raw JSON to initialize the model.
|
|
465
|
+
:type mapping: Mapping[str, Any]
|
|
466
|
+
"""
|
|
467
|
+
|
|
468
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
469
|
+
super().__init__(*args, type=IndexType.AZURE_SEARCH, **kwargs)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
class BlobReferenceForConsumption(_model_base.Model):
|
|
473
|
+
"""Represents a reference to a blob for consumption.
|
|
474
|
+
|
|
475
|
+
:ivar blob_uri: Blob URI path for client to upload data. Example:
|
|
476
|
+
`https://blob.windows.core.net/Container/Path <https://blob.windows.core.net/Container/Path>`_.
|
|
477
|
+
Required.
|
|
478
|
+
:vartype blob_uri: str
|
|
479
|
+
:ivar storage_account_arm_id: ARM ID of the storage account to use. Required.
|
|
480
|
+
:vartype storage_account_arm_id: str
|
|
481
|
+
:ivar credential: Credential info to access the storage account. Required.
|
|
482
|
+
:vartype credential: ~azure.ai.projects.onedp.models.SasCredential
|
|
483
|
+
"""
|
|
484
|
+
|
|
485
|
+
blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"])
|
|
486
|
+
"""Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path
|
|
487
|
+
<https://blob.windows.core.net/Container/Path>`_. Required."""
|
|
488
|
+
storage_account_arm_id: str = rest_field(
|
|
489
|
+
name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"]
|
|
490
|
+
)
|
|
491
|
+
"""ARM ID of the storage account to use. Required."""
|
|
492
|
+
credential: "_models.SasCredential" = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
493
|
+
"""Credential info to access the storage account. Required."""
|
|
494
|
+
|
|
495
|
+
@overload
|
|
496
|
+
def __init__(
|
|
497
|
+
self,
|
|
498
|
+
*,
|
|
499
|
+
blob_uri: str,
|
|
500
|
+
storage_account_arm_id: str,
|
|
501
|
+
credential: "_models.SasCredential",
|
|
502
|
+
) -> None: ...
|
|
503
|
+
|
|
504
|
+
@overload
|
|
505
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
506
|
+
"""
|
|
507
|
+
:param mapping: raw JSON to initialize the model.
|
|
508
|
+
:type mapping: Mapping[str, Any]
|
|
509
|
+
"""
|
|
510
|
+
|
|
511
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
512
|
+
super().__init__(*args, **kwargs)
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
class Connection(_model_base.Model):
|
|
516
|
+
"""Response from the list and get connections operations.
|
|
517
|
+
|
|
518
|
+
:ivar auth_type: Discriminator property for Connection. Required.
|
|
519
|
+
:vartype auth_type: str
|
|
520
|
+
:ivar name: The name of the resource. Required.
|
|
521
|
+
:vartype name: str
|
|
522
|
+
:ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob",
|
|
523
|
+
"AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", and
|
|
524
|
+
"CustomKeys".
|
|
525
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.ConnectionType
|
|
526
|
+
:ivar target: The connection URL to be used for this service. Required.
|
|
527
|
+
:vartype target: str
|
|
528
|
+
:ivar is_default: Whether the connection is tagged as the default connection of its type.
|
|
529
|
+
Required.
|
|
530
|
+
:vartype is_default: bool
|
|
531
|
+
:ivar credentials: The credentials used by the connection. Required.
|
|
532
|
+
:vartype credentials: ~azure.ai.projects.onedp.models.BaseCredentials
|
|
533
|
+
:ivar metadata: Metadata of the connection. Required.
|
|
534
|
+
:vartype metadata: dict[str, str]
|
|
535
|
+
"""
|
|
536
|
+
|
|
537
|
+
auth_type: str = rest_discriminator(name="authType")
|
|
538
|
+
"""Discriminator property for Connection. Required."""
|
|
539
|
+
name: str = rest_field(visibility=["read"])
|
|
540
|
+
"""The name of the resource. Required."""
|
|
541
|
+
type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"])
|
|
542
|
+
"""Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\",
|
|
543
|
+
\"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\",
|
|
544
|
+
\"AppInsights\", and \"CustomKeys\"."""
|
|
545
|
+
target: str = rest_field(visibility=["read"])
|
|
546
|
+
"""The connection URL to be used for this service. Required."""
|
|
547
|
+
is_default: bool = rest_field(name="isDefault", visibility=["read"])
|
|
548
|
+
"""Whether the connection is tagged as the default connection of its type. Required."""
|
|
549
|
+
credentials: "_models.BaseCredentials" = rest_field(visibility=["read"])
|
|
550
|
+
"""The credentials used by the connection. Required."""
|
|
551
|
+
metadata: Dict[str, str] = rest_field(visibility=["read"])
|
|
552
|
+
"""Metadata of the connection. Required."""
|
|
553
|
+
|
|
554
|
+
@overload
|
|
555
|
+
def __init__(
|
|
556
|
+
self,
|
|
557
|
+
) -> None: ...
|
|
558
|
+
|
|
559
|
+
@overload
|
|
560
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
561
|
+
"""
|
|
562
|
+
:param mapping: raw JSON to initialize the model.
|
|
563
|
+
:type mapping: Mapping[str, Any]
|
|
564
|
+
"""
|
|
565
|
+
|
|
566
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
567
|
+
super().__init__(*args, **kwargs)
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
class Content(_model_base.Model):
|
|
571
|
+
"""Message content.
|
|
572
|
+
|
|
573
|
+
:ivar messages: The type of content. Required.
|
|
574
|
+
:vartype messages: list[any]
|
|
575
|
+
"""
|
|
576
|
+
|
|
577
|
+
messages: List[Any] = rest_field(name="Messages", visibility=["read", "create", "update", "delete", "query"])
|
|
578
|
+
"""The type of content. Required."""
|
|
579
|
+
|
|
580
|
+
@overload
|
|
581
|
+
def __init__(
|
|
582
|
+
self,
|
|
583
|
+
*,
|
|
584
|
+
messages: List[Any],
|
|
585
|
+
) -> None: ...
|
|
586
|
+
|
|
587
|
+
@overload
|
|
588
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
589
|
+
"""
|
|
590
|
+
:param mapping: raw JSON to initialize the model.
|
|
591
|
+
:type mapping: Mapping[str, Any]
|
|
592
|
+
"""
|
|
593
|
+
|
|
594
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
595
|
+
super().__init__(*args, **kwargs)
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"):
|
|
599
|
+
"""CosmosDB Vector Store Index Definition.
|
|
600
|
+
|
|
601
|
+
:ivar stage: Asset stage.
|
|
602
|
+
:vartype stage: str
|
|
603
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
604
|
+
:vartype id: str
|
|
605
|
+
:ivar name: The name of the resource. Required.
|
|
606
|
+
:vartype name: str
|
|
607
|
+
:ivar version: The version of the resource. Required.
|
|
608
|
+
:vartype version: str
|
|
609
|
+
:ivar description: The asset description text.
|
|
610
|
+
:vartype description: str
|
|
611
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
612
|
+
:vartype tags: dict[str, str]
|
|
613
|
+
:ivar type: Type of index. Required. CosmosDB
|
|
614
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.COSMOS_DB
|
|
615
|
+
:ivar connection_name: Name of connection to CosmosDB. Required.
|
|
616
|
+
:vartype connection_name: str
|
|
617
|
+
:ivar database_name: Name of the CosmosDB Database. Required.
|
|
618
|
+
:vartype database_name: str
|
|
619
|
+
:ivar container_name: Name of CosmosDB Container. Required.
|
|
620
|
+
:vartype container_name: str
|
|
621
|
+
:ivar embedding_configuration: Embedding model configuration. Required.
|
|
622
|
+
:vartype embedding_configuration: ~azure.ai.projects.onedp.models.EmbeddingConfiguration
|
|
623
|
+
"""
|
|
624
|
+
|
|
625
|
+
type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
626
|
+
"""Type of index. Required. CosmosDB"""
|
|
627
|
+
connection_name: str = rest_field(name="connectionName", visibility=["read", "create", "update", "delete", "query"])
|
|
628
|
+
"""Name of connection to CosmosDB. Required."""
|
|
629
|
+
database_name: str = rest_field(name="databaseName", visibility=["read", "create", "update", "delete", "query"])
|
|
630
|
+
"""Name of the CosmosDB Database. Required."""
|
|
631
|
+
container_name: str = rest_field(name="containerName", visibility=["read", "create", "update", "delete", "query"])
|
|
632
|
+
"""Name of CosmosDB Container. Required."""
|
|
633
|
+
embedding_configuration: "_models.EmbeddingConfiguration" = rest_field(
|
|
634
|
+
name="embeddingConfiguration", visibility=["read", "create", "update", "delete", "query"]
|
|
635
|
+
)
|
|
636
|
+
"""Embedding model configuration. Required."""
|
|
637
|
+
|
|
638
|
+
@overload
|
|
639
|
+
def __init__(
|
|
640
|
+
self,
|
|
641
|
+
*,
|
|
642
|
+
connection_name: str,
|
|
643
|
+
database_name: str,
|
|
644
|
+
container_name: str,
|
|
645
|
+
embedding_configuration: "_models.EmbeddingConfiguration",
|
|
646
|
+
stage: Optional[str] = None,
|
|
647
|
+
description: Optional[str] = None,
|
|
648
|
+
tags: Optional[Dict[str, str]] = None,
|
|
649
|
+
) -> None: ...
|
|
650
|
+
|
|
651
|
+
@overload
|
|
652
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
653
|
+
"""
|
|
654
|
+
:param mapping: raw JSON to initialize the model.
|
|
655
|
+
:type mapping: Mapping[str, Any]
|
|
656
|
+
"""
|
|
657
|
+
|
|
658
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
659
|
+
super().__init__(*args, type=IndexType.COSMOS_DB, **kwargs)
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
class CustomCredential(BaseCredentials, discriminator="CustomKeys"):
|
|
663
|
+
"""Custom credential defintion.
|
|
664
|
+
|
|
665
|
+
:ivar auth_type: The credential type. Required. Custom credential
|
|
666
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.CUSTOM
|
|
667
|
+
"""
|
|
668
|
+
|
|
669
|
+
auth_type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="authType", visibility=["read"]) # type: ignore
|
|
670
|
+
"""The credential type. Required. Custom credential"""
|
|
671
|
+
|
|
672
|
+
@overload
|
|
673
|
+
def __init__(
|
|
674
|
+
self,
|
|
675
|
+
) -> None: ...
|
|
676
|
+
|
|
677
|
+
@overload
|
|
678
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
679
|
+
"""
|
|
680
|
+
:param mapping: raw JSON to initialize the model.
|
|
681
|
+
:type mapping: Mapping[str, Any]
|
|
682
|
+
"""
|
|
683
|
+
|
|
684
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
685
|
+
super().__init__(*args, auth_type=CredentialType.CUSTOM, **kwargs)
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
class CustomizationParameters(_model_base.Model):
|
|
689
|
+
"""Customization Parameters.
|
|
690
|
+
|
|
691
|
+
:ivar application_scenario: Application scenario.
|
|
692
|
+
:vartype application_scenario: str
|
|
693
|
+
:ivar harm_categories: List of harm categories. Required.
|
|
694
|
+
:vartype harm_categories: list[str]
|
|
695
|
+
"""
|
|
696
|
+
|
|
697
|
+
application_scenario: Optional[str] = rest_field(
|
|
698
|
+
name="ApplicationScenario", visibility=["read", "create", "update", "delete", "query"]
|
|
699
|
+
)
|
|
700
|
+
"""Application scenario."""
|
|
701
|
+
harm_categories: List[str] = rest_field(
|
|
702
|
+
name="HarmCategories", visibility=["read", "create", "update", "delete", "query"]
|
|
703
|
+
)
|
|
704
|
+
"""List of harm categories. Required."""
|
|
705
|
+
|
|
706
|
+
@overload
|
|
707
|
+
def __init__(
|
|
708
|
+
self,
|
|
709
|
+
*,
|
|
710
|
+
harm_categories: List[str],
|
|
711
|
+
application_scenario: Optional[str] = None,
|
|
712
|
+
) -> None: ...
|
|
713
|
+
|
|
714
|
+
@overload
|
|
715
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
716
|
+
"""
|
|
717
|
+
:param mapping: raw JSON to initialize the model.
|
|
718
|
+
:type mapping: Mapping[str, Any]
|
|
719
|
+
"""
|
|
720
|
+
|
|
721
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
722
|
+
super().__init__(*args, **kwargs)
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
class DatasetVersion(_model_base.Model):
|
|
726
|
+
"""DatasetVersion Definition.
|
|
727
|
+
|
|
728
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
729
|
+
FileDatasetVersion, FolderDatasetVersion
|
|
730
|
+
|
|
731
|
+
:ivar dataset_uri: [Required] Uri of the data. Example:
|
|
732
|
+
`https://go.microsoft.com/fwlink/?linkid=2202330
|
|
733
|
+
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
|
|
734
|
+
:vartype dataset_uri: str
|
|
735
|
+
:ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder".
|
|
736
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.DatasetType
|
|
737
|
+
:ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If
|
|
738
|
+
true, the underlying data will be deleted when the dataset version is deleted.
|
|
739
|
+
:vartype is_reference: bool
|
|
740
|
+
:ivar stage: Asset stage.
|
|
741
|
+
:vartype stage: str
|
|
742
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
743
|
+
:vartype id: str
|
|
744
|
+
:ivar name: The name of the resource. Required.
|
|
745
|
+
:vartype name: str
|
|
746
|
+
:ivar version: The version of the resource. Required.
|
|
747
|
+
:vartype version: str
|
|
748
|
+
:ivar description: The asset description text.
|
|
749
|
+
:vartype description: str
|
|
750
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
751
|
+
:vartype tags: dict[str, str]
|
|
752
|
+
"""
|
|
753
|
+
|
|
754
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
755
|
+
dataset_uri: str = rest_field(name="datasetUri", visibility=["read", "create"])
|
|
756
|
+
"""[Required] Uri of the data. Example: `https://go.microsoft.com/fwlink/?linkid=2202330
|
|
757
|
+
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required."""
|
|
758
|
+
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
|
|
759
|
+
"""Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\"."""
|
|
760
|
+
is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"])
|
|
761
|
+
"""Indicates if dataset is reference only or managed by dataset service. If true, the underlying
|
|
762
|
+
data will be deleted when the dataset version is deleted."""
|
|
763
|
+
stage: Optional[str] = rest_field(visibility=["read", "create", "update"])
|
|
764
|
+
"""Asset stage."""
|
|
765
|
+
id: Optional[str] = rest_field(visibility=["read"])
|
|
766
|
+
"""A unique identifier for the asset, assetId probably?."""
|
|
767
|
+
name: str = rest_field(visibility=["read"])
|
|
768
|
+
"""The name of the resource. Required."""
|
|
769
|
+
version: str = rest_field(visibility=["read"])
|
|
770
|
+
"""The version of the resource. Required."""
|
|
771
|
+
description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
772
|
+
"""The asset description text."""
|
|
773
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
774
|
+
"""Tag dictionary. Tags can be added, removed, and updated."""
|
|
775
|
+
|
|
776
|
+
@overload
|
|
777
|
+
def __init__(
|
|
778
|
+
self,
|
|
779
|
+
*,
|
|
780
|
+
dataset_uri: str,
|
|
781
|
+
type: str,
|
|
782
|
+
stage: Optional[str] = None,
|
|
783
|
+
description: Optional[str] = None,
|
|
784
|
+
tags: Optional[Dict[str, str]] = None,
|
|
785
|
+
) -> None: ...
|
|
786
|
+
|
|
787
|
+
@overload
|
|
788
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
789
|
+
"""
|
|
790
|
+
:param mapping: raw JSON to initialize the model.
|
|
791
|
+
:type mapping: Mapping[str, Any]
|
|
792
|
+
"""
|
|
793
|
+
|
|
794
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
795
|
+
super().__init__(*args, **kwargs)
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
class Deployment(_model_base.Model):
|
|
799
|
+
"""Model Deployment Definition.
|
|
800
|
+
|
|
801
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
802
|
+
ModelDeployment
|
|
803
|
+
|
|
804
|
+
:ivar type: The type of the deployment. Required. "ModelDeployment"
|
|
805
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.DeploymentType
|
|
806
|
+
:ivar name: Name of the deployment. Required.
|
|
807
|
+
:vartype name: str
|
|
808
|
+
"""
|
|
809
|
+
|
|
810
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
811
|
+
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
|
|
812
|
+
"""The type of the deployment. Required. \"ModelDeployment\""""
|
|
813
|
+
name: str = rest_field(visibility=["read"])
|
|
814
|
+
"""Name of the deployment. Required."""
|
|
815
|
+
|
|
816
|
+
@overload
|
|
817
|
+
def __init__(
|
|
818
|
+
self,
|
|
819
|
+
*,
|
|
820
|
+
type: str,
|
|
821
|
+
) -> None: ...
|
|
822
|
+
|
|
823
|
+
@overload
|
|
824
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
825
|
+
"""
|
|
826
|
+
:param mapping: raw JSON to initialize the model.
|
|
827
|
+
:type mapping: Mapping[str, Any]
|
|
828
|
+
"""
|
|
829
|
+
|
|
830
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
831
|
+
super().__init__(*args, **kwargs)
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
class EmbeddingConfiguration(_model_base.Model):
|
|
835
|
+
"""Embedding configuration class.
|
|
836
|
+
|
|
837
|
+
:ivar model_deployment_name: Deployment name of embedding model. It can point to a model
|
|
838
|
+
deployment either in the parent AIServices or a connection. Required.
|
|
839
|
+
:vartype model_deployment_name: str
|
|
840
|
+
:ivar embedding_field: Embedding field. Required.
|
|
841
|
+
:vartype embedding_field: str
|
|
842
|
+
"""
|
|
843
|
+
|
|
844
|
+
model_deployment_name: str = rest_field(
|
|
845
|
+
name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"]
|
|
846
|
+
)
|
|
847
|
+
"""Deployment name of embedding model. It can point to a model deployment either in the parent
|
|
848
|
+
AIServices or a connection. Required."""
|
|
849
|
+
embedding_field: str = rest_field(name="embeddingField", visibility=["read", "create", "update", "delete", "query"])
|
|
850
|
+
"""Embedding field. Required."""
|
|
851
|
+
|
|
852
|
+
@overload
|
|
853
|
+
def __init__(
|
|
854
|
+
self,
|
|
855
|
+
*,
|
|
856
|
+
model_deployment_name: str,
|
|
857
|
+
embedding_field: str,
|
|
858
|
+
) -> None: ...
|
|
859
|
+
|
|
860
|
+
@overload
|
|
861
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
862
|
+
"""
|
|
863
|
+
:param mapping: raw JSON to initialize the model.
|
|
864
|
+
:type mapping: Mapping[str, Any]
|
|
865
|
+
"""
|
|
866
|
+
|
|
867
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
868
|
+
super().__init__(*args, **kwargs)
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
class EntraIDCredentials(BaseCredentials, discriminator="AAD"):
|
|
872
|
+
"""Entra ID credential definition.
|
|
873
|
+
|
|
874
|
+
:ivar auth_type: The credential type. Required. Entra ID credential (formerly known as AAD)
|
|
875
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.ENTRA_ID
|
|
876
|
+
"""
|
|
877
|
+
|
|
878
|
+
auth_type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="authType", visibility=["read"]) # type: ignore
|
|
879
|
+
"""The credential type. Required. Entra ID credential (formerly known as AAD)"""
|
|
880
|
+
|
|
881
|
+
@overload
|
|
882
|
+
def __init__(
|
|
883
|
+
self,
|
|
884
|
+
) -> None: ...
|
|
885
|
+
|
|
886
|
+
@overload
|
|
887
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
888
|
+
"""
|
|
889
|
+
:param mapping: raw JSON to initialize the model.
|
|
890
|
+
:type mapping: Mapping[str, Any]
|
|
891
|
+
"""
|
|
892
|
+
|
|
893
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
894
|
+
super().__init__(*args, auth_type=CredentialType.ENTRA_ID, **kwargs)
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
class Evaluation(_model_base.Model):
|
|
898
|
+
"""Evaluation Definition.
|
|
899
|
+
|
|
900
|
+
:ivar id: Identifier of the evaluation. Required.
|
|
901
|
+
:vartype id: str
|
|
902
|
+
:ivar data: Data for evaluation. Required.
|
|
903
|
+
:vartype data: ~azure.ai.projects.onedp.models.InputData
|
|
904
|
+
:ivar target: Evaluation target specifying the model config and parameters.
|
|
905
|
+
:vartype target: ~azure.ai.projects.onedp.models.EvaluationTarget
|
|
906
|
+
:ivar display_name: Display Name for evaluation. It helps to find the evaluation easily in AI
|
|
907
|
+
Foundry. It does not need to be unique.
|
|
908
|
+
:vartype display_name: str
|
|
909
|
+
:ivar description: Description of the evaluation. It can be used to store additional
|
|
910
|
+
information about the evaluation and is mutable.
|
|
911
|
+
:vartype description: str
|
|
912
|
+
:ivar system_data: Metadata containing createdBy and modifiedBy information.
|
|
913
|
+
:vartype system_data: ~azure.ai.projects.onedp.models.SystemData
|
|
914
|
+
:ivar status: Status of the evaluation. It is set by service and is read-only.
|
|
915
|
+
:vartype status: str
|
|
916
|
+
:ivar tags: Evaluation's tags. Unlike properties, tags are fully mutable.
|
|
917
|
+
:vartype tags: dict[str, str]
|
|
918
|
+
:ivar properties: Evaluation's properties. Unlike tags, properties are add-only. Once added, a
|
|
919
|
+
property cannot be removed.
|
|
920
|
+
:vartype properties: dict[str, str]
|
|
921
|
+
:ivar evaluators: Evaluators to be used for the evaluation. Required.
|
|
922
|
+
:vartype evaluators: dict[str, ~azure.ai.projects.onedp.models.EvaluatorConfiguration]
|
|
923
|
+
:ivar outputs: Read-only result outputs. Evaluation Results will have logs and results under
|
|
924
|
+
the eval_results folder. Example: { 'evaluationResultId':
|
|
925
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}',
|
|
926
|
+
'evaluationMetrics': '{serialized-json-metrics}' }. Required.
|
|
927
|
+
:vartype outputs: dict[str, str]
|
|
928
|
+
"""
|
|
929
|
+
|
|
930
|
+
id: str = rest_field(visibility=["read"])
|
|
931
|
+
"""Identifier of the evaluation. Required."""
|
|
932
|
+
data: "_models.InputData" = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
933
|
+
"""Data for evaluation. Required."""
|
|
934
|
+
target: Optional["_models.EvaluationTarget"] = rest_field(visibility=["read", "create"])
|
|
935
|
+
"""Evaluation target specifying the model config and parameters."""
|
|
936
|
+
display_name: Optional[str] = rest_field(
|
|
937
|
+
name="displayName", visibility=["read", "create", "update", "delete", "query"]
|
|
938
|
+
)
|
|
939
|
+
"""Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not
|
|
940
|
+
need to be unique."""
|
|
941
|
+
description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
942
|
+
"""Description of the evaluation. It can be used to store additional information about the
|
|
943
|
+
evaluation and is mutable."""
|
|
944
|
+
system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
|
|
945
|
+
"""Metadata containing createdBy and modifiedBy information."""
|
|
946
|
+
status: Optional[str] = rest_field(visibility=["read"])
|
|
947
|
+
"""Status of the evaluation. It is set by service and is read-only."""
|
|
948
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
949
|
+
"""Evaluation's tags. Unlike properties, tags are fully mutable."""
|
|
950
|
+
properties: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
951
|
+
"""Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be
|
|
952
|
+
removed."""
|
|
953
|
+
evaluators: Dict[str, "_models.EvaluatorConfiguration"] = rest_field(
|
|
954
|
+
visibility=["read", "create", "update", "delete", "query"]
|
|
955
|
+
)
|
|
956
|
+
"""Evaluators to be used for the evaluation. Required."""
|
|
957
|
+
outputs: Dict[str, str] = rest_field(visibility=["read"])
|
|
958
|
+
"""Read-only result outputs. Evaluation Results will have logs and results under the eval_results
|
|
959
|
+
folder. Example: { 'evaluationResultId':
|
|
960
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}',
|
|
961
|
+
'evaluationMetrics': '{serialized-json-metrics}' }. Required."""
|
|
962
|
+
|
|
963
|
+
@overload
|
|
964
|
+
def __init__(
|
|
965
|
+
self,
|
|
966
|
+
*,
|
|
967
|
+
data: "_models.InputData",
|
|
968
|
+
evaluators: Dict[str, "_models.EvaluatorConfiguration"],
|
|
969
|
+
target: Optional["_models.EvaluationTarget"] = None,
|
|
970
|
+
display_name: Optional[str] = None,
|
|
971
|
+
description: Optional[str] = None,
|
|
972
|
+
tags: Optional[Dict[str, str]] = None,
|
|
973
|
+
properties: Optional[Dict[str, str]] = None,
|
|
974
|
+
) -> None: ...
|
|
975
|
+
|
|
976
|
+
@overload
|
|
977
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
978
|
+
"""
|
|
979
|
+
:param mapping: raw JSON to initialize the model.
|
|
980
|
+
:type mapping: Mapping[str, Any]
|
|
981
|
+
"""
|
|
982
|
+
|
|
983
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
984
|
+
super().__init__(*args, **kwargs)
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
class EvaluationResult(_model_base.Model):
|
|
988
|
+
"""Evaluation Result resource Definition.
|
|
989
|
+
|
|
990
|
+
:ivar result_type: Type of Evaluation result. Known values are: "Benchmark", "Evaluation",
|
|
991
|
+
"Redteam", and "Simulation".
|
|
992
|
+
:vartype result_type: str or ~azure.ai.projects.onedp.models.ResultType
|
|
993
|
+
:ivar metrics: Aggregated metrics.
|
|
994
|
+
:vartype metrics: dict[str, float]
|
|
995
|
+
:ivar blob_uri: Blob URI.
|
|
996
|
+
:vartype blob_uri: str
|
|
997
|
+
:ivar stage: Asset stage.
|
|
998
|
+
:vartype stage: str
|
|
999
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
1000
|
+
:vartype id: str
|
|
1001
|
+
:ivar name: The name of the resource. Required.
|
|
1002
|
+
:vartype name: str
|
|
1003
|
+
:ivar version: The version of the resource. Required.
|
|
1004
|
+
:vartype version: str
|
|
1005
|
+
:ivar description: The asset description text.
|
|
1006
|
+
:vartype description: str
|
|
1007
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
1008
|
+
:vartype tags: dict[str, str]
|
|
1009
|
+
"""
|
|
1010
|
+
|
|
1011
|
+
result_type: Optional[Union[str, "_models.ResultType"]] = rest_field(
|
|
1012
|
+
name="ResultType", visibility=["read", "create", "update", "delete", "query"]
|
|
1013
|
+
)
|
|
1014
|
+
"""Type of Evaluation result. Known values are: \"Benchmark\", \"Evaluation\", \"Redteam\", and
|
|
1015
|
+
\"Simulation\"."""
|
|
1016
|
+
metrics: Optional[Dict[str, float]] = rest_field(
|
|
1017
|
+
name="Metrics", visibility=["read", "create", "update", "delete", "query"]
|
|
1018
|
+
)
|
|
1019
|
+
"""Aggregated metrics."""
|
|
1020
|
+
blob_uri: Optional[str] = rest_field(name="BlobUri", visibility=["read", "create", "update", "delete", "query"])
|
|
1021
|
+
"""Blob URI."""
|
|
1022
|
+
stage: Optional[str] = rest_field(visibility=["read", "create", "update"])
|
|
1023
|
+
"""Asset stage."""
|
|
1024
|
+
id: Optional[str] = rest_field(visibility=["read"])
|
|
1025
|
+
"""A unique identifier for the asset, assetId probably?."""
|
|
1026
|
+
name: str = rest_field(visibility=["read"])
|
|
1027
|
+
"""The name of the resource. Required."""
|
|
1028
|
+
version: str = rest_field(visibility=["read"])
|
|
1029
|
+
"""The version of the resource. Required."""
|
|
1030
|
+
description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1031
|
+
"""The asset description text."""
|
|
1032
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1033
|
+
"""Tag dictionary. Tags can be added, removed, and updated."""
|
|
1034
|
+
|
|
1035
|
+
@overload
|
|
1036
|
+
def __init__(
|
|
1037
|
+
self,
|
|
1038
|
+
*,
|
|
1039
|
+
result_type: Optional[Union[str, "_models.ResultType"]] = None,
|
|
1040
|
+
metrics: Optional[Dict[str, float]] = None,
|
|
1041
|
+
blob_uri: Optional[str] = None,
|
|
1042
|
+
stage: Optional[str] = None,
|
|
1043
|
+
description: Optional[str] = None,
|
|
1044
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1045
|
+
) -> None: ...
|
|
1046
|
+
|
|
1047
|
+
@overload
|
|
1048
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1049
|
+
"""
|
|
1050
|
+
:param mapping: raw JSON to initialize the model.
|
|
1051
|
+
:type mapping: Mapping[str, Any]
|
|
1052
|
+
"""
|
|
1053
|
+
|
|
1054
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1055
|
+
super().__init__(*args, **kwargs)
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
class EvaluationTarget(_model_base.Model):
|
|
1059
|
+
"""Target for the evaluation process.
|
|
1060
|
+
|
|
1061
|
+
:ivar system_message: System message related to the evaluation target. Required.
|
|
1062
|
+
:vartype system_message: str
|
|
1063
|
+
:ivar model_config: Model configuration for the evaluation. Required.
|
|
1064
|
+
:vartype model_config: ~azure.ai.projects.onedp.models.TargetModelConfig
|
|
1065
|
+
:ivar model_params: A dictionary of parameters for the model.
|
|
1066
|
+
:vartype model_params: dict[str, any]
|
|
1067
|
+
"""
|
|
1068
|
+
|
|
1069
|
+
system_message: str = rest_field(name="systemMessage", visibility=["read", "create", "update", "delete", "query"])
|
|
1070
|
+
"""System message related to the evaluation target. Required."""
|
|
1071
|
+
model_config: "_models.TargetModelConfig" = rest_field(
|
|
1072
|
+
name="modelConfig", visibility=["read", "create", "update", "delete", "query"]
|
|
1073
|
+
)
|
|
1074
|
+
"""Model configuration for the evaluation. Required."""
|
|
1075
|
+
model_params: Optional[Dict[str, Any]] = rest_field(
|
|
1076
|
+
name="modelParams", visibility=["read", "create", "update", "delete", "query"]
|
|
1077
|
+
)
|
|
1078
|
+
"""A dictionary of parameters for the model."""
|
|
1079
|
+
|
|
1080
|
+
@overload
|
|
1081
|
+
def __init__(
|
|
1082
|
+
self,
|
|
1083
|
+
*,
|
|
1084
|
+
system_message: str,
|
|
1085
|
+
model_config: "_models.TargetModelConfig",
|
|
1086
|
+
model_params: Optional[Dict[str, Any]] = None,
|
|
1087
|
+
) -> None: ...
|
|
1088
|
+
|
|
1089
|
+
@overload
|
|
1090
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1091
|
+
"""
|
|
1092
|
+
:param mapping: raw JSON to initialize the model.
|
|
1093
|
+
:type mapping: Mapping[str, Any]
|
|
1094
|
+
"""
|
|
1095
|
+
|
|
1096
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1097
|
+
super().__init__(*args, **kwargs)
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
class EvaluationUpload(_model_base.Model):
|
|
1101
|
+
"""Upload a local SDK evaluation run. Currently update supports status, outputs, properties, and
|
|
1102
|
+
tags updates.
|
|
1103
|
+
|
|
1104
|
+
:ivar id: Identifier of the evaluation. Required.
|
|
1105
|
+
:vartype id: str
|
|
1106
|
+
:ivar data: Data for evaluation.
|
|
1107
|
+
:vartype data: ~azure.ai.projects.onedp.models.InputData
|
|
1108
|
+
:ivar target: Evaluation target specifying the model config and parameters.
|
|
1109
|
+
:vartype target: ~azure.ai.projects.onedp.models.EvaluationTarget
|
|
1110
|
+
:ivar display_name: Display Name for evaluation. It helps to find the evaluation easily in AI
|
|
1111
|
+
Foundry. It does not need to be unique.
|
|
1112
|
+
:vartype display_name: str
|
|
1113
|
+
:ivar description: Description of the evaluation. It can be used to store additional
|
|
1114
|
+
information about the evaluation and is mutable.
|
|
1115
|
+
:vartype description: str
|
|
1116
|
+
:ivar system_data: Metadata containing createdBy and modifiedBy information.
|
|
1117
|
+
:vartype system_data: ~azure.ai.projects.onedp.models.SystemData
|
|
1118
|
+
:ivar status: Status of the evaluation. For upload: Failed or Completed.
|
|
1119
|
+
:vartype status: str
|
|
1120
|
+
:ivar tags: Evaluation's tags. Unlike properties, tags are fully mutable.
|
|
1121
|
+
:vartype tags: dict[str, str]
|
|
1122
|
+
:ivar properties: Evaluation's properties. Unlike tags, properties are add-only. Once added, a
|
|
1123
|
+
property cannot be removed.
|
|
1124
|
+
:vartype properties: dict[str, str]
|
|
1125
|
+
:ivar evaluators: Evaluators to be used for the evaluation.
|
|
1126
|
+
:vartype evaluators: dict[str, ~azure.ai.projects.onedp.models.EvaluatorConfiguration]
|
|
1127
|
+
:ivar outputs: Outputs of the evaluation as a dictionary of IDs. Example: {
|
|
1128
|
+
'evaluationResultId':
|
|
1129
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}'}.
|
|
1130
|
+
:vartype outputs: dict[str, str]
|
|
1131
|
+
"""
|
|
1132
|
+
|
|
1133
|
+
id: str = rest_field(visibility=["read"])
|
|
1134
|
+
"""Identifier of the evaluation. Required."""
|
|
1135
|
+
data: Optional["_models.InputData"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1136
|
+
"""Data for evaluation."""
|
|
1137
|
+
target: Optional["_models.EvaluationTarget"] = rest_field(visibility=["read", "create"])
|
|
1138
|
+
"""Evaluation target specifying the model config and parameters."""
|
|
1139
|
+
display_name: Optional[str] = rest_field(
|
|
1140
|
+
name="displayName", visibility=["read", "create", "update", "delete", "query"]
|
|
1141
|
+
)
|
|
1142
|
+
"""Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not
|
|
1143
|
+
need to be unique."""
|
|
1144
|
+
description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1145
|
+
"""Description of the evaluation. It can be used to store additional information about the
|
|
1146
|
+
evaluation and is mutable."""
|
|
1147
|
+
system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
|
|
1148
|
+
"""Metadata containing createdBy and modifiedBy information."""
|
|
1149
|
+
status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1150
|
+
"""Status of the evaluation. For upload: Failed or Completed."""
|
|
1151
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1152
|
+
"""Evaluation's tags. Unlike properties, tags are fully mutable."""
|
|
1153
|
+
properties: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1154
|
+
"""Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be
|
|
1155
|
+
removed."""
|
|
1156
|
+
evaluators: Optional[Dict[str, "_models.EvaluatorConfiguration"]] = rest_field(
|
|
1157
|
+
visibility=["read", "create", "update", "delete", "query"]
|
|
1158
|
+
)
|
|
1159
|
+
"""Evaluators to be used for the evaluation."""
|
|
1160
|
+
outputs: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1161
|
+
"""Outputs of the evaluation as a dictionary of IDs. Example: { 'evaluationResultId':
|
|
1162
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}'}."""
|
|
1163
|
+
|
|
1164
|
+
@overload
|
|
1165
|
+
def __init__(
|
|
1166
|
+
self,
|
|
1167
|
+
*,
|
|
1168
|
+
data: Optional["_models.InputData"] = None,
|
|
1169
|
+
target: Optional["_models.EvaluationTarget"] = None,
|
|
1170
|
+
display_name: Optional[str] = None,
|
|
1171
|
+
description: Optional[str] = None,
|
|
1172
|
+
status: Optional[str] = None,
|
|
1173
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1174
|
+
properties: Optional[Dict[str, str]] = None,
|
|
1175
|
+
evaluators: Optional[Dict[str, "_models.EvaluatorConfiguration"]] = None,
|
|
1176
|
+
outputs: Optional[Dict[str, str]] = None,
|
|
1177
|
+
) -> None: ...
|
|
1178
|
+
|
|
1179
|
+
@overload
|
|
1180
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1181
|
+
"""
|
|
1182
|
+
:param mapping: raw JSON to initialize the model.
|
|
1183
|
+
:type mapping: Mapping[str, Any]
|
|
1184
|
+
"""
|
|
1185
|
+
|
|
1186
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1187
|
+
super().__init__(*args, **kwargs)
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
class EvaluatorConfiguration(_model_base.Model):
|
|
1191
|
+
"""Evaluator Configuration.
|
|
1192
|
+
|
|
1193
|
+
:ivar id: Identifier of the evaluator. Required.
|
|
1194
|
+
:vartype id: str
|
|
1195
|
+
:ivar init_params: Initialization parameters of the evaluator.
|
|
1196
|
+
:vartype init_params: dict[str, any]
|
|
1197
|
+
:ivar data_mapping: Data parameters of the evaluator.
|
|
1198
|
+
:vartype data_mapping: dict[str, str]
|
|
1199
|
+
"""
|
|
1200
|
+
|
|
1201
|
+
id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1202
|
+
"""Identifier of the evaluator. Required."""
|
|
1203
|
+
init_params: Optional[Dict[str, Any]] = rest_field(
|
|
1204
|
+
name="initParams", visibility=["read", "create", "update", "delete", "query"]
|
|
1205
|
+
)
|
|
1206
|
+
"""Initialization parameters of the evaluator."""
|
|
1207
|
+
data_mapping: Optional[Dict[str, str]] = rest_field(
|
|
1208
|
+
name="dataMapping", visibility=["read", "create", "update", "delete", "query"]
|
|
1209
|
+
)
|
|
1210
|
+
"""Data parameters of the evaluator."""
|
|
1211
|
+
|
|
1212
|
+
@overload
|
|
1213
|
+
def __init__(
|
|
1214
|
+
self,
|
|
1215
|
+
*,
|
|
1216
|
+
id: str, # pylint: disable=redefined-builtin
|
|
1217
|
+
init_params: Optional[Dict[str, Any]] = None,
|
|
1218
|
+
data_mapping: Optional[Dict[str, str]] = None,
|
|
1219
|
+
) -> None: ...
|
|
1220
|
+
|
|
1221
|
+
@overload
|
|
1222
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1223
|
+
"""
|
|
1224
|
+
:param mapping: raw JSON to initialize the model.
|
|
1225
|
+
:type mapping: Mapping[str, Any]
|
|
1226
|
+
"""
|
|
1227
|
+
|
|
1228
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1229
|
+
super().__init__(*args, **kwargs)
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
class FileDatasetVersion(DatasetVersion, discriminator="uri_file"):
|
|
1233
|
+
"""FileDatasetVersion Definition.
|
|
1234
|
+
|
|
1235
|
+
:ivar dataset_uri: [Required] Uri of the data. Example:
|
|
1236
|
+
`https://go.microsoft.com/fwlink/?linkid=2202330
|
|
1237
|
+
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
|
|
1238
|
+
:vartype dataset_uri: str
|
|
1239
|
+
:ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If
|
|
1240
|
+
true, the underlying data will be deleted when the dataset version is deleted.
|
|
1241
|
+
:vartype is_reference: bool
|
|
1242
|
+
:ivar stage: Asset stage.
|
|
1243
|
+
:vartype stage: str
|
|
1244
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
1245
|
+
:vartype id: str
|
|
1246
|
+
:ivar name: The name of the resource. Required.
|
|
1247
|
+
:vartype name: str
|
|
1248
|
+
:ivar version: The version of the resource. Required.
|
|
1249
|
+
:vartype version: str
|
|
1250
|
+
:ivar description: The asset description text.
|
|
1251
|
+
:vartype description: str
|
|
1252
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
1253
|
+
:vartype tags: dict[str, str]
|
|
1254
|
+
:ivar type: Dataset type. Required. URI file.
|
|
1255
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.URI_FILE
|
|
1256
|
+
:ivar open_ai_purpose: Indicates OpenAI Purpose. FileDatasets created with this field will be
|
|
1257
|
+
compatible with OpenAI-specific features. Required.
|
|
1258
|
+
:vartype open_ai_purpose: str
|
|
1259
|
+
"""
|
|
1260
|
+
|
|
1261
|
+
type: Literal[DatasetType.URI_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
1262
|
+
"""Dataset type. Required. URI file."""
|
|
1263
|
+
open_ai_purpose: str = rest_field(name="openAIPurpose", visibility=["read", "create", "update", "delete", "query"])
|
|
1264
|
+
"""Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with
|
|
1265
|
+
OpenAI-specific features. Required."""
|
|
1266
|
+
|
|
1267
|
+
@overload
|
|
1268
|
+
def __init__(
|
|
1269
|
+
self,
|
|
1270
|
+
*,
|
|
1271
|
+
dataset_uri: str,
|
|
1272
|
+
open_ai_purpose: str,
|
|
1273
|
+
stage: Optional[str] = None,
|
|
1274
|
+
description: Optional[str] = None,
|
|
1275
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1276
|
+
) -> None: ...
|
|
1277
|
+
|
|
1278
|
+
@overload
|
|
1279
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1280
|
+
"""
|
|
1281
|
+
:param mapping: raw JSON to initialize the model.
|
|
1282
|
+
:type mapping: Mapping[str, Any]
|
|
1283
|
+
"""
|
|
1284
|
+
|
|
1285
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1286
|
+
super().__init__(*args, type=DatasetType.URI_FILE, **kwargs)
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"):
|
|
1290
|
+
"""FileDatasetVersion Definition.
|
|
1291
|
+
|
|
1292
|
+
:ivar dataset_uri: [Required] Uri of the data. Example:
|
|
1293
|
+
`https://go.microsoft.com/fwlink/?linkid=2202330
|
|
1294
|
+
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
|
|
1295
|
+
:vartype dataset_uri: str
|
|
1296
|
+
:ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If
|
|
1297
|
+
true, the underlying data will be deleted when the dataset version is deleted.
|
|
1298
|
+
:vartype is_reference: bool
|
|
1299
|
+
:ivar stage: Asset stage.
|
|
1300
|
+
:vartype stage: str
|
|
1301
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
1302
|
+
:vartype id: str
|
|
1303
|
+
:ivar name: The name of the resource. Required.
|
|
1304
|
+
:vartype name: str
|
|
1305
|
+
:ivar version: The version of the resource. Required.
|
|
1306
|
+
:vartype version: str
|
|
1307
|
+
:ivar description: The asset description text.
|
|
1308
|
+
:vartype description: str
|
|
1309
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
1310
|
+
:vartype tags: dict[str, str]
|
|
1311
|
+
:ivar type: Dataset type. Required. URI folder.
|
|
1312
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.URI_FOLDER
|
|
1313
|
+
"""
|
|
1314
|
+
|
|
1315
|
+
type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
1316
|
+
"""Dataset type. Required. URI folder."""
|
|
1317
|
+
|
|
1318
|
+
@overload
|
|
1319
|
+
def __init__(
|
|
1320
|
+
self,
|
|
1321
|
+
*,
|
|
1322
|
+
dataset_uri: str,
|
|
1323
|
+
stage: Optional[str] = None,
|
|
1324
|
+
description: Optional[str] = None,
|
|
1325
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1326
|
+
) -> None: ...
|
|
1327
|
+
|
|
1328
|
+
@overload
|
|
1329
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1330
|
+
"""
|
|
1331
|
+
:param mapping: raw JSON to initialize the model.
|
|
1332
|
+
:type mapping: Mapping[str, Any]
|
|
1333
|
+
"""
|
|
1334
|
+
|
|
1335
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1336
|
+
super().__init__(*args, type=DatasetType.URI_FOLDER, **kwargs)
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
class InputData(_model_base.Model):
|
|
1340
|
+
"""Abstract data class.
|
|
1341
|
+
|
|
1342
|
+
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
|
|
1343
|
+
InputDataset
|
|
1344
|
+
|
|
1345
|
+
:ivar type: Type of the data. Required. Default value is None.
|
|
1346
|
+
:vartype type: str
|
|
1347
|
+
"""
|
|
1348
|
+
|
|
1349
|
+
__mapping__: Dict[str, _model_base.Model] = {}
|
|
1350
|
+
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
|
|
1351
|
+
"""Type of the data. Required. Default value is None."""
|
|
1352
|
+
|
|
1353
|
+
@overload
|
|
1354
|
+
def __init__(
|
|
1355
|
+
self,
|
|
1356
|
+
*,
|
|
1357
|
+
type: str,
|
|
1358
|
+
) -> None: ...
|
|
1359
|
+
|
|
1360
|
+
@overload
|
|
1361
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1362
|
+
"""
|
|
1363
|
+
:param mapping: raw JSON to initialize the model.
|
|
1364
|
+
:type mapping: Mapping[str, Any]
|
|
1365
|
+
"""
|
|
1366
|
+
|
|
1367
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1368
|
+
super().__init__(*args, **kwargs)
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
class InputDataset(InputData, discriminator="dataset"):
|
|
1372
|
+
"""Dataset as source for evaluation.
|
|
1373
|
+
|
|
1374
|
+
:ivar type: Required. Default value is "dataset".
|
|
1375
|
+
:vartype type: str
|
|
1376
|
+
:ivar id: Evaluation input data. Required.
|
|
1377
|
+
:vartype id: str
|
|
1378
|
+
"""
|
|
1379
|
+
|
|
1380
|
+
type: Literal["dataset"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
1381
|
+
"""Required. Default value is \"dataset\"."""
|
|
1382
|
+
id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1383
|
+
"""Evaluation input data. Required."""
|
|
1384
|
+
|
|
1385
|
+
@overload
|
|
1386
|
+
def __init__(
|
|
1387
|
+
self,
|
|
1388
|
+
*,
|
|
1389
|
+
id: str, # pylint: disable=redefined-builtin
|
|
1390
|
+
) -> None: ...
|
|
1391
|
+
|
|
1392
|
+
@overload
|
|
1393
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1394
|
+
"""
|
|
1395
|
+
:param mapping: raw JSON to initialize the model.
|
|
1396
|
+
:type mapping: Mapping[str, Any]
|
|
1397
|
+
"""
|
|
1398
|
+
|
|
1399
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1400
|
+
super().__init__(*args, type="dataset", **kwargs)
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
class LongRunningResponse(_model_base.Model):
|
|
1404
|
+
"""Long Running Response.
|
|
1405
|
+
|
|
1406
|
+
:ivar location: The location. Required.
|
|
1407
|
+
:vartype location: str
|
|
1408
|
+
:ivar operation_result: The OperationResult. Required.
|
|
1409
|
+
:vartype operation_result: any
|
|
1410
|
+
"""
|
|
1411
|
+
|
|
1412
|
+
location: str = rest_field(name="Location", visibility=["read", "create", "update", "delete", "query"])
|
|
1413
|
+
"""The location. Required."""
|
|
1414
|
+
operation_result: Any = rest_field(
|
|
1415
|
+
name="OperationResult", visibility=["read", "create", "update", "delete", "query"]
|
|
1416
|
+
)
|
|
1417
|
+
"""The OperationResult. Required."""
|
|
1418
|
+
|
|
1419
|
+
@overload
|
|
1420
|
+
def __init__(
|
|
1421
|
+
self,
|
|
1422
|
+
*,
|
|
1423
|
+
location: str,
|
|
1424
|
+
operation_result: Any,
|
|
1425
|
+
) -> None: ...
|
|
1426
|
+
|
|
1427
|
+
@overload
|
|
1428
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1429
|
+
"""
|
|
1430
|
+
:param mapping: raw JSON to initialize the model.
|
|
1431
|
+
:type mapping: Mapping[str, Any]
|
|
1432
|
+
"""
|
|
1433
|
+
|
|
1434
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1435
|
+
super().__init__(*args, **kwargs)
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
class MAASModelConfig(TargetModelConfig, discriminator="MAAS"):
|
|
1439
|
+
"""MaaS model configuration. The API version would be selected by the service for querying the
|
|
1440
|
+
model.
|
|
1441
|
+
|
|
1442
|
+
:ivar type: Required. Default value is "MAAS".
|
|
1443
|
+
:vartype type: str
|
|
1444
|
+
:ivar azure_endpoint: Endpoint targetURI for MAAS model. Required.
|
|
1445
|
+
:vartype azure_endpoint: str
|
|
1446
|
+
:ivar api_key: API Key for MAAS model. Required.
|
|
1447
|
+
:vartype api_key: str
|
|
1448
|
+
"""
|
|
1449
|
+
|
|
1450
|
+
type: Literal["MAAS"] = rest_discriminator(name="type", visibility=["read"]) # type: ignore
|
|
1451
|
+
"""Required. Default value is \"MAAS\"."""
|
|
1452
|
+
azure_endpoint: str = rest_field(name="azureEndpoint", visibility=["read", "create", "update", "delete", "query"])
|
|
1453
|
+
"""Endpoint targetURI for MAAS model. Required."""
|
|
1454
|
+
api_key: str = rest_field(name="apiKey", visibility=["read", "create", "update", "delete", "query"])
|
|
1455
|
+
"""API Key for MAAS model. Required."""
|
|
1456
|
+
|
|
1457
|
+
@overload
|
|
1458
|
+
def __init__(
|
|
1459
|
+
self,
|
|
1460
|
+
*,
|
|
1461
|
+
azure_endpoint: str,
|
|
1462
|
+
api_key: str,
|
|
1463
|
+
) -> None: ...
|
|
1464
|
+
|
|
1465
|
+
@overload
|
|
1466
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1467
|
+
"""
|
|
1468
|
+
:param mapping: raw JSON to initialize the model.
|
|
1469
|
+
:type mapping: Mapping[str, Any]
|
|
1470
|
+
"""
|
|
1471
|
+
|
|
1472
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1473
|
+
super().__init__(*args, type="MAAS", **kwargs)
|
|
1474
|
+
|
|
1475
|
+
|
|
1476
|
+
class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"):
|
|
1477
|
+
"""Managed Azure AI Search Index Definition.
|
|
1478
|
+
|
|
1479
|
+
:ivar stage: Asset stage.
|
|
1480
|
+
:vartype stage: str
|
|
1481
|
+
:ivar id: A unique identifier for the asset, assetId probably?.
|
|
1482
|
+
:vartype id: str
|
|
1483
|
+
:ivar name: The name of the resource. Required.
|
|
1484
|
+
:vartype name: str
|
|
1485
|
+
:ivar version: The version of the resource. Required.
|
|
1486
|
+
:vartype version: str
|
|
1487
|
+
:ivar description: The asset description text.
|
|
1488
|
+
:vartype description: str
|
|
1489
|
+
:ivar tags: Tag dictionary. Tags can be added, removed, and updated.
|
|
1490
|
+
:vartype tags: dict[str, str]
|
|
1491
|
+
:ivar type: Type of index. Required. Managed Azure Search
|
|
1492
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.MANAGED_AZURE_SEARCH
|
|
1493
|
+
:ivar vector_store_id: Vector store id of managed index. Required.
|
|
1494
|
+
:vartype vector_store_id: str
|
|
1495
|
+
"""
|
|
1496
|
+
|
|
1497
|
+
type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
1498
|
+
"""Type of index. Required. Managed Azure Search"""
|
|
1499
|
+
vector_store_id: str = rest_field(name="vectorStoreId", visibility=["read", "create", "update", "delete", "query"])
|
|
1500
|
+
"""Vector store id of managed index. Required."""
|
|
1501
|
+
|
|
1502
|
+
@overload
|
|
1503
|
+
def __init__(
|
|
1504
|
+
self,
|
|
1505
|
+
*,
|
|
1506
|
+
vector_store_id: str,
|
|
1507
|
+
stage: Optional[str] = None,
|
|
1508
|
+
description: Optional[str] = None,
|
|
1509
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1510
|
+
) -> None: ...
|
|
1511
|
+
|
|
1512
|
+
@overload
|
|
1513
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1514
|
+
"""
|
|
1515
|
+
:param mapping: raw JSON to initialize the model.
|
|
1516
|
+
:type mapping: Mapping[str, Any]
|
|
1517
|
+
"""
|
|
1518
|
+
|
|
1519
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1520
|
+
super().__init__(*args, type=IndexType.MANAGED_AZURE_SEARCH, **kwargs)
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
class Message(_model_base.Model):
|
|
1524
|
+
"""Message.
|
|
1525
|
+
|
|
1526
|
+
:ivar role: The role.
|
|
1527
|
+
:vartype role: str
|
|
1528
|
+
:ivar content: The content.
|
|
1529
|
+
:vartype content: str
|
|
1530
|
+
"""
|
|
1531
|
+
|
|
1532
|
+
role: Optional[str] = rest_field(name="Role", visibility=["read", "create", "update", "delete", "query"])
|
|
1533
|
+
"""The role."""
|
|
1534
|
+
content: Optional[str] = rest_field(name="Content", visibility=["read", "create", "update", "delete", "query"])
|
|
1535
|
+
"""The content."""
|
|
1536
|
+
|
|
1537
|
+
@overload
|
|
1538
|
+
def __init__(
|
|
1539
|
+
self,
|
|
1540
|
+
*,
|
|
1541
|
+
role: Optional[str] = None,
|
|
1542
|
+
content: Optional[str] = None,
|
|
1543
|
+
) -> None: ...
|
|
1544
|
+
|
|
1545
|
+
@overload
|
|
1546
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1547
|
+
"""
|
|
1548
|
+
:param mapping: raw JSON to initialize the model.
|
|
1549
|
+
:type mapping: Mapping[str, Any]
|
|
1550
|
+
"""
|
|
1551
|
+
|
|
1552
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1553
|
+
super().__init__(*args, **kwargs)
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
class Metadata(_model_base.Model):
|
|
1557
|
+
"""Metadata.
|
|
1558
|
+
|
|
1559
|
+
:ivar target_harms: List of target harms. Required.
|
|
1560
|
+
:vartype target_harms: list[~azure.ai.projects.onedp.models.TargetHarm]
|
|
1561
|
+
:ivar language: The language. Required.
|
|
1562
|
+
:vartype language: str
|
|
1563
|
+
"""
|
|
1564
|
+
|
|
1565
|
+
target_harms: List["_models.TargetHarm"] = rest_field(
|
|
1566
|
+
name="TargetHarms", visibility=["read", "create", "update", "delete", "query"]
|
|
1567
|
+
)
|
|
1568
|
+
"""List of target harms. Required."""
|
|
1569
|
+
language: str = rest_field(name="Language", visibility=["read", "create", "update", "delete", "query"])
|
|
1570
|
+
"""The language. Required."""
|
|
1571
|
+
|
|
1572
|
+
@overload
|
|
1573
|
+
def __init__(
|
|
1574
|
+
self,
|
|
1575
|
+
*,
|
|
1576
|
+
target_harms: List["_models.TargetHarm"],
|
|
1577
|
+
language: str,
|
|
1578
|
+
) -> None: ...
|
|
1579
|
+
|
|
1580
|
+
@overload
|
|
1581
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1582
|
+
"""
|
|
1583
|
+
:param mapping: raw JSON to initialize the model.
|
|
1584
|
+
:type mapping: Mapping[str, Any]
|
|
1585
|
+
"""
|
|
1586
|
+
|
|
1587
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1588
|
+
super().__init__(*args, **kwargs)
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
class ModelDeployment(Deployment, discriminator="ModelDeployment"):
|
|
1592
|
+
"""Model Deployment Definition.
|
|
1593
|
+
|
|
1594
|
+
:ivar name: Name of the deployment. Required.
|
|
1595
|
+
:vartype name: str
|
|
1596
|
+
:ivar type: The type of the deployment. Required. Model deployment
|
|
1597
|
+
:vartype type: str or ~azure.ai.projects.onedp.models.MODEL_DEPLOYMENT
|
|
1598
|
+
:ivar model_name: Publisher-specific name of the deployed model. Required.
|
|
1599
|
+
:vartype model_name: str
|
|
1600
|
+
:ivar model_version: Publisher-specific version of the deployed model. Required.
|
|
1601
|
+
:vartype model_version: str
|
|
1602
|
+
:ivar model_publisher: Name of the deployed model's publisher. Required.
|
|
1603
|
+
:vartype model_publisher: str
|
|
1604
|
+
:ivar capabilities: Capabilities of deployed model. Required.
|
|
1605
|
+
:vartype capabilities: dict[str, str]
|
|
1606
|
+
:ivar sku: Sku of the model deployment. Required.
|
|
1607
|
+
:vartype sku: ~azure.ai.projects.onedp.models.Sku
|
|
1608
|
+
:ivar connection_name: Name of the connection the deployment comes from.
|
|
1609
|
+
:vartype connection_name: str
|
|
1610
|
+
"""
|
|
1611
|
+
|
|
1612
|
+
type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
|
|
1613
|
+
"""The type of the deployment. Required. Model deployment"""
|
|
1614
|
+
model_name: str = rest_field(name="modelName", visibility=["read"])
|
|
1615
|
+
"""Publisher-specific name of the deployed model. Required."""
|
|
1616
|
+
model_version: str = rest_field(name="modelVersion", visibility=["read"])
|
|
1617
|
+
"""Publisher-specific version of the deployed model. Required."""
|
|
1618
|
+
model_publisher: str = rest_field(name="modelPublisher", visibility=["read"])
|
|
1619
|
+
"""Name of the deployed model's publisher. Required."""
|
|
1620
|
+
capabilities: Dict[str, str] = rest_field(visibility=["read"])
|
|
1621
|
+
"""Capabilities of deployed model. Required."""
|
|
1622
|
+
sku: "_models.Sku" = rest_field(visibility=["read"])
|
|
1623
|
+
"""Sku of the model deployment. Required."""
|
|
1624
|
+
connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"])
|
|
1625
|
+
"""Name of the connection the deployment comes from."""
|
|
1626
|
+
|
|
1627
|
+
@overload
|
|
1628
|
+
def __init__(
|
|
1629
|
+
self,
|
|
1630
|
+
) -> None: ...
|
|
1631
|
+
|
|
1632
|
+
@overload
|
|
1633
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1634
|
+
"""
|
|
1635
|
+
:param mapping: raw JSON to initialize the model.
|
|
1636
|
+
:type mapping: Mapping[str, Any]
|
|
1637
|
+
"""
|
|
1638
|
+
|
|
1639
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1640
|
+
super().__init__(*args, type=DeploymentType.MODEL_DEPLOYMENT, **kwargs)
|
|
1641
|
+
|
|
1642
|
+
|
|
1643
|
+
class NoAuthenticationCredentials(BaseCredentials, discriminator="None"):
|
|
1644
|
+
"""Credentials that do not require authentication.
|
|
1645
|
+
|
|
1646
|
+
:ivar auth_type: The credential type. Required. No credential
|
|
1647
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.NONE
|
|
1648
|
+
"""
|
|
1649
|
+
|
|
1650
|
+
auth_type: Literal[CredentialType.NONE] = rest_discriminator(name="authType", visibility=["read"]) # type: ignore
|
|
1651
|
+
"""The credential type. Required. No credential"""
|
|
1652
|
+
|
|
1653
|
+
@overload
|
|
1654
|
+
def __init__(
|
|
1655
|
+
self,
|
|
1656
|
+
) -> None: ...
|
|
1657
|
+
|
|
1658
|
+
@overload
|
|
1659
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1660
|
+
"""
|
|
1661
|
+
:param mapping: raw JSON to initialize the model.
|
|
1662
|
+
:type mapping: Mapping[str, Any]
|
|
1663
|
+
"""
|
|
1664
|
+
|
|
1665
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1666
|
+
super().__init__(*args, auth_type=CredentialType.NONE, **kwargs)
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
class PendingUploadRequest(_model_base.Model):
|
|
1670
|
+
"""Represents a request for a pending upload.
|
|
1671
|
+
|
|
1672
|
+
:ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used.
|
|
1673
|
+
:vartype pending_upload_id: str
|
|
1674
|
+
:ivar connection_name: Name of Azure blob storage connection to use for generating temporary
|
|
1675
|
+
SAS token.
|
|
1676
|
+
:vartype connection_name: str
|
|
1677
|
+
:ivar pending_upload_type: TemporaryBlobReference is the only supported type. Required.
|
|
1678
|
+
Temporary Blob Reference is the only supported type.
|
|
1679
|
+
:vartype pending_upload_type: str or ~azure.ai.projects.onedp.models.TEMPORARY_BLOB_REFERENCE
|
|
1680
|
+
"""
|
|
1681
|
+
|
|
1682
|
+
pending_upload_id: Optional[str] = rest_field(
|
|
1683
|
+
name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"]
|
|
1684
|
+
)
|
|
1685
|
+
"""If PendingUploadId is not provided, a random GUID will be used."""
|
|
1686
|
+
connection_name: Optional[str] = rest_field(
|
|
1687
|
+
name="connectionName", visibility=["read", "create", "update", "delete", "query"]
|
|
1688
|
+
)
|
|
1689
|
+
"""Name of Azure blob storage connection to use for generating temporary SAS token."""
|
|
1690
|
+
pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field(
|
|
1691
|
+
name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"]
|
|
1692
|
+
)
|
|
1693
|
+
"""TemporaryBlobReference is the only supported type. Required. Temporary Blob Reference is the
|
|
1694
|
+
only supported type."""
|
|
1695
|
+
|
|
1696
|
+
@overload
|
|
1697
|
+
def __init__(
|
|
1698
|
+
self,
|
|
1699
|
+
*,
|
|
1700
|
+
pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE],
|
|
1701
|
+
pending_upload_id: Optional[str] = None,
|
|
1702
|
+
connection_name: Optional[str] = None,
|
|
1703
|
+
) -> None: ...
|
|
1704
|
+
|
|
1705
|
+
@overload
|
|
1706
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1707
|
+
"""
|
|
1708
|
+
:param mapping: raw JSON to initialize the model.
|
|
1709
|
+
:type mapping: Mapping[str, Any]
|
|
1710
|
+
"""
|
|
1711
|
+
|
|
1712
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1713
|
+
super().__init__(*args, **kwargs)
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
class PendingUploadResponse(_model_base.Model):
|
|
1717
|
+
"""Represents the response for a pending upload request.
|
|
1718
|
+
|
|
1719
|
+
:ivar blob_reference_for_consumption: Container-level read, write, list SAS. Required.
|
|
1720
|
+
:vartype blob_reference_for_consumption:
|
|
1721
|
+
~azure.ai.projects.onedp.models.BlobReferenceForConsumption
|
|
1722
|
+
:ivar pending_upload_id: ID for this upload request. Required.
|
|
1723
|
+
:vartype pending_upload_id: str
|
|
1724
|
+
:ivar dataset_version: Version of dataset to be created if user did not specify version when
|
|
1725
|
+
initially creating upload.
|
|
1726
|
+
:vartype dataset_version: str
|
|
1727
|
+
:ivar pending_upload_type: TemporaryBlobReference is the only supported type. Required.
|
|
1728
|
+
Temporary Blob Reference is the only supported type.
|
|
1729
|
+
:vartype pending_upload_type: str or ~azure.ai.projects.onedp.models.TEMPORARY_BLOB_REFERENCE
|
|
1730
|
+
"""
|
|
1731
|
+
|
|
1732
|
+
blob_reference_for_consumption: "_models.BlobReferenceForConsumption" = rest_field(
|
|
1733
|
+
name="blobReferenceForConsumption", visibility=["read", "create", "update", "delete", "query"]
|
|
1734
|
+
)
|
|
1735
|
+
"""Container-level read, write, list SAS. Required."""
|
|
1736
|
+
pending_upload_id: str = rest_field(
|
|
1737
|
+
name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"]
|
|
1738
|
+
)
|
|
1739
|
+
"""ID for this upload request. Required."""
|
|
1740
|
+
dataset_version: Optional[str] = rest_field(
|
|
1741
|
+
name="datasetVersion", visibility=["read", "create", "update", "delete", "query"]
|
|
1742
|
+
)
|
|
1743
|
+
"""Version of dataset to be created if user did not specify version when initially creating
|
|
1744
|
+
upload."""
|
|
1745
|
+
pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] = rest_field(
|
|
1746
|
+
name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"]
|
|
1747
|
+
)
|
|
1748
|
+
"""TemporaryBlobReference is the only supported type. Required. Temporary Blob Reference is the
|
|
1749
|
+
only supported type."""
|
|
1750
|
+
|
|
1751
|
+
@overload
|
|
1752
|
+
def __init__(
|
|
1753
|
+
self,
|
|
1754
|
+
*,
|
|
1755
|
+
blob_reference_for_consumption: "_models.BlobReferenceForConsumption",
|
|
1756
|
+
pending_upload_id: str,
|
|
1757
|
+
pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE],
|
|
1758
|
+
dataset_version: Optional[str] = None,
|
|
1759
|
+
) -> None: ...
|
|
1760
|
+
|
|
1761
|
+
@overload
|
|
1762
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1763
|
+
"""
|
|
1764
|
+
:param mapping: raw JSON to initialize the model.
|
|
1765
|
+
:type mapping: Mapping[str, Any]
|
|
1766
|
+
"""
|
|
1767
|
+
|
|
1768
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1769
|
+
super().__init__(*args, **kwargs)
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
class RedTeam(_model_base.Model):
|
|
1773
|
+
"""Red team details.
|
|
1774
|
+
|
|
1775
|
+
:ivar id: Identifier of the red team. Required.
|
|
1776
|
+
:vartype id: str
|
|
1777
|
+
:ivar scan_name: Name of the red-team scan. Required.
|
|
1778
|
+
:vartype scan_name: str
|
|
1779
|
+
:ivar num_turns: Number of simulation rounds. Required.
|
|
1780
|
+
:vartype num_turns: int
|
|
1781
|
+
:ivar attack_strategy: List of attack strategies or nested lists of attack strategies.
|
|
1782
|
+
Required.
|
|
1783
|
+
:vartype attack_strategy: list[str or ~azure.ai.projects.onedp.models.AttackStrategy]
|
|
1784
|
+
:ivar simulation_only: Simulation-only or Simulation + Evaluation. Default false, if true the
|
|
1785
|
+
scan outputs conversation not evaluation result. Required.
|
|
1786
|
+
:vartype simulation_only: bool
|
|
1787
|
+
:ivar risk_categories: List of risk categories to generate attack objectives for. Required.
|
|
1788
|
+
:vartype risk_categories: list[str or ~azure.ai.projects.onedp.models.RiskCategory]
|
|
1789
|
+
:ivar application_scenario: Application scenario for the red team operation, to generate
|
|
1790
|
+
scenario specific attacks.
|
|
1791
|
+
:vartype application_scenario: str
|
|
1792
|
+
:ivar tags: Red team's tags. Unlike properties, tags are fully mutable.
|
|
1793
|
+
:vartype tags: dict[str, str]
|
|
1794
|
+
:ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a
|
|
1795
|
+
property cannot be removed.
|
|
1796
|
+
:vartype properties: dict[str, str]
|
|
1797
|
+
:ivar status: Status of the red-team. It is set by service and is read-only.
|
|
1798
|
+
:vartype status: str
|
|
1799
|
+
:ivar outputs: Read-only result outputs. Example: { 'evaluationResultId':
|
|
1800
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}',
|
|
1801
|
+
'logId':
|
|
1802
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/versions/{dataset-version}'
|
|
1803
|
+
}. Required.
|
|
1804
|
+
:vartype outputs: dict[str, str]
|
|
1805
|
+
:ivar system_data: Metadata containing createdBy and modifiedBy information.
|
|
1806
|
+
:vartype system_data: ~azure.ai.projects.onedp.models.SystemData
|
|
1807
|
+
"""
|
|
1808
|
+
|
|
1809
|
+
id: str = rest_field(visibility=["read"])
|
|
1810
|
+
"""Identifier of the red team. Required."""
|
|
1811
|
+
scan_name: str = rest_field(name="scanName", visibility=["read", "create", "update", "delete", "query"])
|
|
1812
|
+
"""Name of the red-team scan. Required."""
|
|
1813
|
+
num_turns: int = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"])
|
|
1814
|
+
"""Number of simulation rounds. Required."""
|
|
1815
|
+
attack_strategy: List[Union[str, "_models.AttackStrategy"]] = rest_field(
|
|
1816
|
+
name="attackStrategy", visibility=["read", "create", "update", "delete", "query"]
|
|
1817
|
+
)
|
|
1818
|
+
"""List of attack strategies or nested lists of attack strategies. Required."""
|
|
1819
|
+
simulation_only: bool = rest_field(
|
|
1820
|
+
name="simulationOnly", visibility=["read", "create", "update", "delete", "query"]
|
|
1821
|
+
)
|
|
1822
|
+
"""Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs
|
|
1823
|
+
conversation not evaluation result. Required."""
|
|
1824
|
+
risk_categories: List[Union[str, "_models.RiskCategory"]] = rest_field(
|
|
1825
|
+
name="riskCategories", visibility=["read", "create", "update", "delete", "query"]
|
|
1826
|
+
)
|
|
1827
|
+
"""List of risk categories to generate attack objectives for. Required."""
|
|
1828
|
+
application_scenario: Optional[str] = rest_field(
|
|
1829
|
+
name="applicationScenario", visibility=["read", "create", "update", "delete", "query"]
|
|
1830
|
+
)
|
|
1831
|
+
"""Application scenario for the red team operation, to generate scenario specific attacks."""
|
|
1832
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1833
|
+
"""Red team's tags. Unlike properties, tags are fully mutable."""
|
|
1834
|
+
properties: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1835
|
+
"""Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be
|
|
1836
|
+
removed."""
|
|
1837
|
+
status: Optional[str] = rest_field(visibility=["read"])
|
|
1838
|
+
"""Status of the red-team. It is set by service and is read-only."""
|
|
1839
|
+
outputs: Dict[str, str] = rest_field(visibility=["read"])
|
|
1840
|
+
"""Read-only result outputs. Example: { 'evaluationResultId':
|
|
1841
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}',
|
|
1842
|
+
'logId':
|
|
1843
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/versions/{dataset-version}'
|
|
1844
|
+
}. Required."""
|
|
1845
|
+
system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
|
|
1846
|
+
"""Metadata containing createdBy and modifiedBy information."""
|
|
1847
|
+
|
|
1848
|
+
@overload
|
|
1849
|
+
def __init__(
|
|
1850
|
+
self,
|
|
1851
|
+
*,
|
|
1852
|
+
scan_name: str,
|
|
1853
|
+
num_turns: int,
|
|
1854
|
+
attack_strategy: List[Union[str, "_models.AttackStrategy"]],
|
|
1855
|
+
simulation_only: bool,
|
|
1856
|
+
risk_categories: List[Union[str, "_models.RiskCategory"]],
|
|
1857
|
+
application_scenario: Optional[str] = None,
|
|
1858
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1859
|
+
properties: Optional[Dict[str, str]] = None,
|
|
1860
|
+
) -> None: ...
|
|
1861
|
+
|
|
1862
|
+
@overload
|
|
1863
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1864
|
+
"""
|
|
1865
|
+
:param mapping: raw JSON to initialize the model.
|
|
1866
|
+
:type mapping: Mapping[str, Any]
|
|
1867
|
+
"""
|
|
1868
|
+
|
|
1869
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1870
|
+
super().__init__(*args, **kwargs)
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
class RedTeamUpload(_model_base.Model):
|
|
1874
|
+
"""Red team details.
|
|
1875
|
+
|
|
1876
|
+
:ivar id: Identifier of the red team. Required.
|
|
1877
|
+
:vartype id: str
|
|
1878
|
+
:ivar scan_name: Name of the red-team scan.
|
|
1879
|
+
:vartype scan_name: str
|
|
1880
|
+
:ivar num_turns: Number of simulation rounds.
|
|
1881
|
+
:vartype num_turns: int
|
|
1882
|
+
:ivar attack_strategy: List of attack strategies or nested lists of attack strategies.
|
|
1883
|
+
:vartype attack_strategy: list[str or ~azure.ai.projects.onedp.models.AttackStrategy]
|
|
1884
|
+
:ivar simulation_only: Simulation-only or Simulation + Evaluation. Default false, if true the
|
|
1885
|
+
scan outputs conversation not evaluation result.
|
|
1886
|
+
:vartype simulation_only: bool
|
|
1887
|
+
:ivar risk_categories: List of risk categories to generate attack objectives for.
|
|
1888
|
+
:vartype risk_categories: list[str or ~azure.ai.projects.onedp.models.RiskCategory]
|
|
1889
|
+
:ivar application_scenario: Application scenario for the red team operation, to generate
|
|
1890
|
+
scenario specific attacks.
|
|
1891
|
+
:vartype application_scenario: str
|
|
1892
|
+
:ivar tags: Red team's tags. Unlike properties, tags are fully mutable.
|
|
1893
|
+
:vartype tags: dict[str, str]
|
|
1894
|
+
:ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a
|
|
1895
|
+
property cannot be removed.
|
|
1896
|
+
:vartype properties: dict[str, str]
|
|
1897
|
+
:ivar status: Status of the red-team. It is set by service and is read-only.
|
|
1898
|
+
:vartype status: str
|
|
1899
|
+
:ivar outputs: Read-only result outputs. Example: { 'evaluationResultId':
|
|
1900
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}'
|
|
1901
|
+
}.
|
|
1902
|
+
:vartype outputs: dict[str, str]
|
|
1903
|
+
:ivar system_data: Metadata containing createdBy and modifiedBy information.
|
|
1904
|
+
:vartype system_data: ~azure.ai.projects.onedp.models.SystemData
|
|
1905
|
+
"""
|
|
1906
|
+
|
|
1907
|
+
id: str = rest_field(visibility=["read"])
|
|
1908
|
+
"""Identifier of the red team. Required."""
|
|
1909
|
+
scan_name: Optional[str] = rest_field(name="scanName", visibility=["read", "create", "update", "delete", "query"])
|
|
1910
|
+
"""Name of the red-team scan."""
|
|
1911
|
+
num_turns: Optional[int] = rest_field(name="numTurns", visibility=["read", "create", "update", "delete", "query"])
|
|
1912
|
+
"""Number of simulation rounds."""
|
|
1913
|
+
attack_strategy: Optional[List[Union[str, "_models.AttackStrategy"]]] = rest_field(
|
|
1914
|
+
name="attackStrategy", visibility=["read", "create", "update", "delete", "query"]
|
|
1915
|
+
)
|
|
1916
|
+
"""List of attack strategies or nested lists of attack strategies."""
|
|
1917
|
+
simulation_only: Optional[bool] = rest_field(
|
|
1918
|
+
name="simulationOnly", visibility=["read", "create", "update", "delete", "query"]
|
|
1919
|
+
)
|
|
1920
|
+
"""Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs
|
|
1921
|
+
conversation not evaluation result."""
|
|
1922
|
+
risk_categories: Optional[List[Union[str, "_models.RiskCategory"]]] = rest_field(
|
|
1923
|
+
name="riskCategories", visibility=["read", "create", "update", "delete", "query"]
|
|
1924
|
+
)
|
|
1925
|
+
"""List of risk categories to generate attack objectives for."""
|
|
1926
|
+
application_scenario: Optional[str] = rest_field(
|
|
1927
|
+
name="applicationScenario", visibility=["read", "create", "update", "delete", "query"]
|
|
1928
|
+
)
|
|
1929
|
+
"""Application scenario for the red team operation, to generate scenario specific attacks."""
|
|
1930
|
+
tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1931
|
+
"""Red team's tags. Unlike properties, tags are fully mutable."""
|
|
1932
|
+
properties: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
1933
|
+
"""Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be
|
|
1934
|
+
removed."""
|
|
1935
|
+
status: Optional[str] = rest_field(visibility=["read"])
|
|
1936
|
+
"""Status of the red-team. It is set by service and is read-only."""
|
|
1937
|
+
outputs: Optional[Dict[str, str]] = rest_field(visibility=["read"])
|
|
1938
|
+
"""Read-only result outputs. Example: { 'evaluationResultId':
|
|
1939
|
+
'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}'
|
|
1940
|
+
}."""
|
|
1941
|
+
system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
|
|
1942
|
+
"""Metadata containing createdBy and modifiedBy information."""
|
|
1943
|
+
|
|
1944
|
+
@overload
|
|
1945
|
+
def __init__(
|
|
1946
|
+
self,
|
|
1947
|
+
*,
|
|
1948
|
+
scan_name: Optional[str] = None,
|
|
1949
|
+
num_turns: Optional[int] = None,
|
|
1950
|
+
attack_strategy: Optional[List[Union[str, "_models.AttackStrategy"]]] = None,
|
|
1951
|
+
simulation_only: Optional[bool] = None,
|
|
1952
|
+
risk_categories: Optional[List[Union[str, "_models.RiskCategory"]]] = None,
|
|
1953
|
+
application_scenario: Optional[str] = None,
|
|
1954
|
+
tags: Optional[Dict[str, str]] = None,
|
|
1955
|
+
properties: Optional[Dict[str, str]] = None,
|
|
1956
|
+
) -> None: ...
|
|
1957
|
+
|
|
1958
|
+
@overload
|
|
1959
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
1960
|
+
"""
|
|
1961
|
+
:param mapping: raw JSON to initialize the model.
|
|
1962
|
+
:type mapping: Mapping[str, Any]
|
|
1963
|
+
"""
|
|
1964
|
+
|
|
1965
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1966
|
+
super().__init__(*args, **kwargs)
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
class SasCredential(_model_base.Model):
|
|
1970
|
+
"""SAS Credential definition.
|
|
1971
|
+
|
|
1972
|
+
:ivar sas_uri: SAS uri. Required.
|
|
1973
|
+
:vartype sas_uri: str
|
|
1974
|
+
:ivar type: Type of credential. Required. Default value is "SAS".
|
|
1975
|
+
:vartype type: str
|
|
1976
|
+
"""
|
|
1977
|
+
|
|
1978
|
+
sas_uri: str = rest_field(name="sasUri", visibility=["read"])
|
|
1979
|
+
"""SAS uri. Required."""
|
|
1980
|
+
type: Literal["SAS"] = rest_field(visibility=["read"])
|
|
1981
|
+
"""Type of credential. Required. Default value is \"SAS\"."""
|
|
1982
|
+
|
|
1983
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
1984
|
+
super().__init__(*args, **kwargs)
|
|
1985
|
+
self.type: Literal["SAS"] = "SAS"
|
|
1986
|
+
|
|
1987
|
+
|
|
1988
|
+
class SASCredentials(BaseCredentials, discriminator="SAS"):
|
|
1989
|
+
"""Shared Access Signature (SAS) credential definition.
|
|
1990
|
+
|
|
1991
|
+
:ivar auth_type: The credential type. Required. Shared Access Signature (SAS) credential
|
|
1992
|
+
:vartype auth_type: str or ~azure.ai.projects.onedp.models.SAS
|
|
1993
|
+
:ivar sas_token: SAS token.
|
|
1994
|
+
:vartype sas_token: str
|
|
1995
|
+
"""
|
|
1996
|
+
|
|
1997
|
+
auth_type: Literal[CredentialType.SAS] = rest_discriminator(name="authType", visibility=["read"]) # type: ignore
|
|
1998
|
+
"""The credential type. Required. Shared Access Signature (SAS) credential"""
|
|
1999
|
+
sas_token: Optional[str] = rest_field(name="sasToken", visibility=["read"])
|
|
2000
|
+
"""SAS token."""
|
|
2001
|
+
|
|
2002
|
+
@overload
|
|
2003
|
+
def __init__(
|
|
2004
|
+
self,
|
|
2005
|
+
) -> None: ...
|
|
2006
|
+
|
|
2007
|
+
@overload
|
|
2008
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
2009
|
+
"""
|
|
2010
|
+
:param mapping: raw JSON to initialize the model.
|
|
2011
|
+
:type mapping: Mapping[str, Any]
|
|
2012
|
+
"""
|
|
2013
|
+
|
|
2014
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
2015
|
+
super().__init__(*args, auth_type=CredentialType.SAS, **kwargs)
|
|
2016
|
+
|
|
2017
|
+
|
|
2018
|
+
class SimulationDTO(_model_base.Model):
|
|
2019
|
+
"""Customization Parameters.
|
|
2020
|
+
|
|
2021
|
+
:ivar headers: Additional headers.
|
|
2022
|
+
:vartype headers: dict[str, str]
|
|
2023
|
+
:ivar params: Parameters.
|
|
2024
|
+
:vartype params: dict[str, str]
|
|
2025
|
+
:ivar template_parameters: Template parameters.
|
|
2026
|
+
:vartype template_parameters: dict[str, str]
|
|
2027
|
+
:ivar customization_parameters: Customization parameters.
|
|
2028
|
+
:vartype customization_parameters: ~azure.ai.projects.onedp.models.CustomizationParameters
|
|
2029
|
+
:ivar json: Json.
|
|
2030
|
+
:vartype json: str
|
|
2031
|
+
:ivar url: Url.
|
|
2032
|
+
:vartype url: str
|
|
2033
|
+
:ivar template_key: Template key.
|
|
2034
|
+
:vartype template_key: str
|
|
2035
|
+
:ivar simulation_type: Type of Simulation. Known values are: "Default", "CustomPersona", and
|
|
2036
|
+
"HarmTurnGenerator".
|
|
2037
|
+
:vartype simulation_type: str or ~azure.ai.projects.onedp.models.SimulationType
|
|
2038
|
+
:ivar is_microsoft_tenant: 'True' if Microsoft internal tenant and 'False' otherwise.
|
|
2039
|
+
:vartype is_microsoft_tenant: bool
|
|
2040
|
+
:ivar subscription_id: Azure subscription id.
|
|
2041
|
+
:vartype subscription_id: str
|
|
2042
|
+
:ivar resource_group_name: Resource group name.
|
|
2043
|
+
:vartype resource_group_name: str
|
|
2044
|
+
:ivar workspace_name: Workspace name.
|
|
2045
|
+
:vartype workspace_name: str
|
|
2046
|
+
"""
|
|
2047
|
+
|
|
2048
|
+
headers: Optional[Dict[str, str]] = rest_field(
|
|
2049
|
+
name="Headers", visibility=["read", "create", "update", "delete", "query"]
|
|
2050
|
+
)
|
|
2051
|
+
"""Additional headers."""
|
|
2052
|
+
params: Optional[Dict[str, str]] = rest_field(
|
|
2053
|
+
name="Params", visibility=["read", "create", "update", "delete", "query"]
|
|
2054
|
+
)
|
|
2055
|
+
"""Parameters."""
|
|
2056
|
+
template_parameters: Optional[Dict[str, str]] = rest_field(
|
|
2057
|
+
name="TemplateParameters", visibility=["read", "create", "update", "delete", "query"]
|
|
2058
|
+
)
|
|
2059
|
+
"""Template parameters."""
|
|
2060
|
+
customization_parameters: Optional["_models.CustomizationParameters"] = rest_field(
|
|
2061
|
+
name="CustomizationParameters", visibility=["read", "create", "update", "delete", "query"]
|
|
2062
|
+
)
|
|
2063
|
+
"""Customization parameters."""
|
|
2064
|
+
json: Optional[str] = rest_field(name="Json", visibility=["read", "create", "update", "delete", "query"])
|
|
2065
|
+
"""Json."""
|
|
2066
|
+
url: Optional[str] = rest_field(name="Url", visibility=["read", "create", "update", "delete", "query"])
|
|
2067
|
+
"""Url."""
|
|
2068
|
+
template_key: Optional[str] = rest_field(
|
|
2069
|
+
name="TemplateKey", visibility=["read", "create", "update", "delete", "query"]
|
|
2070
|
+
)
|
|
2071
|
+
"""Template key."""
|
|
2072
|
+
simulation_type: Optional[Union[str, "_models.SimulationType"]] = rest_field(
|
|
2073
|
+
name="SimulationType", visibility=["read", "create", "update", "delete", "query"]
|
|
2074
|
+
)
|
|
2075
|
+
"""Type of Simulation. Known values are: \"Default\", \"CustomPersona\", and
|
|
2076
|
+
\"HarmTurnGenerator\"."""
|
|
2077
|
+
is_microsoft_tenant: Optional[bool] = rest_field(
|
|
2078
|
+
name="IsMicrosoftTenant", visibility=["read", "create", "update", "delete", "query"]
|
|
2079
|
+
)
|
|
2080
|
+
"""'True' if Microsoft internal tenant and 'False' otherwise."""
|
|
2081
|
+
subscription_id: Optional[str] = rest_field(
|
|
2082
|
+
name="SubscriptionId", visibility=["read", "create", "update", "delete", "query"]
|
|
2083
|
+
)
|
|
2084
|
+
"""Azure subscription id."""
|
|
2085
|
+
resource_group_name: Optional[str] = rest_field(
|
|
2086
|
+
name="ResourceGroupName", visibility=["read", "create", "update", "delete", "query"]
|
|
2087
|
+
)
|
|
2088
|
+
"""Resource group name."""
|
|
2089
|
+
workspace_name: Optional[str] = rest_field(
|
|
2090
|
+
name="WorkspaceName", visibility=["read", "create", "update", "delete", "query"]
|
|
2091
|
+
)
|
|
2092
|
+
"""Workspace name."""
|
|
2093
|
+
|
|
2094
|
+
@overload
|
|
2095
|
+
def __init__(
|
|
2096
|
+
self,
|
|
2097
|
+
*,
|
|
2098
|
+
headers: Optional[Dict[str, str]] = None,
|
|
2099
|
+
params: Optional[Dict[str, str]] = None,
|
|
2100
|
+
template_parameters: Optional[Dict[str, str]] = None,
|
|
2101
|
+
customization_parameters: Optional["_models.CustomizationParameters"] = None,
|
|
2102
|
+
json: Optional[str] = None,
|
|
2103
|
+
url: Optional[str] = None,
|
|
2104
|
+
template_key: Optional[str] = None,
|
|
2105
|
+
simulation_type: Optional[Union[str, "_models.SimulationType"]] = None,
|
|
2106
|
+
is_microsoft_tenant: Optional[bool] = None,
|
|
2107
|
+
subscription_id: Optional[str] = None,
|
|
2108
|
+
resource_group_name: Optional[str] = None,
|
|
2109
|
+
workspace_name: Optional[str] = None,
|
|
2110
|
+
) -> None: ...
|
|
2111
|
+
|
|
2112
|
+
@overload
|
|
2113
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
2114
|
+
"""
|
|
2115
|
+
:param mapping: raw JSON to initialize the model.
|
|
2116
|
+
:type mapping: Mapping[str, Any]
|
|
2117
|
+
"""
|
|
2118
|
+
|
|
2119
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
2120
|
+
super().__init__(*args, **kwargs)
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
class Sku(_model_base.Model):
|
|
2124
|
+
"""Sku information.
|
|
2125
|
+
|
|
2126
|
+
:ivar capacity: Sku capacity. Required.
|
|
2127
|
+
:vartype capacity: int
|
|
2128
|
+
:ivar family: Sku family. Required.
|
|
2129
|
+
:vartype family: str
|
|
2130
|
+
:ivar name: Sku name. Required.
|
|
2131
|
+
:vartype name: str
|
|
2132
|
+
:ivar size: Sku size. Required.
|
|
2133
|
+
:vartype size: str
|
|
2134
|
+
:ivar tier: Sku tier. Required.
|
|
2135
|
+
:vartype tier: str
|
|
2136
|
+
"""
|
|
2137
|
+
|
|
2138
|
+
capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
2139
|
+
"""Sku capacity. Required."""
|
|
2140
|
+
family: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
2141
|
+
"""Sku family. Required."""
|
|
2142
|
+
name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
2143
|
+
"""Sku name. Required."""
|
|
2144
|
+
size: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
2145
|
+
"""Sku size. Required."""
|
|
2146
|
+
tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
|
|
2147
|
+
"""Sku tier. Required."""
|
|
2148
|
+
|
|
2149
|
+
@overload
|
|
2150
|
+
def __init__(
|
|
2151
|
+
self,
|
|
2152
|
+
*,
|
|
2153
|
+
capacity: int,
|
|
2154
|
+
family: str,
|
|
2155
|
+
name: str,
|
|
2156
|
+
size: str,
|
|
2157
|
+
tier: str,
|
|
2158
|
+
) -> None: ...
|
|
2159
|
+
|
|
2160
|
+
@overload
|
|
2161
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
2162
|
+
"""
|
|
2163
|
+
:param mapping: raw JSON to initialize the model.
|
|
2164
|
+
:type mapping: Mapping[str, Any]
|
|
2165
|
+
"""
|
|
2166
|
+
|
|
2167
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
2168
|
+
super().__init__(*args, **kwargs)
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
class SystemData(_model_base.Model):
|
|
2172
|
+
"""Metadata pertaining to creation and last modification of the resource.
|
|
2173
|
+
|
|
2174
|
+
:ivar created_at: The timestamp the resource was created at.
|
|
2175
|
+
:vartype created_at: ~datetime.datetime
|
|
2176
|
+
:ivar created_by: The identity that created the resource.
|
|
2177
|
+
:vartype created_by: str
|
|
2178
|
+
:ivar created_by_type: The identity type that created the resource.
|
|
2179
|
+
:vartype created_by_type: str
|
|
2180
|
+
:ivar last_modified_at: The timestamp of resource last modification (UTC).
|
|
2181
|
+
:vartype last_modified_at: ~datetime.datetime
|
|
2182
|
+
"""
|
|
2183
|
+
|
|
2184
|
+
created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339")
|
|
2185
|
+
"""The timestamp the resource was created at."""
|
|
2186
|
+
created_by: Optional[str] = rest_field(name="createdBy", visibility=["read"])
|
|
2187
|
+
"""The identity that created the resource."""
|
|
2188
|
+
created_by_type: Optional[str] = rest_field(name="createdByType", visibility=["read"])
|
|
2189
|
+
"""The identity type that created the resource."""
|
|
2190
|
+
last_modified_at: Optional[datetime.datetime] = rest_field(
|
|
2191
|
+
name="lastModifiedAt", visibility=["read"], format="rfc3339"
|
|
2192
|
+
)
|
|
2193
|
+
"""The timestamp of resource last modification (UTC)."""
|
|
2194
|
+
|
|
2195
|
+
|
|
2196
|
+
class TargetHarm(_model_base.Model):
|
|
2197
|
+
"""Target Harm.
|
|
2198
|
+
|
|
2199
|
+
:ivar risk_type: The risk type.
|
|
2200
|
+
:vartype risk_type: str
|
|
2201
|
+
:ivar risk_sub_type: The risk sub type.
|
|
2202
|
+
:vartype risk_sub_type: str
|
|
2203
|
+
"""
|
|
2204
|
+
|
|
2205
|
+
risk_type: Optional[str] = rest_field(name="RiskType", visibility=["read", "create", "update", "delete", "query"])
|
|
2206
|
+
"""The risk type."""
|
|
2207
|
+
risk_sub_type: Optional[str] = rest_field(
|
|
2208
|
+
name="RiskSubType", visibility=["read", "create", "update", "delete", "query"]
|
|
2209
|
+
)
|
|
2210
|
+
"""The risk sub type."""
|
|
2211
|
+
|
|
2212
|
+
@overload
|
|
2213
|
+
def __init__(
|
|
2214
|
+
self,
|
|
2215
|
+
*,
|
|
2216
|
+
risk_type: Optional[str] = None,
|
|
2217
|
+
risk_sub_type: Optional[str] = None,
|
|
2218
|
+
) -> None: ...
|
|
2219
|
+
|
|
2220
|
+
@overload
|
|
2221
|
+
def __init__(self, mapping: Mapping[str, Any]) -> None:
|
|
2222
|
+
"""
|
|
2223
|
+
:param mapping: raw JSON to initialize the model.
|
|
2224
|
+
:type mapping: Mapping[str, Any]
|
|
2225
|
+
"""
|
|
2226
|
+
|
|
2227
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
2228
|
+
super().__init__(*args, **kwargs)
|