From bdd5282301b4c748e406fe0766238e7306951830 Mon Sep 17 00:00:00 2001 From: Sydney Lister Date: Thu, 23 Jul 2026 11:26:05 -0400 Subject: [PATCH] Regenerate azure-ai-projects for rubric health lineage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f633b179-c4a4-423e-9896-e6a8f7980e0c --- .../azure-ai-projects/apiview-properties.json | 9 +- .../azure/ai/projects/_client.py | 2 + .../azure/ai/projects/_unions.py | 14 + .../azure/ai/projects/_utils/model_base.py | 19 +- .../azure/ai/projects/_utils/utils.py | 1 + .../azure/ai/projects/aio/_client.py | 2 + .../ai/projects/aio/operations/_operations.py | 1252 ++- .../ai/projects/aio/operations/_patch.py | 354 +- .../aio/operations/_patch_agents_async.py | 193 +- .../_patch_evaluation_rules_async.py | 77 +- .../azure/ai/projects/models/__init__.py | 12 + .../azure/ai/projects/models/_enums.py | 56 + .../azure/ai/projects/models/_models.py | 256 +- .../ai/projects/operations/_operations.py | 1247 ++- .../azure/ai/projects/operations/_patch.py | 373 +- .../ai/projects/operations/_patch_agents.py | 197 +- .../operations/_patch_evaluation_rules.py | 75 +- .../azure/ai/projects/types.py | 7297 +++++++++++++++++ .../samples/agents/sample_agent_basic.py | 1 + .../sample_agent_user_identity_isolation.py | 1 + .../tests/samples/llm_instructions.py | 32 +- 21 files changed, 10413 insertions(+), 1057 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py create mode 100644 sdk/ai/azure-ai-projects/azure/ai/projects/types.py diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index fa141e2c53cf..a0ad7d958a89 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -129,6 +129,7 @@ "azure.ai.projects.models.DeleteSkillVersionResult": "Azure.AI.Projects.DeleteSkillVersionResponse", "azure.ai.projects.models.Deployment": "Azure.AI.Projects.Deployment", "azure.ai.projects.models.Dimension": "Azure.AI.Projects.Dimension", + "azure.ai.projects.models.DimensionMetadata": "Azure.AI.Projects.DimensionMetadata", "azure.ai.projects.models.DispatchRoutineResult": "Azure.AI.Projects.DispatchRoutineResponse", "azure.ai.projects.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration", "azure.ai.projects.models.EmptyModelParam": "OpenAI.EmptyModelParam", @@ -279,7 +280,6 @@ "azure.ai.projects.models.Reasoning": "OpenAI.Reasoning", "azure.ai.projects.models.RecurrenceTrigger": "Azure.AI.Projects.RecurrenceTrigger", "azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam", - "azure.ai.projects.models.ReminderPreviewTool": "Azure.AI.Projects.ReminderPreviewTool", "azure.ai.projects.models.ReminderPreviewToolboxTool": "Azure.AI.Projects.ReminderPreviewToolboxTool", "azure.ai.projects.models.ResponsesProtocolConfiguration": "Azure.AI.Projects.ResponsesProtocolConfiguration", "azure.ai.projects.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", @@ -287,6 +287,7 @@ "azure.ai.projects.models.Routine": "Azure.AI.Projects.Routine", "azure.ai.projects.models.RoutineRun": "Azure.AI.Projects.RoutineRun", "azure.ai.projects.models.RubricBasedEvaluatorDefinition": "Azure.AI.Projects.RubricBasedEvaluatorDefinition", + "azure.ai.projects.models.RubricHealth": "Azure.AI.Projects.RubricHealth", "azure.ai.projects.models.SASCredentials": "Azure.AI.Projects.SASCredentials", "azure.ai.projects.models.Schedule": "Azure.AI.Projects.Schedule", "azure.ai.projects.models.ScheduleRoutineTrigger": "Azure.AI.Projects.ScheduleRoutineTrigger", @@ -306,6 +307,7 @@ "azure.ai.projects.models.SpecificFunctionShellParam": "OpenAI.SpecificFunctionShellParam", "azure.ai.projects.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", + "azure.ai.projects.models.SupersededDimension": "Azure.AI.Projects.SupersededDimension", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", "azure.ai.projects.models.TelemetryConfig": "Azure.AI.Projects.TelemetryConfig", @@ -380,6 +382,8 @@ "azure.ai.projects.models.EvaluatorDefinitionType": "Azure.AI.Projects.EvaluatorDefinitionType", "azure.ai.projects.models.EvaluatorMetricType": "Azure.AI.Projects.EvaluatorMetricType", "azure.ai.projects.models.EvaluatorMetricDirection": "Azure.AI.Projects.EvaluatorMetricDirection", + "azure.ai.projects.models.DimensionChangeKind": "Azure.AI.Projects.DimensionChangeKind", + "azure.ai.projects.models.RubricHealthConfidence": "Azure.AI.Projects.RubricHealthConfidence", "azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", "azure.ai.projects.models.EvaluatorGenerationJobSourceType": "Azure.AI.Projects.EvaluatorGenerationJobSourceType", "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", @@ -424,6 +428,7 @@ "azure.ai.projects.models.TelemetryDataKind": "Azure.AI.Projects.TelemetryDataKind", "azure.ai.projects.models.TelemetryEndpointAuthType": "Azure.AI.Projects.TelemetryEndpointAuthType", "azure.ai.projects.models.TelemetryTransportProtocol": "Azure.AI.Projects.TelemetryTransportProtocol", + "azure.ai.projects.models.ReasoningEffort": "OpenAI.ReasoningEffort", "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", "azure.ai.projects.models.AgentVersionStatus": "Azure.AI.Projects.AgentVersionStatus", @@ -541,5 +546,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "32a086fb0432" + "CrossLanguageVersion": "f7f86af3b631" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py index 508fbc18d9cd..60c172ebfdd2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -70,6 +70,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py new file mode 100644 index 000000000000..abad0c3afee4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_unions.py @@ -0,0 +1,14 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union + +if TYPE_CHECKING: + from . import models as _models +Filters = Union["_models.ComparisonFilter", "_models.CompoundFilter"] +RoutineRunStatus = str diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py index a79d3782e99c..1934415c1369 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/model_base.py @@ -458,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -482,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -517,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -542,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index c91d6470e2bf..9ebe3cda3180 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py @@ -11,6 +11,7 @@ from .._utils.model_base import Model, SdkJSONEncoder + # file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` FileContent = Union[str, bytes, IO[str], IO[bytes]] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py index c195fb690de2..967ac1cf48d2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/_client.py @@ -70,6 +70,8 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index ba856252bdd8..dcaa9f12fa6e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -32,7 +32,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import prepare_multipart_form_data @@ -522,7 +522,12 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -536,7 +541,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -574,7 +579,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -594,8 +599,9 @@ async def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -742,7 +748,12 @@ async def create_version_from_manifest( @overload async def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -756,7 +767,7 @@ async def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -794,7 +805,7 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -813,8 +824,9 @@ async def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -1193,7 +1205,12 @@ async def update_details( @overload async def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -1202,7 +1219,7 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1235,7 +1252,7 @@ async def update_details( async def update_details( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -1247,8 +1264,8 @@ async def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -1336,14 +1353,19 @@ async def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload async def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace_async async def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], *, code_zip_sha256: str, **kwargs: Any @@ -1362,8 +1384,9 @@ async def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: Is either a _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :param content: Is one of the following types: _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -1660,7 +1683,12 @@ async def create_session( @overload async def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -1671,7 +1699,7 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1706,7 +1734,7 @@ async def create_session( async def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -1720,8 +1748,8 @@ async def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -2095,23 +2123,29 @@ async def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting + FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application + startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since + last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -2153,7 +2187,7 @@ async def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -2673,7 +2707,7 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2682,7 +2716,7 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2713,7 +2747,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -2721,9 +2755,10 @@ async def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -3513,7 +3548,7 @@ async def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -3527,7 +3562,7 @@ async def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -3566,7 +3601,11 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -3576,9 +3615,10 @@ async def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -3678,7 +3718,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -3692,7 +3732,7 @@ async def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3734,7 +3774,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -3745,10 +3785,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -4428,7 +4468,13 @@ async def create_or_update( @overload async def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4439,7 +4485,7 @@ async def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4478,7 +4524,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -4488,9 +4534,9 @@ async def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -4618,7 +4664,12 @@ async def create_version( @overload async def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -4628,7 +4679,7 @@ async def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4662,7 +4713,7 @@ async def create_version( async def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -4678,8 +4729,9 @@ async def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -5121,7 +5173,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5130,7 +5182,7 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5161,7 +5213,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -5169,8 +5226,8 @@ async def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword default_version: The version identifier that the toolbox should point to. When set, the toolbox's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -5611,7 +5668,7 @@ async def create( @overload async def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5620,7 +5677,7 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5651,7 +5708,10 @@ async def create( @distributed_trace_async async def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5659,9 +5719,10 @@ async def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5749,7 +5810,7 @@ async def update( @overload async def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5758,7 +5819,7 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5789,7 +5850,10 @@ async def update( @distributed_trace_async async def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5797,9 +5861,10 @@ async def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -6243,7 +6308,12 @@ async def create_version( @overload async def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6252,7 +6322,7 @@ async def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6283,7 +6353,10 @@ async def create_version( @distributed_trace_async async def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -6291,9 +6364,9 @@ async def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6389,7 +6462,13 @@ async def update_version( @overload async def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6400,7 +6479,7 @@ async def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6442,7 +6521,7 @@ async def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -6453,9 +6532,10 @@ async def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6556,7 +6636,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6571,7 +6651,7 @@ async def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6614,7 +6694,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -6626,10 +6706,10 @@ async def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -6734,7 +6814,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -6749,7 +6829,7 @@ async def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6792,7 +6872,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -6804,10 +6884,10 @@ async def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -6878,15 +6958,87 @@ async def get_credentials( return deserialized # type: ignore + async def _create_generation_job_initial( + self, + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_evaluators_create_generation_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def create_generation_job( + async def begin_create_generation_job( self, job: _models.EvaluatorGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions @@ -6900,42 +7052,49 @@ async def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of AsyncLROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + async def begin_create_generation_job( + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of AsyncLROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_generation_job( + async def begin_create_generation_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions @@ -6949,102 +7108,94 @@ async def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of AsyncLROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_generation_job( + async def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> AsyncLROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of AsyncLROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluatorGenerationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.EvaluatorVersion, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_evaluators_create_generation_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.EvaluatorGenerationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EvaluatorVersion].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EvaluatorVersion]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: @@ -7372,7 +7523,7 @@ async def generate( @overload async def generate( - self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: """Generate insights. @@ -7380,7 +7531,7 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7409,14 +7560,17 @@ async def generate( """ @distributed_trace_async - async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + async def generate( + self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -7730,14 +7884,14 @@ async def create( @overload async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7767,7 +7921,7 @@ async def create( @distributed_trace_async async def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -7779,8 +7933,8 @@ async def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7896,7 +8050,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -7905,7 +8059,7 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7938,7 +8092,7 @@ async def update( async def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -7950,8 +8104,8 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -8269,7 +8423,7 @@ async def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload async def _search_memories( @@ -8280,7 +8434,7 @@ async def _search_memories( async def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8294,8 +8448,8 @@ async def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8383,7 +8537,7 @@ async def _search_memories( async def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8479,7 +8633,7 @@ async def _begin_update_memories( ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload async def _begin_update_memories( @@ -8490,7 +8644,7 @@ async def _begin_update_memories( async def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -8505,8 +8659,8 @@ async def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8612,7 +8766,7 @@ async def delete_scope( @overload async def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8621,7 +8775,7 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8654,7 +8808,12 @@ async def delete_scope( @distributed_trace_async async def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -8662,8 +8821,8 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8777,7 +8936,7 @@ async def create_memory( @overload async def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -8786,7 +8945,7 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8819,7 +8978,7 @@ async def create_memory( async def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -8832,8 +8991,8 @@ async def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8944,7 +9103,13 @@ async def update_memory( @overload async def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -8955,7 +9120,7 @@ async def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8988,7 +9153,13 @@ async def update_memory( @distributed_trace_async async def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -8998,8 +9169,8 @@ async def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -9198,7 +9369,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -9214,7 +9385,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -9290,7 +9461,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -9305,8 +9476,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -9833,7 +10004,7 @@ async def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -9848,7 +10019,7 @@ async def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9891,7 +10062,7 @@ async def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -9903,10 +10074,10 @@ async def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -10004,7 +10175,13 @@ async def pending_create_version( @overload async def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10016,7 +10193,7 @@ async def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10056,7 +10233,11 @@ async def pending_create_version( @distributed_trace_async async def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -10067,9 +10248,10 @@ async def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -10173,7 +10355,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10187,7 +10369,7 @@ async def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10231,7 +10413,7 @@ async def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -10242,10 +10424,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: Is one of the following types: ModelPendingUploadRequest, JSON, - IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: Is either a ModelPendingUploadRequest type or a IO[bytes] type. + Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -10346,7 +10528,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10360,7 +10542,7 @@ async def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10402,7 +10584,7 @@ async def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -10413,9 +10595,10 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: Is one of the following types: ModelCredentialRequest, JSON, - IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: Is either a ModelCredentialRequest type or a IO[bytes] type. + Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -10672,13 +10855,15 @@ async def create( """ @overload - async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10706,14 +10891,16 @@ async def create( """ @distributed_trace_async - async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + async def create( + self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -10837,7 +11024,12 @@ async def create_or_update( @overload async def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -10846,7 +11038,7 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10879,7 +11071,7 @@ async def create_or_update( async def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -10893,8 +11085,9 @@ async def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -11435,7 +11628,12 @@ async def dispatch( @overload async def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -11444,7 +11642,7 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11477,7 +11675,7 @@ async def dispatch( async def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -11488,8 +11686,9 @@ async def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -11821,7 +12020,7 @@ async def create_or_update( @overload async def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -11830,7 +12029,7 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11861,7 +12060,7 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -11869,9 +12068,10 @@ async def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -12314,7 +12514,7 @@ async def update( @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12323,7 +12523,7 @@ async def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12354,7 +12554,12 @@ async def update( @distributed_trace_async async def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -12362,8 +12567,8 @@ async def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -12539,7 +12744,12 @@ async def create( @overload async def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -12548,7 +12758,7 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12581,7 +12791,7 @@ async def create( async def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -12593,8 +12803,9 @@ async def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -12690,7 +12901,9 @@ async def create_from_files( """ @overload - async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + async def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -12698,7 +12911,7 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m :param name: The name of the skill. Required. :type name: str :param content: Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -12706,7 +12919,10 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m @distributed_trace_async async def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -12714,8 +12930,9 @@ async def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: Is either a CreateSkillVersionFromFilesBody type or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: Is one of the following types: CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -13335,15 +13552,87 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) + async def _create_generation_job_initial( + self, + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_datasets_create_generation_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def create_generation_job( + async def begin_create_generation_job( self, job: _models.DataGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. @@ -13356,41 +13645,48 @@ async def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of AsyncLROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + async def begin_create_generation_job( + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of AsyncLROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_generation_job( + async def begin_create_generation_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. @@ -13403,101 +13699,93 @@ async def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of AsyncLROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_generation_job( + async def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> AsyncLROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of AsyncLROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataGenerationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.DataGenerationJobResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.DataGenerationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_datasets_create_generation_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.DataGenerationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DataGenerationJobResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DataGenerationJobResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: @@ -13638,15 +13926,87 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + async def _create_optimization_job_initial( + self, + job: Union[_models.OptimizationJob, _types.OptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agents_create_optimization_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def create_optimization_job( + async def begin_create_optimization_job( self, job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + ) -> AsyncLROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for @@ -13660,42 +14020,49 @@ async def create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The + OptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + async def begin_create_optimization_job( + self, + job: _types.OptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.OptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The + OptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_optimization_job( + async def begin_create_optimization_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + ) -> AsyncLROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for @@ -13709,98 +14076,93 @@ async def create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The + OptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.OptimizationJob: + async def begin_create_optimization_job( + self, + job: Union[_models.OptimizationJob, _types.OptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] - Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is either a OptimizationJob type or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.OptimizationJob or + ~azure.ai.projects.types.OptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of AsyncLROPoller that returns OptimizationJobResult. The + OptimizationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_optimization_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_agents_create_optimization_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OptimizationJobResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OptimizationJobResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py index 5d8893177cae..266dd3560ff4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch.py @@ -8,7 +8,12 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, List +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, IO, List, Optional, Union, cast, overload + +from azure.core.tracing.decorator_async import distributed_trace_async +from ... import models as _models from ._patch_agents_async import AgentsOperations from ._patch_datasets_async import DatasetsOperations from ._patch_evaluation_rules_async import EvaluationRulesOperations @@ -16,12 +21,15 @@ from ._patch_connections_async import ConnectionsOperations from ._patch_memories_async import BetaMemoryStoresOperations from ._patch_models_async import BetaModelsOperations -from ...operations._patch import _BETA_OPERATION_FEATURE_HEADERS, _OperationMethodHeaderProxy +from ...operations._patch import ( + _BETA_OPERATION_FEATURE_HEADERS, + _OperationMethodHeaderProxy, +) from ._operations import ( - BetaAgentsOperations, - BetaDatasetsOperations, + BetaAgentsOperations as BetaAgentsOperationsGenerated, + BetaDatasetsOperations as BetaDatasetsOperationsGenerated, BetaEvaluationTaxonomiesOperations, - BetaEvaluatorsOperations, + BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, BetaRedTeamsOperations, @@ -31,6 +39,310 @@ ) +class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`beta.evaluators` attribute. + """ + + @overload + async def create_generation_job( + self, + job: _models.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @overload + async def create_generation_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @distributed_trace_async + async def create_generation_job( + self, + job: Union[_models.EvaluatorGenerationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: + """Create an evaluator generation job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_generation_job() which returns an LROPoller. + + Creates an evaluator generation job and returns the initial job resource immediately. + The service generates rubric-based evaluator definitions from the provided source + materials asynchronously. Use get_generation_job() to poll for completion. + + :param job: The job to create. Is either a EvaluatorGenerationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.EvaluatorGenerationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = await self.begin_create_generation_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.EvaluatorGenerationJob, await poller.result()) + + +class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`beta.datasets` attribute. + """ + + @overload + async def create_generation_job( + self, + job: _models.DataGenerationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @overload + async def create_generation_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @distributed_trace_async + async def create_generation_job( + self, + job: Union[_models.DataGenerationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: + """Create a data generation job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_generation_job() which returns an LROPoller. + + Creates a data generation job and returns the initial job resource immediately. + The service generates synthetic data from the provided configuration asynchronously. + Use get_generation_job() to poll for completion. + + :param job: The job to create. Is either a DataGenerationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DataGenerationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.DataGenerationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = await self.begin_create_generation_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.DataGenerationJob, await poller.result()) + + +class BetaAgentsOperations(BetaAgentsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`beta.agents` attribute. + """ + + @overload + async def create_optimization_job( + self, + job: _models.OptimizationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: ... + + @overload + async def create_optimization_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: ... + + @overload + async def create_optimization_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.OptimizationJob: ... + + @distributed_trace_async + async def create_optimization_job( + self, + job: Union[_models.OptimizationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: + """Create an agent optimization job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_optimization_job() which returns an LROPoller. + + Creates an agent optimization job and returns the initial queued job resource immediately. + The service optimizes agent configurations asynchronously. + Use get_optimization_job() to poll for completion. + + :param job: The job to create. Is either a OptimizationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.OptimizationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + "updated_at", + "updatedAt", + "progress", + "warnings", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.OptimizationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = await self.begin_create_optimization_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.OptimizationJob, await poller.result()) + + class BetaOperations(GeneratedBetaOperations): """ .. warning:: @@ -66,20 +378,38 @@ class BetaOperations(GeneratedBetaOperations): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + # Replace with patched class that includes upload() - self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - # Replace with patched class that adds file-path overload to upload_session_file - self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.evaluators = BetaEvaluatorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + # Replace with patched class that includes create_optimization_job (non-polling) + self.agents = BetaAgentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) # Replace with patched class that includes begin_update_memories - self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = BetaMemoryStoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) # Replace with patched class that includes create (3-step upload helper) - self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.models = BetaModelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + # Replace with patched class that includes create_generation_job (non-polling) + self.datasets = BetaDatasetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) - for property_name, foundry_features_value in _BETA_OPERATION_FEATURE_HEADERS.items(): + for ( + property_name, + foundry_features_value, + ) in _BETA_OPERATION_FEATURE_HEADERS.items(): setattr( self, property_name, - _OperationMethodHeaderProxy(getattr(self, property_name), foundry_features_value), + _OperationMethodHeaderProxy( + getattr(self, property_name), foundry_features_value + ), ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index cd906a8d8498..20b86d7b07bb 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -8,7 +8,19 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, IO, overload +from io import IOBase +from collections.abc import MutableMapping as MutableMappingABC +from typing import ( + Union, + Optional, + Any, + IO, + AsyncIterator, + overload, + cast, + MutableMapping, +) + from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator_async import distributed_trace_async from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset @@ -33,7 +45,7 @@ class AgentsOperations(GeneratedAgentsOperations): :attr:`agents` attribute. """ - @overload + @overload # type: ignore[override] async def create_version( self, agent_name: str, @@ -86,7 +98,12 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: MutableMapping[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.AgentVersionDetails: """Create an agent version. @@ -100,7 +117,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: MutableMapping[str, Any] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -111,7 +128,12 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.AgentVersionDetails: """Create an agent version. @@ -138,7 +160,7 @@ async def create_version( async def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, MutableMapping[str, Any], IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -159,7 +181,7 @@ async def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :type body: JSON or MutableMapping[str, Any] or IO[bytes] :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -187,26 +209,72 @@ async def create_version( # Add Foundry-Features header if not already present headers = kwargs.get("headers") if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS + } + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _AGENT_OPERATION_FEATURE_HEADERS + ) kwargs["headers"] = headers try: + if body is _Unset: + # Use keyword-only overload when body is not provided + return await super().create_version( + agent_name, + definition=definition, + metadata=metadata, + description=description, + blueprint_reference=blueprint_reference, + draft=draft, + **kwargs, + ) + # Use body overload when body is provided + if isinstance(body, (IOBase, bytes)): + typed_body: Union[MutableMapping[str, Any], IO[bytes]] = body + else: + # Strip service-owned fields from MutableMapping bodies before delegation + if isinstance(body, MutableMappingABC): + body_copy = dict(body) + # Remove service-owned response fields per task requirements + for key in [ + "object", + "id", + "name", + "version", + "createdAt", + "created_at", + "status", + "instanceIdentity", + "instance_identity", + "blueprint", + "agentGuid", + "agent_guid", + ]: + body_copy.pop(key, None) + + typed_body = body_copy # type: ignore[assignment] + else: + typed_body = body # type: ignore[assignment] return await super().create_version( agent_name, - body, - definition=definition, - metadata=metadata, - description=description, - blueprint_reference=blueprint_reference, - draft=draft, + cast(Any, typed_body), **kwargs, ) except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", @@ -287,23 +355,34 @@ async def create_version_from_code( if getattr(self._config, "allow_preview", False): # Add Foundry-Features header if not already present headers = kwargs.get("headers") + if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS + } + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _AGENT_OPERATION_FEATURE_HEADERS + ) kwargs["headers"] = headers try: return await super()._create_version_from_code( - agent_name, - content, - code_zip_sha256=code_zip_sha256, - **kwargs, + agent_name, content, code_zip_sha256=code_zip_sha256, **kwargs ) except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", @@ -314,3 +393,63 @@ async def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace_async + async def get_session_log_stream( # type: ignore[override] + self, + agent_name: str, + agent_version: str, + session_id: str, + *, + stream: bool = True, + **kwargs: Any, + ) -> AsyncIterator[bytes]: + """Stream console logs for a hosted agent session. + + Streams console logs (stdout / stderr) for a specific hosted agent session + as a Server-Sent Events (SSE) stream. + + Each SSE frame contains: + + * `event`: always `"log"` + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) + + Example SSE frames: + + .. code-block:: + + event: log + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + + event: log + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + + event: log + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + + event: log + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + + The stream remains open until the client disconnects or the server + terminates the connection. Clients should handle reconnection as needed. + + :param agent_name: The name of the hosted agent. Required. + :type agent_name: str + :param agent_version: The version of the agent. Required. + :type agent_version: str + :param session_id: The session ID (maps to an ADC sandbox). Required. + :type session_id: str + :keyword stream: Whether to stream the response. Default is True. + :paramtype stream: bool + :return: Async iterator of bytes containing SSE frames + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + return cast( + AsyncIterator[bytes], + await super().get_session_log_stream( + agent_name, agent_version, session_id, stream=stream, **kwargs + ), + ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py index 7e61eeb2866c..767516da09dd 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_evaluation_rules_async.py @@ -8,10 +8,14 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Any, IO, overload +from collections.abc import MutableMapping as MutableMappingABC +from io import IOBase +from typing import Any, IO, MutableMapping, Union, cast, overload + + from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator_async import distributed_trace_async -from ._operations import EvaluationRulesOperations as GeneratedEvaluationRulesOperations, JSON +from ._operations import EvaluationRulesOperations as GeneratedEvaluationRulesOperations from ... import models as _models from ...models._enums import _FoundryFeaturesOptInKeys from ...models._patch import ( @@ -32,9 +36,14 @@ class EvaluationRulesOperations(GeneratedEvaluationRulesOperations): :attr:`evaluation_rules` attribute. """ - @overload + @overload # type: ignore[override] async def create_or_update( - self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: _models.EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -53,14 +62,19 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: MutableMapping[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: MutableMapping[str, Any] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -72,7 +86,12 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -91,15 +110,20 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, + id: str, + evaluation_rule: Union[ + _models.EvaluationRule, MutableMapping[str, Any], IO[bytes] + ], + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + EvaluationRule, EvaluationRule, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or MutableMapping[str, Any] or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -111,16 +135,39 @@ async def create_or_update( kwargs["headers"] = { _FOUNDRY_FEATURES_HEADER_NAME: _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value } - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value + ) kwargs["headers"] = headers try: - return await super().create_or_update(id, evaluation_rule, **kwargs) + # Strip service-owned fields from MutableMapping bodies before delegation + if isinstance(evaluation_rule, MutableMappingABC) and not isinstance( + evaluation_rule, (IOBase, bytes) + ): + + rule_copy = dict(evaluation_rule) + # Remove service-owned response fields per task requirements + for key in ["id", "systemData", "system_data"]: + rule_copy.pop(key, None) + return await super().create_or_update(id, cast(Any, rule_copy), **kwargs) # type: ignore[arg-type] + return await super().create_or_update( + id, cast(Any, evaluation_rule), **kwargs + ) except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index 2ee8abc3cf86..35d27861bcab 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -126,6 +126,7 @@ DeleteSkillVersionResult, Deployment, Dimension, + DimensionMetadata, DispatchRoutineResult, EmbeddingConfiguration, EmptyModelParam, @@ -292,6 +293,7 @@ RoutineRun, RoutineTrigger, RubricBasedEvaluatorDefinition, + RubricHealth, SASCredentials, Schedule, ScheduleRoutineTrigger, @@ -311,6 +313,7 @@ SpecificFunctionShellParam, StructuredInputDefinition, StructuredOutputDefinition, + SupersededDimension, TaxonomyCategory, TaxonomySubCategory, TelemetryConfig, @@ -396,6 +399,7 @@ DatasetType, DayOfWeek, DeploymentType, + DimensionChangeKind, EvaluationLevel, EvaluationRuleActionType, EvaluationRuleEventType, @@ -430,6 +434,7 @@ PageOrder, PendingUploadType, RankerVersionType, + ReasoningEffort, RecurrenceType, RiskCategory, RoutineActionType, @@ -437,6 +442,7 @@ RoutineDispatchPayloadType, RoutineRunPhase, RoutineTriggerType, + RubricHealthConfidence, SampleType, ScheduleProvisioningStatus, ScheduleTaskType, @@ -575,6 +581,7 @@ "DeleteSkillVersionResult", "Deployment", "Dimension", + "DimensionMetadata", "DispatchRoutineResult", "EmbeddingConfiguration", "EmptyModelParam", @@ -741,6 +748,7 @@ "RoutineRun", "RoutineTrigger", "RubricBasedEvaluatorDefinition", + "RubricHealth", "SASCredentials", "Schedule", "ScheduleRoutineTrigger", @@ -760,6 +768,7 @@ "SpecificFunctionShellParam", "StructuredInputDefinition", "StructuredOutputDefinition", + "SupersededDimension", "TaxonomyCategory", "TaxonomySubCategory", "TelemetryConfig", @@ -842,6 +851,7 @@ "DatasetType", "DayOfWeek", "DeploymentType", + "DimensionChangeKind", "EvaluationLevel", "EvaluationRuleActionType", "EvaluationRuleEventType", @@ -876,6 +886,7 @@ "PageOrder", "PendingUploadType", "RankerVersionType", + "ReasoningEffort", "RecurrenceType", "RiskCategory", "RoutineActionType", @@ -883,6 +894,7 @@ "RoutineDispatchPayloadType", "RoutineRunPhase", "RoutineTriggerType", + "RubricHealthConfidence", "SampleType", "ScheduleProvisioningStatus", "ScheduleTaskType", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 008f889fc25e..39f515a41618 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -429,6 +429,21 @@ class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Model deployment.""" +class DimensionChangeKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """How a rubric dimension changed relative to the preceding evaluator version.""" + + NEW = "new" + """The dimension was introduced in this evaluator version.""" + CARRIED_OVER = "carried_over" + """The generated dimension was preserved without a substantive change.""" + AMPLIFIED = "amplified" + """The generated dimension retained its meaning and received a higher weight.""" + REGENERATED = "regenerated" + """The generated dimension was substantively changed.""" + HUMAN_EDITED = "human_edited" + """The dimension is owned by a human edit and must be preserved during selective regeneration.""" + + class EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The level at which evaluation is performed.""" @@ -815,6 +830,36 @@ class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DEFAULT_2024_11_15.""" +class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Constrains effort on reasoning for + `reasoning models `_. + Currently supported values are ``none``, ``minimal``, ``low``, ``medium``, ``high``, and + ``xhigh``. Reducing + reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + * `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning + values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all + reasoning values in gpt-5.1. + * All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. + * The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + * `xhigh` is supported for all models after `gpt-5.1-codex-max`. + """ + + NONE = "none" + """NONE.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" + + class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Recurrence type.""" @@ -912,6 +957,17 @@ class RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A one-shot timer trigger.""" +class RubricHealthConfidence(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The completeness of the evidence used to compute rubric health.""" + + LOW = "low" + """The health signals are incomplete or insufficiently supported.""" + MED = "med" + """The health signals have sufficient structural evidence but limited empirical support.""" + HIGH = "high" + """The health signals include strong supporting evidence.""" + + class SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of sample used in the analysis.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 529b03a4859a..870201f9a59c 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -58,7 +58,7 @@ ) if TYPE_CHECKING: - from .. import _types, models as _models + from .. import _unions, models as _models class _CreateAgentVersionFromCodeContent(_Model): @@ -161,17 +161,16 @@ class Tool(_Model): CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, LocalShellToolParam, MCPTool, MemorySearchPreviewTool, NamespaceToolParam, - OpenApiTool, SharepointPreviewTool, FunctionShellToolParam, - ToolSearchToolParam, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool + OpenApiTool, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, WebSearchTool, + WebSearchPreviewTool, WorkIQPreviewTool :ivar type: Required. Known values are: "function", "file_search", "computer", "computer_use_preview", "web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom", "namespace", "tool_search", "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", "memory_search_preview", - "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", - "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", and - "openapi". + "work_iq_preview", "fabric_iq_preview", "toolbox_search_preview", "azure_ai_search", + "azure_function", "bing_grounding", "capture_structured_outputs", and "openapi". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -5564,6 +5563,9 @@ class Dimension(_Model): dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to ``false`` if a value is not specified by the caller. :vartype always_applicable: bool + :ivar metadata: Service-generated version lineage for this dimension. Present only when lineage + tracking is available. + :vartype metadata: ~azure.ai.projects.models.DimensionMetadata """ id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -5582,6 +5584,9 @@ class Dimension(_Model): applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to ``false`` if a value is not specified by the caller.""" + metadata: Optional["_models.DimensionMetadata"] = rest_field(visibility=["read"]) + """Service-generated version lineage for this dimension. Present only when lineage tracking is + available.""" @overload def __init__( @@ -5604,6 +5609,57 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class DimensionMetadata(_Model): + """Service-generated version lineage for a rubric dimension. + + :ivar origin_version: The evaluator version in which the dimension was first introduced, or the + earliest version known after lineage tracking began. Required. + :vartype origin_version: str + :ivar last_modified_version: The evaluator version containing the most recent substantive + change to the dimension. Required. + :vartype last_modified_version: str + :ivar change_kind: How the dimension changed relative to the preceding evaluator version. + Required. Known values are: "new", "carried_over", "amplified", "regenerated", and + "human_edited". + :vartype change_kind: str or ~azure.ai.projects.models.DimensionChangeKind + :ivar change_detail: A bounded service-generated explanation of the version transition. + :vartype change_detail: str + """ + + origin_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The evaluator version in which the dimension was first introduced, or the earliest version + known after lineage tracking began. Required.""" + last_modified_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The evaluator version containing the most recent substantive change to the dimension. Required.""" + change_kind: Union[str, "_models.DimensionChangeKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """How the dimension changed relative to the preceding evaluator version. Required. Known values + are: \"new\", \"carried_over\", \"amplified\", \"regenerated\", and \"human_edited\".""" + change_detail: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A bounded service-generated explanation of the version transition.""" + + @overload + def __init__( + self, + *, + origin_version: str, + last_modified_version: str, + change_kind: Union[str, "_models.DimensionChangeKind"], + change_detail: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class DispatchRoutineResult(_Model): """Identifiers returned after a routine dispatch is queued. @@ -7332,7 +7388,7 @@ class FileSearchTool(Tool, discriminator="file_search"): visibility=["read", "create", "update", "delete", "query"] ) """Ranking options for search.""" - filters: Optional["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is either a ComparisonFilter type or a CompoundFilter type.""" name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Deprecated. This property is deprecated and will be removed in a future version.""" @@ -7350,7 +7406,7 @@ def __init__( vector_store_ids: list[str], max_num_results: Optional[int] = None, ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, + filters: Optional["_unions.Filters"] = None, name: Optional[str] = None, description: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, @@ -7401,7 +7457,7 @@ class FileSearchToolboxTool(ToolboxTool, discriminator="file_search"): visibility=["read", "create", "update", "delete", "query"] ) """Ranking options for search.""" - filters: Optional["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + filters: Optional["_unions.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is either a ComparisonFilter type or a CompoundFilter type.""" vector_store_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The IDs of the vector stores to search.""" @@ -7415,7 +7471,7 @@ def __init__( tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, max_num_results: Optional[int] = None, ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional["_types.Filters"] = None, + filters: Optional["_unions.Filters"] = None, vector_store_ids: Optional[list[str]] = None, ) -> None: ... @@ -9170,12 +9226,13 @@ class MCPTool(Tool, discriminator="mcp"): :vartype type: str or ~azure.ai.projects.models.MCP :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be - provided. + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here `_. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -9190,6 +9247,9 @@ class MCPTool(Tool, discriminator="mcp"): Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str :ivar authorization: An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here. @@ -9219,7 +9279,8 @@ class MCPTool(Tool, discriminator="mcp"): server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A label for this MCP server, used to identify it in tool calls. Required.""" server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be provided.""" + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" connector_id: Optional[ Literal[ "connector_dropbox", @@ -9232,8 +9293,8 @@ class MCPTool(Tool, discriminator="mcp"): "connector_sharepoint", ] ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url`` or - ``connector_id`` must be provided. Learn more about service connectors `here + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -9248,6 +9309,9 @@ class MCPTool(Tool, discriminator="mcp"): Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow @@ -9291,6 +9355,7 @@ def __init__( "connector_sharepoint", ] ] = None, + tunnel_id: Optional[str] = None, authorization: Optional[str] = None, server_description: Optional[str] = None, headers: Optional[dict[str, str]] = None, @@ -9328,12 +9393,13 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): :vartype type: str or ~azure.ai.projects.models.MCP :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. :vartype server_label: str - :ivar server_url: The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be - provided. + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. :vartype server_url: str :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of - ``server_url`` or ``connector_id`` must be provided. Learn more about service connectors `here - `_. Currently supported ``connector_id`` values are: + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here `_. Currently supported + ``connector_id`` values are: * Dropbox: `connector_dropbox` * Gmail: `connector_gmail` @@ -9348,6 +9414,9 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], Literal["connector_sharepoint"] :vartype connector_id: str or str or str or str or str or str or str or str + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str :ivar authorization: An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here. @@ -9374,7 +9443,8 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A label for this MCP server, used to identify it in tool calls. Required.""" server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be provided.""" + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" connector_id: Optional[ Literal[ "connector_dropbox", @@ -9387,8 +9457,8 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): "connector_sharepoint", ] ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier for service connectors, like those available in ChatGPT. One of ``server_url`` or - ``connector_id`` must be provided. Learn more about service connectors `here + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here `_. Currently supported ``connector_id`` values are: * Dropbox: `connector_dropbox` @@ -9403,6 +9473,9 @@ class MCPToolboxTool(ToolboxTool, discriminator="mcp"): Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow @@ -9445,6 +9518,7 @@ def __init__( "connector_sharepoint", ] ] = None, + tunnel_id: Optional[str] = None, authorization: Optional[str] = None, server_description: Optional[str] = None, headers: Optional[dict[str, str]] = None, @@ -12431,26 +12505,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Reasoning(_Model): """Reasoning. - :ivar effort: Is one of the following types: Literal["none"], Literal["minimal"], - Literal["low"], Literal["medium"], Literal["high"], Literal["xhigh"] - :vartype effort: str or str or str or str or str or str + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], Literal["detailed"] :vartype summary: str or str or str + :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], + Literal["all_turns"] + :vartype context: str or str or str :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], Literal["detailed"] :vartype generate_summary: str or str or str """ - effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] = rest_field( + effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Is one of the following types: Literal[\"none\"], Literal[\"minimal\"], Literal[\"low\"], - Literal[\"medium\"], Literal[\"high\"], Literal[\"xhigh\"]""" + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + context: Optional[Literal["auto", "current_turn", "all_turns"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], + Literal[\"all_turns\"]""" generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -12460,8 +12540,9 @@ class Reasoning(_Model): def __init__( self, *, - effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] = None, + effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, summary: Optional[Literal["auto", "concise", "detailed"]] = None, + context: Optional[Literal["auto", "current_turn", "all_turns"]] = None, generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None, ) -> None: ... @@ -12849,7 +12930,9 @@ class RoutineRun(_Model): id: str = rest_field(visibility=["read"]) """The unique run identifier for the routine attempt. Required.""" - status: Optional["_types.RoutineRunStatus"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + status: Optional["_unions.RoutineRunStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The run status. Is one of the following types: str""" phase: Optional[Union[str, "_models.RoutineRunPhase"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -12920,7 +13003,7 @@ class RoutineRun(_Model): def __init__( self, *, - status: Optional["_types.RoutineRunStatus"] = None, + status: Optional["_unions.RoutineRunStatus"] = None, phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, trigger_name: Optional[str] = None, @@ -12982,6 +13065,12 @@ class RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="rubric" average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this threshold. :vartype pass_threshold: float + :ivar health: Service-generated rubric health. Present only when health computation is enabled + and at least one signal is available. + :vartype health: ~azure.ai.projects.models.RubricHealth + :ivar superseded_dimensions: Dimensions from the preceding evaluator version that are not + present in this rubric. Present only when version lineage is available. + :vartype superseded_dimensions: list[~azure.ai.projects.models.SupersededDimension] """ type: Literal[EvaluatorDefinitionType.RUBRIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -12998,6 +13087,12 @@ class RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="rubric" emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this threshold.""" + health: Optional["_models.RubricHealth"] = rest_field(visibility=["read"]) + """Service-generated rubric health. Present only when health computation is enabled and at least + one signal is available.""" + superseded_dimensions: Optional[list["_models.SupersededDimension"]] = rest_field(visibility=["read"]) + """Dimensions from the preceding evaluator version that are not present in this rubric. Present + only when version lineage is available.""" @overload def __init__( @@ -13022,6 +13117,62 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorDefinitionType.RUBRIC # type: ignore +class RubricHealth(_Model): + """Service-generated health signals for a rubric evaluator. + + :ivar diversity: Normalized non-redundancy among rubric dimensions. Higher values indicate + greater diversity. + :vartype diversity: float + :ivar coverage: Normalized coverage of concepts found in the evaluator-generation sources. + :vartype coverage: float + :ivar negative_vs_positive: Failure-path coverage normalized against the service's configured + target fraction. A value of 1.0 means the target was met or exceeded. + :vartype negative_vs_positive: float + :ivar overall: Normalized aggregate health score. Omitted when required component signals are + unavailable. + :vartype overall: float + :ivar confidence: The completeness of the evidence used to compute the health signals. Known + values are: "low", "med", and "high". + :vartype confidence: str or ~azure.ai.projects.models.RubricHealthConfidence + """ + + diversity: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Normalized non-redundancy among rubric dimensions. Higher values indicate greater diversity.""" + coverage: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Normalized coverage of concepts found in the evaluator-generation sources.""" + negative_vs_positive: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Failure-path coverage normalized against the service's configured target fraction. A value of + 1.0 means the target was met or exceeded.""" + overall: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Normalized aggregate health score. Omitted when required component signals are unavailable.""" + confidence: Optional[Union[str, "_models.RubricHealthConfidence"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The completeness of the evidence used to compute the health signals. Known values are: \"low\", + \"med\", and \"high\".""" + + @overload + def __init__( + self, + *, + diversity: Optional[float] = None, + coverage: Optional[float] = None, + negative_vs_positive: Optional[float] = None, + overall: Optional[float] = None, + confidence: Optional[Union[str, "_models.RubricHealthConfidence"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class SASCredentials(BaseCredentials, discriminator="SAS"): """Shared Access Signature (SAS) credential definition. @@ -13318,10 +13469,12 @@ class SessionLogEvent(_Model): .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server + on port 18080"} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} :ivar event: The SSE event type. Currently ``log``, but additional event types may be added in the future. Clients should ignore unrecognized event types. Required. "log" @@ -13869,6 +14022,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class SupersededDimension(_Model): + """A dimension from the preceding evaluator version that is not present in the current rubric. + + :ivar id: The stable identifier of the superseded dimension. Required. + :vartype id: str + :ivar reason: A bounded service-generated reason why the dimension was superseded. Required. + :vartype reason: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The stable identifier of the superseded dimension. Required.""" + reason: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A bounded service-generated reason why the dimension was superseded. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + reason: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class TaxonomyCategory(_Model): """Taxonomy category definition. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index aca7d018ae15..94b9b8c81d3e 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import AIProjectClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -3944,7 +3944,12 @@ def create_version( @overload def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version. @@ -3958,7 +3963,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3996,7 +4001,7 @@ def create_version( def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionRequest, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -4016,8 +4021,9 @@ def create_version( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionRequest or IO[bytes] :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -4164,7 +4170,12 @@ def create_version_from_manifest( @overload def create_version_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateAgentVersionFromManifestRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create an agent version from manifest. @@ -4178,7 +4189,7 @@ def create_version_from_manifest( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4216,7 +4227,7 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateAgentVersionFromManifestRequest, IO[bytes]] = _Unset, *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, @@ -4235,8 +4246,9 @@ def create_version_from_manifest( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateAgentVersionFromManifestRequest, + IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateAgentVersionFromManifestRequest or IO[bytes] :keyword manifest_id: The manifest ID to import the agent version from. Required. :paramtype manifest_id: str :keyword parameter_values: The inputs to the manifest that will result in a fully materialized @@ -4615,7 +4627,12 @@ def update_details( @overload def update_details( - self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + agent_name: str, + body: _types.PatchAgentObjectRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.AgentDetails: """Update an agent endpoint. @@ -4624,7 +4641,7 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.PatchAgentObjectRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -4657,7 +4674,7 @@ def update_details( def update_details( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.PatchAgentObjectRequest, IO[bytes]] = _Unset, *, agent_endpoint: Optional[_models.AgentEndpointConfig] = None, agent_card: Optional[_models.AgentCard] = None, @@ -4669,8 +4686,8 @@ def update_details( :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, PatchAgentObjectRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.PatchAgentObjectRequest or IO[bytes] :keyword agent_endpoint: The endpoint configuration for the agent. Default value is None. :paramtype agent_endpoint: ~azure.ai.projects.models.AgentEndpointConfig :keyword agent_card: Optional agent card for the agent. Default value is None. @@ -4758,14 +4775,19 @@ def _create_version_from_code( ) -> _models.AgentVersionDetails: ... @overload def _create_version_from_code( - self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any + self, + agent_name: str, + content: _types._CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any ) -> _models.AgentVersionDetails: ... @distributed_trace def _create_version_from_code( self, agent_name: str, - content: Union[_models._models._CreateAgentVersionFromCodeContent, JSON], + content: Union[_models._models._CreateAgentVersionFromCodeContent, _types._CreateAgentVersionFromCodeContent], *, code_zip_sha256: str, **kwargs: Any @@ -4784,8 +4806,9 @@ def _create_version_from_code( * Can contain hyphens in the middle * Must not exceed 63 characters. Required. :type agent_name: str - :param content: Is either a _CreateAgentVersionFromCodeContent type or a JSON type. Required. - :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or JSON + :param content: Is one of the following types: _CreateAgentVersionFromCodeContent Required. + :type content: ~azure.ai.projects.models._models._CreateAgentVersionFromCodeContent or + ~azure.ai.projects.types._CreateAgentVersionFromCodeContent :keyword code_zip_sha256: SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. Required. :paramtype code_zip_sha256: str @@ -5080,7 +5103,12 @@ def create_session( @overload def create_session( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: _types.CreateSessionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentSessionResource: """Create a session. @@ -5091,7 +5119,7 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5126,7 +5154,7 @@ def create_session( def create_session( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSessionRequest, IO[bytes]] = _Unset, *, version_indicator: _models.VersionIndicator = _Unset, agent_session_id: Optional[str] = None, @@ -5140,8 +5168,8 @@ def create_session( :param agent_name: The name of the agent to create a session for. Required. :type agent_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSessionRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateSessionRequest or IO[bytes] :keyword version_indicator: Determines which agent version backs the session. Required. :paramtype version_indicator: ~azure.ai.projects.models.VersionIndicator :keyword agent_session_id: Optional caller-provided session ID. If specified, it must be unique @@ -5519,23 +5547,29 @@ def get_session_log_stream( Each SSE frame contains: * `event`: always `"log"` - * `data`: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string) + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) Example SSE frames: .. code-block:: event: log - data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting + FoundryCBAgent server on port 8088"} event: log - data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application + startup complete."} event: log - data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully + connected to container"} event: log - data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since + last 60 seconds"} The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed. @@ -5577,7 +5611,7 @@ def get_session_log_stream( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -6094,7 +6128,7 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, evaluation_rule: _types.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -6103,7 +6137,7 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: ~azure.ai.projects.types.EvaluationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6134,7 +6168,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, id: str, evaluation_rule: Union[_models.EvaluationRule, _types.EvaluationRule, IO[bytes]], **kwargs: Any ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -6142,9 +6176,10 @@ def create_or_update( :param id: Unique identifier for the evaluation rule. Required. :type id: str - :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + :param evaluation_rule: Evaluation rule resource. Is either a EvaluationRule type or a + IO[bytes] type. Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or + ~azure.ai.projects.types.EvaluationRule or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -6934,7 +6969,7 @@ def create_or_update( self, name: str, version: str, - dataset_version: JSON, + dataset_version: _types.DatasetVersion, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -6948,7 +6983,7 @@ def create_or_update( :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str :param dataset_version: The DatasetVersion to create or update. Required. - :type dataset_version: JSON + :type dataset_version: ~azure.ai.projects.types.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -6987,7 +7022,11 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + dataset_version: Union[_models.DatasetVersion, _types.DatasetVersion, IO[bytes]], + **kwargs: Any ) -> _models.DatasetVersion: """Create or update a version. @@ -6997,9 +7036,10 @@ def create_or_update( :type name: str :param version: The specific version id of the DatasetVersion to create or update. Required. :type version: str - :param dataset_version: The DatasetVersion to create or update. Is one of the following types: - DatasetVersion, JSON, IO[bytes] Required. - :type dataset_version: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :param dataset_version: The DatasetVersion to create or update. Is either a DatasetVersion type + or a IO[bytes] type. Required. + :type dataset_version: ~azure.ai.projects.models.DatasetVersion or + ~azure.ai.projects.types.DatasetVersion or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -7099,7 +7139,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -7113,7 +7153,7 @@ def pending_upload( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7155,7 +7195,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -7166,10 +7206,10 @@ def pending_upload( :type name: str :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -7849,7 +7889,13 @@ def create_or_update( @overload def create_or_update( - self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, + name: str, + version: str, + index: _types.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -7860,7 +7906,7 @@ def create_or_update( :param version: The specific version id of the Index to create or update. Required. :type version: str :param index: The Index to create or update. Required. - :type index: JSON + :type index: ~azure.ai.projects.types.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -7899,7 +7945,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + self, name: str, version: str, index: Union[_models.Index, _types.Index, IO[bytes]], **kwargs: Any ) -> _models.Index: """Create or update a version. @@ -7909,9 +7955,9 @@ def create_or_update( :type name: str :param version: The specific version id of the Index to create or update. Required. :type version: str - :param index: The Index to create or update. Is one of the following types: Index, JSON, - IO[bytes] Required. - :type index: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :param index: The Index to create or update. Is either a Index type or a IO[bytes] type. + Required. + :type index: ~azure.ai.projects.models.Index or ~azure.ai.projects.types.Index or IO[bytes] :return: Index. The Index is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Index :raises ~azure.core.exceptions.HttpResponseError: @@ -8039,7 +8085,12 @@ def create_version( @overload def create_version( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateToolboxVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ToolboxVersionObject: """Create a new version of a toolbox. @@ -8049,7 +8100,7 @@ def create_version( Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateToolboxVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8083,7 +8134,7 @@ def create_version( def create_version( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateToolboxVersionRequest, IO[bytes]] = _Unset, *, tools: List[_models.ToolboxTool] = _Unset, description: Optional[str] = None, @@ -8099,8 +8150,9 @@ def create_version( :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateToolboxVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateToolboxVersionRequest or IO[bytes] :keyword tools: The list of tools to include in this version. Required. :paramtype tools: list[~azure.ai.projects.models.ToolboxTool] :keyword description: A human-readable description of the toolbox. Default value is None. @@ -8542,7 +8594,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateToolboxRequest1, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -8551,7 +8603,7 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateToolboxRequest1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8582,7 +8634,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateToolboxRequest1, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. @@ -8590,8 +8647,8 @@ def update( :param name: The name of the toolbox to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateToolboxRequest1, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateToolboxRequest1 or IO[bytes] :keyword default_version: The version identifier that the toolbox should point to. When set, the toolbox's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -9034,7 +9091,7 @@ def create( @overload def create( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -9043,7 +9100,7 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9074,7 +9131,10 @@ def create( @distributed_trace def create( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -9082,9 +9142,10 @@ def create( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -9172,7 +9233,7 @@ def update( @overload def update( - self, name: str, taxonomy: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, taxonomy: _types.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -9181,7 +9242,7 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. - :type taxonomy: JSON + :type taxonomy: ~azure.ai.projects.types.EvaluationTaxonomy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9212,7 +9273,10 @@ def update( @distributed_trace def update( - self, name: str, taxonomy: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + taxonomy: Union[_models.EvaluationTaxonomy, _types.EvaluationTaxonomy, IO[bytes]], + **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -9220,9 +9284,10 @@ def update( :param name: The name of the evaluation taxonomy. Required. :type name: str - :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, - JSON, IO[bytes] Required. - :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :param taxonomy: The evaluation taxonomy. Is either a EvaluationTaxonomy type or a IO[bytes] + type. Required. + :type taxonomy: ~azure.ai.projects.models.EvaluationTaxonomy or + ~azure.ai.projects.types.EvaluationTaxonomy or IO[bytes] :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -9668,7 +9733,12 @@ def create_version( @overload def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -9677,7 +9747,7 @@ def create_version( :param name: The name of the resource. Required. :type name: str :param evaluator_version: Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9708,7 +9778,10 @@ def create_version( @distributed_trace def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], + **kwargs: Any ) -> _models.EvaluatorVersion: """Create an evaluator version. @@ -9716,9 +9789,9 @@ def create_version( :param name: The name of the resource. Required. :type name: str - :param evaluator_version: Is one of the following types: EvaluatorVersion, JSON, IO[bytes] - Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Is either a EvaluatorVersion type or a IO[bytes] type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -9814,7 +9887,13 @@ def update_version( @overload def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + evaluator_version: _types.EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -9825,7 +9904,7 @@ def update_version( :param version: The version of the EvaluatorVersion to update. Required. :type version: str :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :type evaluator_version: ~azure.ai.projects.types.EvaluatorVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9867,7 +9946,7 @@ def update_version( self, name: str, version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + evaluator_version: Union[_models.EvaluatorVersion, _types.EvaluatorVersion, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an evaluator version. @@ -9878,9 +9957,10 @@ def update_version( :type name: str :param version: The version of the EvaluatorVersion to update. Required. :type version: str - :param evaluator_version: Evaluator resource. Is one of the following types: EvaluatorVersion, - JSON, IO[bytes] Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] + :param evaluator_version: Evaluator resource. Is either a EvaluatorVersion type or a IO[bytes] + type. Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or + ~azure.ai.projects.types.EvaluatorVersion or IO[bytes] :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -9981,7 +10061,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -9996,7 +10076,7 @@ def pending_upload( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param pending_upload_request: The pending upload request parameters. Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10039,7 +10119,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.PendingUploadRequest, _types.PendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: """Start a pending upload. @@ -10051,10 +10131,10 @@ def pending_upload( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param pending_upload_request: The pending upload request parameters. Is one of the following - types: PendingUploadRequest, JSON, IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: The pending upload request parameters. Is either a + PendingUploadRequest type or a IO[bytes] type. Required. + :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or + ~azure.ai.projects.types.PendingUploadRequest or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -10159,7 +10239,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.EvaluatorCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -10174,7 +10254,7 @@ def get_credentials( :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str :param credential_request: The credential request parameters. Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.EvaluatorCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10217,7 +10297,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.EvaluatorCredentialRequest, _types.EvaluatorCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get evaluator credentials. @@ -10229,10 +10309,10 @@ def get_credentials( :type name: str :param version: The specific version id of the EvaluatorVersion to operate on. Required. :type version: str - :param credential_request: The credential request parameters. Is one of the following types: - EvaluatorCredentialRequest, JSON, IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or JSON or - IO[bytes] + :param credential_request: The credential request parameters. Is either a + EvaluatorCredentialRequest type or a IO[bytes] type. Required. + :type credential_request: ~azure.ai.projects.models.EvaluatorCredentialRequest or + ~azure.ai.projects.types.EvaluatorCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -10303,15 +10383,87 @@ def get_credentials( return deserialized # type: ignore + def _create_generation_job_initial( + self, + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_evaluators_create_generation_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def create_generation_job( + def begin_create_generation_job( self, job: _models.EvaluatorGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions @@ -10325,42 +10477,49 @@ def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of LROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + def begin_create_generation_job( + self, + job: _types.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.EvaluatorGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of LROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_generation_job( + def begin_create_generation_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions @@ -10374,102 +10533,93 @@ def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of LROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_generation_job( + def begin_create_generation_job( self, - job: Union[_models.EvaluatorGenerationJob, JSON, IO[bytes]], + job: Union[_models.EvaluatorGenerationJob, _types.EvaluatorGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.EvaluatorGenerationJob: + ) -> LROPoller[_models.EvaluatorVersion]: """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. - :param job: The job to create. Is one of the following types: EvaluatorGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a EvaluatorGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or + ~azure.ai.projects.types.EvaluatorGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :return: An instance of LROPoller that returns EvaluatorVersion. The EvaluatorVersion is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.EvaluatorVersion] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluatorGenerationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.EvaluatorVersion, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_evaluators_create_generation_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.EvaluatorGenerationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.EvaluatorVersion].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EvaluatorVersion]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: @@ -10797,14 +10947,16 @@ def generate( """ @overload - def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: + def generate( + self, insight: _types.Insight, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. - :type insight: JSON + :type insight: ~azure.ai.projects.types.Insight :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10831,14 +10983,15 @@ def generate(self, insight: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: + def generate(self, insight: Union[_models.Insight, _types.Insight, IO[bytes]], **kwargs: Any) -> _models.Insight: """Generate insights. Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Is one of the following types: Insight, JSON, IO[bytes] Required. - :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] + settings. Is either a Insight type or a IO[bytes] type. Required. + :type insight: ~azure.ai.projects.models.Insight or ~azure.ai.projects.types.Insight or + IO[bytes] :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -11150,14 +11303,14 @@ def create( @overload def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types.CreateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Create a memory store. Creates a memory store resource with the provided configuration. :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11187,7 +11340,7 @@ def create( @distributed_trace def create( self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryStoreRequest, IO[bytes]] = _Unset, *, name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, @@ -11199,8 +11352,8 @@ def create( Creates a memory store resource with the provided configuration. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryStoreRequest or IO[bytes] :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -11316,7 +11469,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoryStoreRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: """Update a memory store. @@ -11325,7 +11478,7 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryStoreRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11358,7 +11511,7 @@ def update( def update( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoryStoreRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -11370,8 +11523,8 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryStoreRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryStoreRequest or IO[bytes] :keyword description: A human-readable description of the memory store. Default value is None. :paramtype description: str :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default @@ -11689,7 +11842,7 @@ def _search_memories( ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.SearchMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: ... @overload def _search_memories( @@ -11700,7 +11853,7 @@ def _search_memories( def _search_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.SearchMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11714,8 +11867,8 @@ def _search_memories( :param name: The name of the memory store to search. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.SearchMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -11803,7 +11956,7 @@ def _search_memories( def _update_memories_initial( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11899,7 +12052,7 @@ def _begin_update_memories( ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateMemoriesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload def _begin_update_memories( @@ -11910,7 +12063,7 @@ def _begin_update_memories( def _begin_update_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.UpdateMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, items: Optional[List[dict[str, Any]]] = None, @@ -11925,8 +12078,8 @@ def _begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -12031,7 +12184,7 @@ def delete_scope( @overload def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.DeleteScopeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -12040,7 +12193,7 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DeleteScopeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12073,7 +12226,12 @@ def delete_scope( @distributed_trace def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.DeleteScopeRequest, IO[bytes]] = _Unset, + *, + scope: str = _Unset, + **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: """Delete memories by scope. @@ -12081,8 +12239,8 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DeleteScopeRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.DeleteScopeRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -12196,7 +12354,7 @@ def create_memory( @overload def create_memory( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.CreateMemoryRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: """Create a memory item. @@ -12205,7 +12363,7 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12238,7 +12396,7 @@ def create_memory( def create_memory( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateMemoryRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, content: str = _Unset, @@ -12251,8 +12409,8 @@ def create_memory( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.CreateMemoryRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -12363,7 +12521,13 @@ def update_memory( @overload def update_memory( - self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + memory_id: str, + body: _types.UpdateMemoryRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -12374,7 +12538,7 @@ def update_memory( :param memory_id: The ID of the memory item to update. Required. :type memory_id: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateMemoryRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12407,7 +12571,13 @@ def update_memory( @distributed_trace def update_memory( - self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any + self, + name: str, + memory_id: str, + body: Union[JSON, _types.UpdateMemoryRequest, IO[bytes]] = _Unset, + *, + content: str = _Unset, + **kwargs: Any ) -> _models.MemoryItem: """Update a memory item. @@ -12417,8 +12587,8 @@ def update_memory( :type name: str :param memory_id: The ID of the memory item to update. Required. :type memory_id: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateMemoryRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateMemoryRequest or IO[bytes] :keyword content: The updated content of the memory. Required. :paramtype content: str :return: MemoryItem. The MemoryItem is compatible with MutableMapping @@ -12617,7 +12787,7 @@ def list_memories( def list_memories( self, name: str, - body: JSON, + body: _types.ListMemoriesRequest, *, kind: Optional[Union[str, _models.MemoryItemKind]] = None, limit: Optional[int] = None, @@ -12633,7 +12803,7 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.ListMemoriesRequest :keyword kind: The kind of the memory item. Known values are: "user_profile", "chat_summary", and "procedural". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.MemoryItemKind @@ -12709,7 +12879,7 @@ def list_memories( def list_memories( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.ListMemoriesRequest, IO[bytes]] = _Unset, *, scope: str = _Unset, kind: Optional[Union[str, _models.MemoryItemKind]] = None, @@ -12724,8 +12894,8 @@ def list_memories( :param name: The name of the memory store. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, ListMemoriesRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.ListMemoriesRequest or IO[bytes] :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -13252,7 +13422,7 @@ def update( self, name: str, version: str, - model_version_update: JSON, + model_version_update: _types.UpdateModelVersionRequest, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -13267,7 +13437,7 @@ def update( Required. :type version: str :param model_version_update: The UpdateModelVersionRequest to create or update. Required. - :type model_version_update: JSON + :type model_version_update: ~azure.ai.projects.types.UpdateModelVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -13310,7 +13480,7 @@ def update( self, name: str, version: str, - model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], + model_version_update: Union[_models.UpdateModelVersionRequest, _types.UpdateModelVersionRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: """Update a model version. @@ -13322,10 +13492,10 @@ def update( :param version: The specific version id of the UpdateModelVersionRequest to create or update. Required. :type version: str - :param model_version_update: The UpdateModelVersionRequest to create or update. Is one of the - following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. - :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or JSON or - IO[bytes] + :param model_version_update: The UpdateModelVersionRequest to create or update. Is either a + UpdateModelVersionRequest type or a IO[bytes] type. Required. + :type model_version_update: ~azure.ai.projects.models.UpdateModelVersionRequest or + ~azure.ai.projects.types.UpdateModelVersionRequest or IO[bytes] :return: ModelVersion. The ModelVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -13423,7 +13593,13 @@ def pending_create_version( @overload def pending_create_version( - self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + model_version: _types.ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -13435,7 +13611,7 @@ def pending_create_version( :param version: Version of the model. Required. :type version: str :param model_version: Model version to create. Required. - :type model_version: JSON + :type model_version: ~azure.ai.projects.types.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13475,7 +13651,11 @@ def pending_create_version( @distributed_trace def pending_create_version( - self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + model_version: Union[_models.ModelVersion, _types.ModelVersion, IO[bytes]], + **kwargs: Any ) -> _models.CreateAsyncResponse: """Create a model version async. @@ -13486,9 +13666,10 @@ def pending_create_version( :type name: str :param version: Version of the model. Required. :type version: str - :param model_version: Model version to create. Is one of the following types: ModelVersion, - JSON, IO[bytes] Required. - :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is either a ModelVersion type or a IO[bytes] + type. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or + ~azure.ai.projects.types.ModelVersion or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -13592,7 +13773,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: JSON, + pending_upload_request: _types.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13606,7 +13787,7 @@ def pending_upload( :param version: Version of the model. Required. :type version: str :param pending_upload_request: Required. - :type pending_upload_request: JSON + :type pending_upload_request: ~azure.ai.projects.types.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13650,7 +13831,7 @@ def pending_upload( self, name: str, version: str, - pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + pending_upload_request: Union[_models.ModelPendingUploadRequest, _types.ModelPendingUploadRequest, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start a pending upload. @@ -13661,10 +13842,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param pending_upload_request: Is one of the following types: ModelPendingUploadRequest, JSON, - IO[bytes] Required. - :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or - IO[bytes] + :param pending_upload_request: Is either a ModelPendingUploadRequest type or a IO[bytes] type. + Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or + ~azure.ai.projects.types.ModelPendingUploadRequest or IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -13765,7 +13946,7 @@ def get_credentials( self, name: str, version: str, - credential_request: JSON, + credential_request: _types.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13779,7 +13960,7 @@ def get_credentials( :param version: Version of the model. Required. :type version: str :param credential_request: Required. - :type credential_request: JSON + :type credential_request: ~azure.ai.projects.types.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13821,7 +14002,7 @@ def get_credentials( self, name: str, version: str, - credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + credential_request: Union[_models.ModelCredentialRequest, _types.ModelCredentialRequest, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: """Get model asset credentials. @@ -13832,9 +14013,10 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param credential_request: Is one of the following types: ModelCredentialRequest, JSON, - IO[bytes] Required. - :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: Is either a ModelCredentialRequest type or a IO[bytes] type. + Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or + ~azure.ai.projects.types.ModelCredentialRequest or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -14091,13 +14273,15 @@ def create( """ @overload - def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: + def create( + self, red_team: _types.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. :param red_team: Redteam to be run. Required. - :type red_team: JSON + :type red_team: ~azure.ai.projects.types.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14123,14 +14307,14 @@ def create(self, red_team: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace - def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: + def create(self, red_team: Union[_models.RedTeam, _types.RedTeam, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Create a redteam run. Submits a new redteam run for execution with the provided configuration. - :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] - Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :param red_team: Redteam to be run. Is either a RedTeam type or a IO[bytes] type. Required. + :type red_team: ~azure.ai.projects.models.RedTeam or ~azure.ai.projects.types.RedTeam or + IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -14254,7 +14438,12 @@ def create_or_update( @overload def create_or_update( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.CreateOrUpdateRoutineRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.Routine: """Create or update a routine. @@ -14263,7 +14452,7 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateOrUpdateRoutineRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14296,7 +14485,7 @@ def create_or_update( def create_or_update( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateOrUpdateRoutineRequest, IO[bytes]] = _Unset, *, description: Optional[str] = None, enabled: Optional[bool] = None, @@ -14310,8 +14499,9 @@ def create_or_update( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateOrUpdateRoutineRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateOrUpdateRoutineRequest or IO[bytes] :keyword description: A human-readable description of the routine. Default value is None. :paramtype description: str :keyword enabled: Whether the routine is enabled. Default value is None. @@ -14852,7 +15042,12 @@ def dispatch( @overload def dispatch( - self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + routine_name: str, + body: _types.DispatchRoutineAsyncRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. @@ -14861,7 +15056,7 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.DispatchRoutineAsyncRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14894,7 +15089,7 @@ def dispatch( def dispatch( self, routine_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.DispatchRoutineAsyncRequest, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any @@ -14905,8 +15100,9 @@ def dispatch( :param routine_name: The unique name of the routine. Required. :type routine_name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, DispatchRoutineAsyncRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.DispatchRoutineAsyncRequest or IO[bytes] :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload @@ -15238,7 +15434,7 @@ def create_or_update( @overload def create_or_update( - self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, schedule_id: str, schedule: _types.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -15247,7 +15443,7 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :param schedule: The resource instance. Required. - :type schedule: JSON + :type schedule: ~azure.ai.projects.types.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15278,7 +15474,7 @@ def create_or_update( @distributed_trace def create_or_update( - self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, schedule_id: str, schedule: Union[_models.Schedule, _types.Schedule, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update a schedule. @@ -15286,9 +15482,10 @@ def create_or_update( :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str - :param schedule: The resource instance. Is one of the following types: Schedule, JSON, - IO[bytes] Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param schedule: The resource instance. Is either a Schedule type or a IO[bytes] type. + Required. + :type schedule: ~azure.ai.projects.models.Schedule or ~azure.ai.projects.types.Schedule or + IO[bytes] :return: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule :raises ~azure.core.exceptions.HttpResponseError: @@ -15731,7 +15928,7 @@ def update( @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, name: str, body: _types.UpdateSkillRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -15740,7 +15937,7 @@ def update( :param name: The name of the skill to update. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.UpdateSkillRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15771,7 +15968,12 @@ def update( @distributed_trace def update( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, default_version: str = _Unset, **kwargs: Any + self, + name: str, + body: Union[JSON, _types.UpdateSkillRequest, IO[bytes]] = _Unset, + *, + default_version: str = _Unset, + **kwargs: Any ) -> _models.SkillDetails: """Update a skill. @@ -15779,8 +15981,8 @@ def update( :param name: The name of the skill to update. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, UpdateSkillRequest, IO[bytes] Required. + :type body: JSON or ~azure.ai.projects.types.UpdateSkillRequest or IO[bytes] :keyword default_version: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest. Required. :paramtype default_version: str @@ -15956,7 +16158,12 @@ def create( @overload def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: _types.CreateSkillVersionRequest, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.SkillVersion: """Create a new version of a skill. @@ -15965,7 +16172,7 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str :param body: Required. - :type body: JSON + :type body: ~azure.ai.projects.types.CreateSkillVersionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -15998,7 +16205,7 @@ def create( def create( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types.CreateSkillVersionRequest, IO[bytes]] = _Unset, *, inline_content: Optional[_models.SkillInlineContent] = None, default: Optional[bool] = None, @@ -16010,8 +16217,9 @@ def create( :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, CreateSkillVersionRequest, IO[bytes] + Required. + :type body: JSON or ~azure.ai.projects.types.CreateSkillVersionRequest or IO[bytes] :keyword inline_content: Inline skill content for simple skills without file uploads. Foundry-specific extension. Default value is None. :paramtype inline_content: ~azure.ai.projects.models.SkillInlineContent @@ -16107,7 +16315,9 @@ def create_from_files( """ @overload - def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: + def create_from_files( + self, name: str, content: _types.CreateSkillVersionFromFilesBody, **kwargs: Any + ) -> _models.SkillVersion: """Create a skill version from uploaded files. Creates a new version of a skill from uploaded files via multipart form data. @@ -16115,7 +16325,7 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. :param name: The name of the skill. Required. :type name: str :param content: Required. - :type content: JSON + :type content: ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -16123,7 +16333,10 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. @distributed_trace def create_from_files( - self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any + self, + name: str, + content: Union[_models.CreateSkillVersionFromFilesBody, _types.CreateSkillVersionFromFilesBody], + **kwargs: Any ) -> _models.SkillVersion: """Create a skill version from uploaded files. @@ -16131,8 +16344,9 @@ def create_from_files( :param name: The name of the skill. Required. :type name: str - :param content: Is either a CreateSkillVersionFromFilesBody type or a JSON type. Required. - :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or JSON + :param content: Is one of the following types: CreateSkillVersionFromFilesBody Required. + :type content: ~azure.ai.projects.models.CreateSkillVersionFromFilesBody or + ~azure.ai.projects.types.CreateSkillVersionFromFilesBody :return: SkillVersion. The SkillVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.SkillVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -16752,15 +16966,87 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) + def _create_generation_job_initial( + self, + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_datasets_create_generation_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def create_generation_job( + def begin_create_generation_job( self, job: _models.DataGenerationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. @@ -16773,41 +17059,48 @@ def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of LROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_generation_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + def begin_create_generation_job( + self, + job: _types.DataGenerationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.DataGenerationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of LROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_generation_job( + def begin_create_generation_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. @@ -16820,101 +17113,92 @@ def create_generation_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of LROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_generation_job( + def begin_create_generation_job( self, - job: Union[_models.DataGenerationJob, JSON, IO[bytes]], + job: Union[_models.DataGenerationJob, _types.DataGenerationJob, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.DataGenerationJob: + ) -> LROPoller[_models.DataGenerationJobResult]: """Create a data generation job. Submits a new data generation job for asynchronous execution. - :param job: The job to create. Is one of the following types: DataGenerationJob, JSON, - IO[bytes] Required. - :type job: ~azure.ai.projects.models.DataGenerationJob or JSON or IO[bytes] + :param job: The job to create. Is either a DataGenerationJob type or a IO[bytes] type. + Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or + ~azure.ai.projects.types.DataGenerationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DataGenerationJob + :return: An instance of LROPoller that returns DataGenerationJobResult. The + DataGenerationJobResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.DataGenerationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataGenerationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.DataGenerationJobResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_generation_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.DataGenerationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_datasets_create_generation_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.DataGenerationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.DataGenerationJobResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DataGenerationJobResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: @@ -17057,15 +17341,87 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + def _create_optimization_job_initial( + self, + job: Union[_models.OptimizationJob, _types.OptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(job, (IOBase, bytes)): + _content = job + else: + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agents_create_optimization_job_request( + operation_id=operation_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def create_optimization_job( + def begin_create_optimization_job( self, job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + ) -> LROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for @@ -17079,42 +17435,49 @@ def create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_optimization_job( - self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + def begin_create_optimization_job( + self, + job: _types.OptimizationJob, + *, + operation_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. :param job: The job to create. Required. - :type job: JSON + :type job: ~azure.ai.projects.types.OptimizationJob :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_optimization_job( + def begin_create_optimization_job( self, job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.OptimizationJob: + ) -> LROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for @@ -17128,98 +17491,92 @@ def create_optimization_job( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_optimization_job( - self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any - ) -> _models.OptimizationJob: + def begin_create_optimization_job( + self, + job: Union[_models.OptimizationJob, _types.OptimizationJob, IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.OptimizationJobResult]: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param job: The job to create. Is one of the following types: OptimizationJob, JSON, IO[bytes] - Required. - :type job: ~azure.ai.projects.models.OptimizationJob or JSON or IO[bytes] + :param job: The job to create. Is either a OptimizationJob type or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.OptimizationJob or + ~azure.ai.projects.types.OptimizationJob or IO[bytes] :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. :paramtype operation_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob + :return: An instance of LROPoller that returns OptimizationJobResult. The OptimizationJobResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.OptimizationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJobResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_optimization_job_initial( + job=job, + operation_id=operation_id, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(job, (IOBase, bytes)): - _content = job - else: - _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Operation-Location"] = self._deserialize( + "str", response.headers.get("Operation-Location") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.OptimizationJobResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_beta_agents_create_optimization_job_request( - operation_id=operation_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.OptimizationJobResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OptimizationJobResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py index 283443056bf4..7388fe123882 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch.py @@ -10,8 +10,17 @@ from functools import wraps import inspect -from typing import Any, Callable, List -from ..models._patch import _FOUNDRY_FEATURES_HEADER_NAME, _BETA_OPERATION_FEATURE_HEADERS, _has_header_case_insensitive +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, Callable, IO, List, Optional, Union, cast, overload + +from azure.core.tracing.decorator import distributed_trace +from ..models._patch import ( + _FOUNDRY_FEATURES_HEADER_NAME, + _BETA_OPERATION_FEATURE_HEADERS, + _has_header_case_insensitive, +) +from .. import models as _models from ._patch_agents import AgentsOperations from ._patch_datasets import DatasetsOperations from ._patch_evaluation_rules import EvaluationRulesOperations @@ -20,10 +29,10 @@ from ._patch_memories import BetaMemoryStoresOperations from ._patch_models import BetaModelsOperations from ._operations import ( - BetaAgentsOperations, - BetaDatasetsOperations, + BetaAgentsOperations as BetaAgentsOperationsGenerated, + BetaDatasetsOperations as BetaDatasetsOperationsGenerated, BetaEvaluationTaxonomiesOperations, - BetaEvaluatorsOperations, + BetaEvaluatorsOperations as BetaEvaluatorsOperationsGenerated, BetaInsightsOperations, BetaOperations as GeneratedBetaOperations, BetaRedTeamsOperations, @@ -33,6 +42,310 @@ ) +class BetaEvaluatorsOperations(BetaEvaluatorsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`beta.evaluators` attribute. + """ + + @overload + def create_generation_job( + self, + job: _models.EvaluatorGenerationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @overload + def create_generation_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @overload + def create_generation_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.EvaluatorGenerationJob: ... + + @distributed_trace + def create_generation_job( + self, + job: Union[_models.EvaluatorGenerationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EvaluatorGenerationJob: + """Create an evaluator generation job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_generation_job() which returns an LROPoller. + + Creates an evaluator generation job and returns the initial job resource immediately. + The service generates rubric-based evaluator definitions from the provided source + materials asynchronously. Use get_generation_job() to poll for completion. + + :param job: The job to create. Is either a EvaluatorGenerationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.EvaluatorGenerationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: EvaluatorGenerationJob. The EvaluatorGenerationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorGenerationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.EvaluatorGenerationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = self.begin_create_generation_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.EvaluatorGenerationJob, poller.result()) + + +class BetaDatasetsOperations(BetaDatasetsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`beta.datasets` attribute. + """ + + @overload + def create_generation_job( + self, + job: _models.DataGenerationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @overload + def create_generation_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @overload + def create_generation_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.DataGenerationJob: ... + + @distributed_trace + def create_generation_job( + self, + job: Union[_models.DataGenerationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.DataGenerationJob: + """Create a data generation job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_generation_job() which returns an LROPoller. + + Creates a data generation job and returns the initial job resource immediately. + The service generates synthetic data from the provided configuration asynchronously. + Use get_generation_job() to poll for completion. + + :param job: The job to create. Is either a DataGenerationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.DataGenerationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: DataGenerationJob. The DataGenerationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DataGenerationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.DataGenerationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = self.begin_create_generation_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.DataGenerationJob, poller.result()) + + +class BetaAgentsOperations(BetaAgentsOperationsGenerated): + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`beta.agents` attribute. + """ + + @overload + def create_optimization_job( + self, + job: _models.OptimizationJob, + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: ... + + @overload + def create_optimization_job( + self, + job: MutableMapping[str, Any], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: ... + + @overload + def create_optimization_job( + self, job: IO[bytes], *, operation_id: Optional[str] = None, **kwargs: Any + ) -> _models.OptimizationJob: ... + + @distributed_trace + def create_optimization_job( + self, + job: Union[_models.OptimizationJob, MutableMapping[str, Any], IO[bytes]], + *, + operation_id: Optional[str] = None, + **kwargs: Any + ) -> _models.OptimizationJob: + """Create an agent optimization job (non-polling). + + This compatibility method returns the initial queued job like the prior shipped API. + For the final result, use begin_create_optimization_job() which returns an LROPoller. + + Creates an agent optimization job and returns the initial queued job resource immediately. + The service optimizes agent configurations asynchronously. + Use get_optimization_job() to poll for completion. + + :param job: The job to create. Is either a OptimizationJob type, a + MutableMapping[str, Any] type, or a IO[bytes] type. Required. + :type job: ~azure.ai.projects.models.OptimizationJob or MutableMapping[str, Any] or + IO[bytes] + :keyword operation_id: Client-generated unique ID for idempotent retries. When absent, the + server creates the job unconditionally. Default value is None. + :paramtype operation_id: str + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + if isinstance(job, MutableMapping) and not isinstance(job, (IOBase, bytes)): + job_copy = dict(job) + for field in ( + "id", + "result", + "status", + "error", + "created_at", + "createdAt", + "finished_at", + "finishedAt", + "usage", + "updated_at", + "updatedAt", + "progress", + "warnings", + ): + job_copy.pop(field, None) + job = job_copy + + cls = kwargs.pop("cls", None) + kwargs.pop("polling", None) + + def _extract_initial_response( + pipeline_response, _deserialized, _response_headers + ): + response_json = pipeline_response.http_response.json() + result = _models.OptimizationJob(response_json) + if cls: + return cls(pipeline_response, result, _response_headers) + return result + + poller = self.begin_create_optimization_job( + job=cast(Any, job), + operation_id=operation_id, + polling=False, + cls=_extract_initial_response, + **kwargs + ) + + return cast(_models.OptimizationJob, poller.result()) + + def _method_accepts_keyword_headers(method: Callable[..., Any]) -> bool: try: signature = inspect.signature(method) @@ -58,17 +371,27 @@ def __init__(self, operation: Any, foundry_features_value: str): def __getattr__(self, name: str) -> Any: attribute = getattr(self._operation, name) - if name.startswith("_") or not callable(attribute) or not _method_accepts_keyword_headers(attribute): + if ( + name.startswith("_") + or not callable(attribute) + or not _method_accepts_keyword_headers(attribute) + ): return attribute @wraps(attribute) def _wrapped(*args: Any, **kwargs: Any) -> Any: headers = kwargs.get("headers") if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: self._foundry_features_value} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: self._foundry_features_value + } + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): try: - headers[_FOUNDRY_FEATURES_HEADER_NAME] = self._foundry_features_value + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + self._foundry_features_value + ) except Exception: # pylint: disable=broad-except # Fall back to replacing invalid/immutable header containers. kwargs["headers"] = { @@ -121,20 +444,38 @@ class BetaOperations(GeneratedBetaOperations): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + # Replace with patched class that includes upload() - self.evaluators = BetaEvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) - # Replace with patched class that adds file-path overload to upload_session_file - self.agents = BetaAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.evaluators = BetaEvaluatorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + # Replace with patched class that includes create_optimization_job (non-polling) + self.agents = BetaAgentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) # Replace with patched class that includes begin_update_memories - self.memory_stores = BetaMemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = BetaMemoryStoresOperations( + self._client, self._config, self._serialize, self._deserialize + ) # Replace with patched class that includes create (3-step upload helper) - self.models = BetaModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.models = BetaModelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + # Replace with patched class that includes create_generation_job (non-polling) + self.datasets = BetaDatasetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) - for property_name, foundry_features_value in _BETA_OPERATION_FEATURE_HEADERS.items(): + for ( + property_name, + foundry_features_value, + ) in _BETA_OPERATION_FEATURE_HEADERS.items(): setattr( self, property_name, - _OperationMethodHeaderProxy(getattr(self, property_name), foundry_features_value), + _OperationMethodHeaderProxy( + getattr(self, property_name), foundry_features_value + ), ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index d72e81cf077d..930dd2d006b9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -10,7 +10,18 @@ import hashlib from io import IOBase -from typing import Union, Optional, Any, IO, overload +from collections.abc import MutableMapping as MutableMappingABC +from typing import ( + Union, + Optional, + Any, + IO, + Iterator, + overload, + cast, + MutableMapping, +) + from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator import distributed_trace from ._operations import AgentsOperations as GeneratedAgentsOperations, JSON, _Unset @@ -24,7 +35,9 @@ ) -def _compute_sha256_from_stream(stream: IO[bytes], *, chunk_size: int = 1024 * 1024) -> str: +def _compute_sha256_from_stream( + stream: IO[bytes], *, chunk_size: int = 1024 * 1024 +) -> str: if not isinstance(stream, IOBase) or not stream.seekable(): raise TypeError("'code' must be provided as a seekable IO[bytes] stream.") @@ -51,7 +64,7 @@ class AgentsOperations(GeneratedAgentsOperations): :attr:`agents` attribute. """ - @overload + @overload # type: ignore[override] def create_version( self, agent_name: str, @@ -104,7 +117,12 @@ def create_version( @overload def create_version( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: MutableMapping[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.AgentVersionDetails: """Create an agent version. @@ -118,7 +136,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Required. - :type body: JSON + :type body: MutableMapping[str, Any] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -129,7 +147,12 @@ def create_version( @overload def create_version( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.AgentVersionDetails: """Create an agent version. @@ -156,7 +179,7 @@ def create_version( def create_version( self, agent_name: str, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, MutableMapping[str, Any], IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, metadata: Optional[dict[str, str]] = None, @@ -177,7 +200,7 @@ def create_version( * Must not exceed 63 characters. Required. :type agent_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :type body: JSON or MutableMapping[str, Any] or IO[bytes] :keyword definition: The agent definition. This can be a workflow, hosted agent, or a simple agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition @@ -206,20 +229,59 @@ def create_version( # Add Foundry-Features header if not already present headers = kwargs.get("headers") if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS + } + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _AGENT_OPERATION_FEATURE_HEADERS + ) kwargs["headers"] = headers try: + if body is _Unset: + # Use keyword-only overload when body is not provided + return super().create_version( + agent_name, + definition=definition, + metadata=metadata, + description=description, + blueprint_reference=blueprint_reference, + draft=draft, + **kwargs, + ) + # Use body overload when body is provided + if isinstance(body, (IOBase, bytes)): + typed_body: Union[MutableMapping[str, Any], IO[bytes]] = body + else: + # Strip service-owned fields from MutableMapping bodies before delegation + if isinstance(body, MutableMappingABC): + body_copy = dict(body) + # Remove service-owned response fields per task requirements + for key in [ + "object", + "id", + "name", + "version", + "createdAt", + "created_at", + "status", + "instanceIdentity", + "instance_identity", + "blueprint", + "agentGuid", + "agent_guid", + ]: + body_copy.pop(key, None) + + typed_body = body_copy # type: ignore[assignment] + else: + typed_body = body # type: ignore[assignment] return super().create_version( agent_name, - body, - definition=definition, - metadata=metadata, - description=description, - blueprint_reference=blueprint_reference, - draft=draft, + cast(Any, typed_body), **kwargs, ) except HttpResponseError as exc: @@ -238,9 +300,16 @@ def create_version( } """ - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", @@ -313,6 +382,7 @@ def create_version_from_code( description=description, metadata=metadata, ) + content = _models._models._CreateAgentVersionFromCodeContent( # pylint: disable=protected-access metadata=metadata_obj, code=code, @@ -321,23 +391,34 @@ def create_version_from_code( if getattr(self._config, "allow_preview", False): # Add Foundry-Features header if not already present headers = kwargs.get("headers") + if headers is None: - kwargs["headers"] = {_FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS} - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _AGENT_OPERATION_FEATURE_HEADERS + kwargs["headers"] = { + _FOUNDRY_FEATURES_HEADER_NAME: _AGENT_OPERATION_FEATURE_HEADERS + } + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _AGENT_OPERATION_FEATURE_HEADERS + ) kwargs["headers"] = headers try: return super()._create_version_from_code( - agent_name, - content, - code_zip_sha256=code_zip_sha256, - **kwargs, + agent_name, content, code_zip_sha256=code_zip_sha256, **kwargs ) except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", @@ -348,3 +429,63 @@ def create_version_from_code( new_exc.model = exc.model raise new_exc from exc raise + + @distributed_trace + def get_session_log_stream( # type: ignore[override] + self, + agent_name: str, + agent_version: str, + session_id: str, + *, + stream: bool = True, + **kwargs: Any, + ) -> Iterator[bytes]: + """Stream console logs for a hosted agent session. + + Streams console logs (stdout / stderr) for a specific hosted agent session + as a Server-Sent Events (SSE) stream. + + Each SSE frame contains: + + * `event`: always `"log"` + * `data`: a plain-text log line (currently JSON-formatted, but the schema + is not contractual and may include additional keys or change format + over time — clients should treat it as an opaque string) + + Example SSE frames: + + .. code-block:: + + event: log + data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} + + event: log + data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + + event: log + data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + + event: log + data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + + The stream remains open until the client disconnects or the server + terminates the connection. Clients should handle reconnection as needed. + + :param agent_name: The name of the hosted agent. Required. + :type agent_name: str + :param agent_version: The version of the agent. Required. + :type agent_version: str + :param session_id: The session ID (maps to an ADC sandbox). Required. + :type session_id: str + :keyword stream: Whether to stream the response. Default is True. + :paramtype stream: bool + :return: Iterator of bytes containing SSE frames + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + return cast( + Iterator[bytes], + super().get_session_log_stream( + agent_name, agent_version, session_id, stream=stream, **kwargs + ), + ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py index 859bea44b87b..176acbe51866 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_evaluation_rules.py @@ -8,10 +8,14 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Any, IO, overload +from collections.abc import MutableMapping as MutableMappingABC +from io import IOBase +from typing import Any, IO, MutableMapping, Union, cast, overload + + from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator import distributed_trace -from ._operations import EvaluationRulesOperations as GeneratedEvaluationRulesOperations, JSON +from ._operations import EvaluationRulesOperations as GeneratedEvaluationRulesOperations from .. import models as _models from ..models._enums import _FoundryFeaturesOptInKeys from ..models._patch import ( @@ -32,9 +36,14 @@ class EvaluationRulesOperations(GeneratedEvaluationRulesOperations): :attr:`evaluation_rules` attribute. """ - @overload + @overload # type: ignore[override] def create_or_update( - self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: _models.EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -53,14 +62,19 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: MutableMapping[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :type evaluation_rule: MutableMapping[str, Any] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -72,7 +86,12 @@ def create_or_update( @overload def create_or_update( - self, id: str, evaluation_rule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. @@ -91,15 +110,20 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + self, + id: str, + evaluation_rule: Union[ + _models.EvaluationRule, MutableMapping[str, Any], IO[bytes] + ], + **kwargs: Any, ) -> _models.EvaluationRule: """Create or update an evaluation rule. :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: - EvaluationRule, JSON, IO[bytes] Required. - :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or JSON or IO[bytes] + EvaluationRule, EvaluationRule, IO[bytes] Required. + :type evaluation_rule: ~azure.ai.projects.models.EvaluationRule or MutableMapping[str, Any] or IO[bytes] :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationRule :raises ~azure.core.exceptions.HttpResponseError: @@ -112,16 +136,37 @@ def create_or_update( kwargs["headers"] = { _FOUNDRY_FEATURES_HEADER_NAME: _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value } - elif not _has_header_case_insensitive(headers, _FOUNDRY_FEATURES_HEADER_NAME): - headers[_FOUNDRY_FEATURES_HEADER_NAME] = _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value + elif not _has_header_case_insensitive( + headers, _FOUNDRY_FEATURES_HEADER_NAME + ): + headers[_FOUNDRY_FEATURES_HEADER_NAME] = ( + _FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW.value + ) kwargs["headers"] = headers try: - return super().create_or_update(id, evaluation_rule, **kwargs) + # Strip service-owned fields from MutableMapping bodies before delegation + if isinstance(evaluation_rule, MutableMappingABC) and not isinstance( + evaluation_rule, (IOBase, bytes) + ): + + rule_copy = dict(evaluation_rule) + # Remove service-owned response fields per task requirements + for key in ["id", "systemData", "system_data"]: + rule_copy.pop(key, None) + return super().create_or_update(id, cast(Any, rule_copy), **kwargs) # type: ignore[arg-type] + return super().create_or_update(id, cast(Any, evaluation_rule), **kwargs) except HttpResponseError as exc: - if exc.status_code == 403 and not self._config.allow_preview and exc.model is not None: + if ( + exc.status_code == 403 + and not self._config.allow_preview + and exc.model is not None + ): api_error_response = exc.model - if hasattr(api_error_response, "error") and api_error_response.error is not None: + if ( + hasattr(api_error_response, "error") + and api_error_response.error is not None + ): if api_error_response.error.code == _PREVIEW_FEATURE_REQUIRED_CODE: new_exc = HttpResponseError( message=f"{exc.message} {_PREVIEW_FEATURE_ADDED_ERROR_MESSAGE}", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py new file mode 100644 index 000000000000..d42ca8c505e1 --- /dev/null +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/types.py @@ -0,0 +1,7297 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from ._utils.utils import FileType +from .models._enums import ( + AgentBlueprintReferenceType, + AgentEndpointAuthorizationSchemeType, + AgentKind, + ContainerNetworkPolicyParamType, + ContainerSkillType, + CustomToolParamFormatType, + DataGenerationJobOutputType, + DataGenerationJobSourceType, + DataGenerationJobType, + DatasetType, + EvaluationRuleActionType, + EvaluationTaxonomyInputType, + EvaluatorDefinitionType, + EvaluatorGenerationJobSourceType, + FunctionShellToolParamEnvironmentType, + IndexType, + InsightType, + MemoryStoreKind, + OpenApiAuthType, + OptimizationDatasetInputType, + PendingUploadType, + RecurrenceType, + RoutineActionType, + RoutineDispatchPayloadType, + RoutineTriggerType, + SampleType, + ScheduleTaskType, + TelemetryEndpointAuthType, + TelemetryEndpointKind, + TextResponseFormatConfigurationType, + ToolChoiceParamType, + ToolType, + ToolboxToolType, + TriggerType, + VersionIndicatorType, + VersionSelectorType, +) + +if TYPE_CHECKING: + from . import _unions + from .models import ( + AgentEndpointProtocol, + AttackStrategy, + AzureAISearchQueryType, + CodeDependencyResolution, + ComputerEnvironment, + ContainerMemoryLimit, + DataGenerationJobScenario, + DayOfWeek, + DimensionChangeKind, + EvaluationLevel, + EvaluationRuleEventType, + EvaluatorCategory, + EvaluatorMetricDirection, + EvaluatorMetricType, + EvaluatorType, + FoundryModelArtifactProfileCategory, + FoundryModelArtifactProfileSignal, + FoundryModelSourceType, + FoundryModelWarningCode, + FoundryModelWeightType, + GitHubIssueEvent, + GrammarSyntax1, + ImageGenAction, + InputFidelity, + JobStatus, + MemoryItemKind, + OperationState, + RankerVersionType, + ReasoningEffort, + RiskCategory, + RubricHealthConfidence, + ScheduleProvisioningStatus, + SearchContentType, + SearchContextSize, + SimpleQnAFineTuningQuestionType, + TelemetryDataKind, + TelemetryTransportProtocol, + ToolSearchExecutionType, + TreatmentEffectType, + ) + + +class _CreateAgentVersionFromCodeContent(TypedDict, total=False): + """Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and + POST /agents/{name}/versions). + + :ivar metadata: JSON metadata including description and hosted definition. Required. + :vartype metadata: "_CreateAgentVersionFromCodeMetadata" + :ivar code: The code zip file (max 250 MB). Required. + :vartype code: FileType + """ + + metadata: Required["_CreateAgentVersionFromCodeMetadata"] + """JSON metadata including description and hosted definition. Required.""" + code: Required[FileType] + """The code zip file (max 250 MB). Required.""" + + +class _CreateAgentVersionFromCodeMetadata(TypedDict, total=False): + """JSON metadata for code-based agent operations (create, update, create version). The agent name + comes from the URL path parameter or the ``x-ms-agent-name`` header, so it is not included in + this model. The content hash (SHA-256 of the zip) is carried in the ``x-ms-code-zip-sha256`` + header. + + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + :vartype metadata: dict[str, str] + :ivar definition: The hosted agent definition including code_configuration (runtime, + entry_point), cpu, memory, and protocol_versions. Required. + :vartype definition: "HostedAgentDefinition" + """ + + description: str + """A human-readable description of the agent.""" + metadata: dict[str, str] + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters.""" + definition: Required["HostedAgentDefinition"] + """The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, + and protocol_versions. Required.""" + + +class A2APreviewTool(TypedDict, total=False): + """An agent implementing the A2A protocol. + + :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. + :vartype type: Literal[ToolType.A2A_PREVIEW] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + """ + + type: Required[Literal[ToolType.A2A_PREVIEW]] + """The type of the tool. Always ``\"a2a_preview``. Required. A2A_PREVIEW.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + + +class A2APreviewToolboxTool(TypedDict, total=False): + """An A2A tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. A2A_PREVIEW. + :vartype type: Literal[ToolboxToolType.A2A_PREVIEW] + :ivar base_url: Base URL of the agent. + :vartype base_url: str + :ivar agent_card_path: The path to the agent card relative to the ``base_url``. If not + provided, defaults to ``/.well-known/agent-card.json``. + :vartype agent_card_path: str + :ivar project_connection_id: The connection ID in the project for the A2A server. The + connection stores authentication and other connection details needed to connect to the A2A + server. + :vartype project_connection_id: str + :ivar send_credentials_for_agent_card: When ``true``, Foundry sends its credentials when + fetching the remote agent's Agent Card. The service defaults to ``false`` if a value is not + specified by the caller (anonymous fetch). + :vartype send_credentials_for_agent_card: bool + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.A2A_PREVIEW]] + """Required. A2A_PREVIEW.""" + base_url: str + """Base URL of the agent.""" + agent_card_path: str + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" + project_connection_id: str + """The connection ID in the project for the A2A server. The connection stores authentication and + other connection details needed to connect to the A2A server.""" + send_credentials_for_agent_card: bool + """When ``true``, Foundry sends its credentials when fetching the remote agent's Agent Card. The + service defaults to ``false`` if a value is not specified by the caller (anonymous fetch).""" + + +class A2AProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the A2A protocol.""" + + +class ActivityProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the activity protocol. + + :ivar enable_m365_public_endpoint: Whether to enable the M365 public endpoint for the activity + protocol. + :vartype enable_m365_public_endpoint: bool + """ + + enable_m365_public_endpoint: bool + """Whether to enable the M365 public endpoint for the activity protocol.""" + + +class AgentCard(TypedDict, total=False): + """AgentCard. + + :ivar version: The version of the agent card. Required. + :vartype version: str + :ivar description: The description of the agent card. + :vartype description: str + :ivar skills: The set of skills that an agent can perform. Required. + :vartype skills: list["AgentCardSkill"] + """ + + version: Required[str] + """The version of the agent card. Required.""" + description: str + """The description of the agent card.""" + skills: Required[list["AgentCardSkill"]] + """The set of skills that an agent can perform. Required.""" + + +class AgentCardSkill(TypedDict, total=False): + """AgentCardSkill. + + :ivar id: a unique identifier for the skill. Required. + :vartype id: str + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: A description of the skill. + :vartype description: str + :ivar tags: set of tagwords describing classes of capabilities for the skill. + :vartype tags: list[str] + :ivar examples: A list of example scenarios that the skill can perform. + :vartype examples: list[str] + """ + + id: Required[str] + """a unique identifier for the skill. Required.""" + name: Required[str] + """The name of the skill. Required.""" + description: str + """A description of the skill.""" + tags: list[str] + """set of tagwords describing classes of capabilities for the skill.""" + examples: list[str] + """A list of example scenarios that the skill can perform.""" + + +class AgentClusterInsightRequest(TypedDict, total=False): + """Insights on set of Agent Evaluation Results. + + :ivar type: The type of request. Required. Cluster Insight on an Agent. + :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + :ivar agent_name: Identifier for the agent. Required. + :vartype agent_name: str + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: "InsightModelConfiguration" + """ + + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + """The type of request. Required. Cluster Insight on an Agent.""" + agentName: Required[str] + """Identifier for the agent. Required.""" + modelConfiguration: "InsightModelConfiguration" + """Configuration of the model used in the insight generation.""" + + +class AgentClusterInsightResult(TypedDict, total=False): + """Insights from the agent cluster analysis. + + :ivar type: The type of insights result. Required. Cluster Insight on an Agent. + :vartype type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + :ivar cluster_insight: Required. + :vartype cluster_insight: "ClusterInsightResult" + """ + + type: Required[Literal[InsightType.AGENT_CLUSTER_INSIGHT]] + """The type of insights result. Required. Cluster Insight on an Agent.""" + clusterInsight: Required["ClusterInsightResult"] + """Required.""" + + +class AgentDataGenerationJobSource(TypedDict, total=False): + """Agent source for data generation jobs — references an agent to fetch instructions and metadata + from. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Agent. Required. Agent source — + references an agent. + :vartype type: Literal[DataGenerationJobSourceType.AGENT] + :ivar agent_name: The agent name to fetch instructions from. Required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, the latest version is used. + :vartype agent_version: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[DataGenerationJobSourceType.AGENT]] + """The source type for this source, which is Agent. Required. Agent source — references an agent.""" + agent_name: Required[str] + """The agent name to fetch instructions from. Required.""" + agent_version: str + """The agent version. If not specified, the latest version is used.""" + + +class AgentEndpointConfig(TypedDict, total=False): + """AgentEndpointConfig. + + :ivar version_selector: The version selector of the agent endpoint determines how traffic is + routed to different versions of the agent. + :vartype version_selector: "VersionSelector" + :ivar protocol_configuration: Per-protocol configuration for the agent endpoint. + :vartype protocol_configuration: "ProtocolConfiguration" + :ivar authorization_schemes: The authorization schemes supported by the agent endpoint. + :vartype authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """ + + version_selector: "VersionSelector" + """The version selector of the agent endpoint determines how traffic is routed to different + versions of the agent.""" + protocol_configuration: "ProtocolConfiguration" + """Per-protocol configuration for the agent endpoint.""" + authorization_schemes: list["AgentEndpointAuthorizationScheme"] + """The authorization schemes supported by the agent endpoint.""" + + +class AgentEvaluatorGenerationJobSource(TypedDict, total=False): + """Agent source for evaluator generation jobs — references an agent to fetch instructions and + metadata from. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Agent. Required. Agent source — + references an agent to fetch instructions and metadata from. + :vartype type: Literal[EvaluatorGenerationJobSourceType.AGENT] + :ivar agent_name: The agent name to fetch instructions from. Required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, the latest version is used. + :vartype agent_version: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[EvaluatorGenerationJobSourceType.AGENT]] + """The source type for this source, which is Agent. Required. Agent source — references an agent + to fetch instructions and metadata from.""" + agent_name: Required[str] + """The agent name to fetch instructions from. Required.""" + agent_version: str + """The agent version. If not specified, the latest version is used.""" + + +class AgentTaxonomyInput(TypedDict, total=False): + """Input configuration for the evaluation taxonomy when the input type is agent. + + :ivar type: Input type of the evaluation taxonomy. Required. Agent. + :vartype type: Literal[EvaluationTaxonomyInputType.AGENT] + :ivar target: Target configuration for the agent. Required. + :vartype target: "EvaluationTarget" + :ivar risk_categories: List of risk categories to evaluate against. Required. + :vartype risk_categories: list[Union[str, "RiskCategory"]] + """ + + type: Required[Literal[EvaluationTaxonomyInputType.AGENT]] + """Input type of the evaluation taxonomy. Required. Agent.""" + target: Required["EvaluationTarget"] + """Target configuration for the agent. Required.""" + riskCategories: Required[list[Union[str, "RiskCategory"]]] + """List of risk categories to evaluate against. Required.""" + + +class AISearchIndexResource(TypedDict, total=False): + """A AI Search Index resource. + + :ivar project_connection_id: An index connection ID in an IndexResource attached to this agent. + :vartype project_connection_id: str + :ivar index_name: The name of an index in an IndexResource attached to this agent. + :vartype index_name: str + :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: + "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". + :vartype query_type: Union[str, "AzureAISearchQueryType"] + :ivar top_k: Number of documents to retrieve from search and present to the model. + :vartype top_k: int + :ivar filter: filter string for search resource. `Learn more here + `_. + :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str + """ + + project_connection_id: str + """An index connection ID in an IndexResource attached to this agent.""" + index_name: str + """The name of an index in an IndexResource attached to this agent.""" + query_type: Union[str, "AzureAISearchQueryType"] + """Type of query in an AIIndexResource attached to this agent. Known values are: \"simple\", + \"semantic\", \"vector\", \"vector_simple_hybrid\", and \"vector_semantic_hybrid\".""" + top_k: int + """Number of documents to retrieve from search and present to the model.""" + filter: str + """filter string for search resource. `Learn more here + `_.""" + index_asset_id: str + """Index asset id for search resource.""" + + +class ApiError(TypedDict, total=False): + """ApiError. + + :ivar code: Required. + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str + :ivar type: + :vartype type: str + :ivar details: + :vartype details: list["ApiError"] + :ivar additional_info: + :vartype additional_info: dict[str, Any] + :ivar debug_info: + :vartype debug_info: dict[str, Any] + """ + + code: Required[Optional[str]] + """Required.""" + message: Required[str] + """Required.""" + param: Optional[str] + type: str + details: list["ApiError"] + additionalInfo: dict[str, Any] + debugInfo: dict[str, Any] + + +class ApplyPatchToolParam(TypedDict, total=False): + """Apply patch tool. + + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: Literal[ToolType.APPLY_PATCH] + """ + + type: Required[Literal[ToolType.APPLY_PATCH]] + """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" + + +class ApproximateLocation(TypedDict, total=False): + """ApproximateLocation. + + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: Literal["approximate"] + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str + """ + + type: Required[Literal["approximate"]] + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] + region: Optional[str] + city: Optional[str] + timezone: Optional[str] + + +class ArtifactProfile(TypedDict, total=False): + """Artifact profile of the model. + + :ivar category: The category of the artifact profile. Required. Known values are: "DataOnly", + "RuntimeDependent", and "Unknown". + :vartype category: Union[str, "FoundryModelArtifactProfileCategory"] + :ivar signals: Signals detected in the model artifact. + :vartype signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] + """ + + category: Required[Union[str, "FoundryModelArtifactProfileCategory"]] + """The category of the artifact profile. Required. Known values are: \"DataOnly\", + \"RuntimeDependent\", and \"Unknown\".""" + signals: list[Union[str, "FoundryModelArtifactProfileSignal"]] + """Signals detected in the model artifact.""" + + +class AutoCodeInterpreterToolParam(TypedDict, total=False): + """Automatic Code Interpreter Tool Parameters. + + :ivar type: Always ``auto``. Required. Default value is "auto". + :vartype type: Literal["auto"] + :ivar file_ids: An optional list of uploaded files to make available to your code. + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: Union[str, "ContainerMemoryLimit"] + :ivar network_policy: + :vartype network_policy: "ContainerNetworkPolicyParam" + """ + + type: Required[Literal["auto"]] + """Always ``auto``. Required. Default value is \"auto\".""" + file_ids: list[str] + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + network_policy: "ContainerNetworkPolicyParam" + + +class AzureAIAgentTarget(TypedDict, total=False): + """Represents a target specifying an Azure AI agent. + + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". + :vartype type: Literal["azure_ai_agent"] + :ivar name: The unique identifier of the Azure AI agent. Required. + :vartype name: str + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list["ToolDescription"] + :ivar tools: + :vartype tools: list["Tool"] + """ + + type: Required[Literal["azure_ai_agent"]] + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" + name: Required[str] + """The unique identifier of the Azure AI agent. Required.""" + version: str + """The version of the Azure AI agent.""" + tool_descriptions: list["ToolDescription"] + """The parameters used to control the sampling behavior of the agent during text generation.""" + tools: list["Tool"] + + +class AzureAIModelTarget(TypedDict, total=False): + """Represents a target specifying an Azure AI model for operations requiring model selection. + + :ivar type: The type of target, always ``azure_ai_model``. Required. Default value is + "azure_ai_model". + :vartype type: Literal["azure_ai_model"] + :ivar model: The unique identifier of the Azure AI model. + :vartype model: str + :ivar sampling_params: The parameters used to control the sampling behavior of the model during + text generation. + :vartype sampling_params: "ModelSamplingParams" + """ + + type: Required[Literal["azure_ai_model"]] + """The type of target, always ``azure_ai_model``. Required. Default value is \"azure_ai_model\".""" + model: str + """The unique identifier of the Azure AI model.""" + sampling_params: "ModelSamplingParams" + """The parameters used to control the sampling behavior of the model during text generation.""" + + +class AzureAISearchIndex(TypedDict, total=False): + """Azure AI Search Index Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Azure search. + :vartype type: Literal[IndexType.AZURE_SEARCH] + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: "FieldMapping" + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.AZURE_SEARCH]] + """Type of index. Required. Azure search.""" + connectionName: Required[str] + """Name of connection to Azure AI Search. Required.""" + indexName: Required[str] + """Name of index in Azure AI Search resource to attach. Required.""" + fieldMapping: "FieldMapping" + """Field mapping configuration.""" + + +class AzureAISearchTool(TypedDict, total=False): + """The input definition information for an Azure AI search tool as used to configure an agent. + + :ivar type: The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH. + :vartype type: Literal[ToolType.AZURE_AI_SEARCH] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: "AzureAISearchToolResource" + """ + + type: Required[Literal[ToolType.AZURE_AI_SEARCH]] + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_ai_search: Required["AzureAISearchToolResource"] + """The azure ai search index resource. Required.""" + + +class AzureAISearchToolboxTool(TypedDict, total=False): + """An Azure AI Search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. AZURE_AI_SEARCH. + :vartype type: Literal[ToolboxToolType.AZURE_AI_SEARCH] + :ivar azure_ai_search: The azure ai search index resource. Required. + :vartype azure_ai_search: "AzureAISearchToolResource" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.AZURE_AI_SEARCH]] + """Required. AZURE_AI_SEARCH.""" + azure_ai_search: Required["AzureAISearchToolResource"] + """The azure ai search index resource. Required.""" + + +class AzureAISearchToolResource(TypedDict, total=False): + """A set of index resources used by the ``azure_ai_search`` tool. + + :ivar indexes: The indices attached to this agent. There can be a maximum of 1 index resource + attached to the agent. Required. + :vartype indexes: list["AISearchIndexResource"] + """ + + indexes: Required[list["AISearchIndexResource"]] + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" + + +class AzureFunctionBinding(TypedDict, total=False): + """The structure for keeping storage queue name and URI. + + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". + :vartype type: Literal["storage_queue"] + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: "AzureFunctionStorageQueue" + """ + + type: Required[Literal["storage_queue"]] + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: Required["AzureFunctionStorageQueue"] + """Storage queue. Required.""" + + +class AzureFunctionDefinition(TypedDict, total=False): + """The definition of Azure function. + + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: "AzureFunctionDefinitionFunction" + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: "AzureFunctionBinding" + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: "AzureFunctionBinding" + """ + + function: Required["AzureFunctionDefinitionFunction"] + """The definition of azure function and its parameters. Required.""" + input_binding: Required["AzureFunctionBinding"] + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: Required["AzureFunctionBinding"] + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" + + +class AzureFunctionDefinitionFunction(TypedDict, total=False): + """AzureFunctionDefinitionFunction. + + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: dict[str, Any] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Required[dict[str, Any]] + """The parameters the functions accepts, described as a JSON Schema object. Required.""" + + +class AzureFunctionStorageQueue(TypedDict, total=False): + """The structure for keeping storage queue name and URI. + + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str + """ + + queue_service_endpoint: Required[str] + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: Required[str] + """The name of an Azure function storage queue. Required.""" + + +class AzureFunctionTool(TypedDict, total=False): + """The input definition information for an Azure Function Tool, as used to configure an Agent. + + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. + :vartype type: Literal[ToolType.AZURE_FUNCTION] + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar azure_function: The Azure Function Tool definition. Required. + :vartype azure_function: "AzureFunctionDefinition" + """ + + type: Required[Literal[ToolType.AZURE_FUNCTION]] + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + azure_function: Required["AzureFunctionDefinition"] + """The Azure Function Tool definition. Required.""" + + +class AzureOpenAIModelConfiguration(TypedDict, total=False): + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. + + :ivar type: Required. Default value is "AzureOpenAIModel". + :vartype type: Literal["AzureOpenAIModel"] + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype model_deployment_name: str + """ + + type: Required[Literal["AzureOpenAIModel"]] + """Required. Default value is \"AzureOpenAIModel\".""" + modelDeploymentName: Required[str] + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + + +class BingCustomSearchConfiguration(TypedDict, total=False): + """A bing custom search configuration. + + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing search. Required.""" + instance_name: Required[str] + """Name of the custom configuration instance given to config. Required.""" + market: str + """The market where the results come from.""" + set_lang: str + """The language to use for user interface strings when calling Bing API.""" + count: int + """The number of search results to return in the bing api response.""" + freshness: str + """Filter search results by a specific time range. See `accepted values here + `_.""" + + +class BingCustomSearchPreviewTool(TypedDict, total=False): + """The input definition information for a Bing custom search tool as used to configure an agent. + + :ivar type: The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW. + :vartype type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. + :vartype bing_custom_search_preview: "BingCustomSearchToolParameters" + """ + + type: Required[Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW]] + """The object type, which is always 'bing_custom_search_preview'. Required. + BING_CUSTOM_SEARCH_PREVIEW.""" + bing_custom_search_preview: Required["BingCustomSearchToolParameters"] + """The bing custom search tool parameters. Required.""" + + +class BingCustomSearchToolParameters(TypedDict, total=False): + """The bing custom search tool parameters. + + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. Required. + :vartype search_configurations: list["BingCustomSearchConfiguration"] + """ + + search_configurations: Required[list["BingCustomSearchConfiguration"]] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" + + +class BingGroundingSearchConfiguration(TypedDict, total=False): + """Search configuration for Bing Grounding. + + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing search. Required.""" + market: str + """The market where the results come from.""" + set_lang: str + """The language to use for user interface strings when calling Bing API.""" + count: int + """The number of search results to return in the bing api response.""" + freshness: str + """Filter search results by a specific time range. See `accepted values here + `_.""" + + +class BingGroundingSearchToolParameters(TypedDict, total=False): + """The bing grounding search tool parameters. + + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 search configuration resource attached to the tool. Required. + :vartype search_configurations: list["BingGroundingSearchConfiguration"] + """ + + search_configurations: Required[list["BingGroundingSearchConfiguration"]] + """The search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" + + +class BingGroundingTool(TypedDict, total=False): + """The input definition information for a bing grounding search tool as used to configure an + agent. + + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. + :vartype type: Literal[ToolType.BING_GROUNDING] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: "BingGroundingSearchToolParameters" + """ + + type: Required[Literal[ToolType.BING_GROUNDING]] + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + bing_grounding: Required["BingGroundingSearchToolParameters"] + """The bing grounding search tool parameters. Required.""" + + +class BotServiceAuthorizationScheme(TypedDict, total=False): + """BotServiceAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE]] + """Required. BOT_SERVICE.""" + + +class BotServiceRbacAuthorizationScheme(TypedDict, total=False): + """BotServiceRbacAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_RBAC. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC]] + """Required. BOT_SERVICE_RBAC.""" + + +class BotServiceTenantAuthorizationScheme(TypedDict, total=False): + """BotServiceTenantAuthorizationScheme. + + :ivar type: Required. BOT_SERVICE_TENANT. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_TENANT]] + """Required. BOT_SERVICE_TENANT.""" + + +class BrowserAutomationPreviewTool(TypedDict, total=False): + """The input definition information for a Browser Automation Tool, as used to configure an Agent. + + :ivar type: The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW. + :vartype type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: "BrowserAutomationToolParameters" + """ + + type: Required[Literal[ToolType.BROWSER_AUTOMATION_PREVIEW]] + """The object type, which is always 'browser_automation_preview'. Required. + BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: Required["BrowserAutomationToolParameters"] + """The Browser Automation Tool parameters. Required.""" + + +class BrowserAutomationPreviewToolboxTool(TypedDict, total=False): + """A browser automation tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. BROWSER_AUTOMATION_PREVIEW. + :vartype type: Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW] + :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. + :vartype browser_automation_preview: "BrowserAutomationToolParameters" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.BROWSER_AUTOMATION_PREVIEW]] + """Required. BROWSER_AUTOMATION_PREVIEW.""" + browser_automation_preview: Required["BrowserAutomationToolParameters"] + """The Browser Automation Tool parameters. Required.""" + + +class BrowserAutomationToolConnectionParameters(TypedDict, total=False): # pylint: disable=name-too-long + """Definition of input parameters for the connection used by the Browser Automation Tool. + + :ivar project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str + """ + + project_connection_id: Required[str] + """The ID of the project connection to your Azure Playwright resource. Required.""" + + +class BrowserAutomationToolParameters(TypedDict, total=False): + """Definition of input parameters for the Browser Automation Tool. + + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: "BrowserAutomationToolConnectionParameters" + """ + + connection: Required["BrowserAutomationToolConnectionParameters"] + """The project connection parameters associated with the Browser Automation Tool. Required.""" + + +class CaptureStructuredOutputsTool(TypedDict, total=False): + """A tool for capturing structured outputs. + + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS. + :vartype type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar outputs: The structured outputs to capture from the model. Required. + :vartype outputs: "StructuredOutputDefinition" + """ + + type: Required[Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS]] + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + outputs: Required["StructuredOutputDefinition"] + """The structured outputs to capture from the model. Required.""" + + +class ChartCoordinate(TypedDict, total=False): + """Coordinates for the analysis chart. + + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: int + """ + + x: Required[int] + """X-axis coordinate. Required.""" + y: Required[int] + """Y-axis coordinate. Required.""" + size: Required[int] + """Size of the chart element. Required.""" + + +class ClusterInsightResult(TypedDict, total=False): + """Insights from the cluster analysis. + + :ivar summary: Summary of the insights report. Required. + :vartype summary: "InsightSummary" + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list["InsightCluster"] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, "ChartCoordinate"] + """ + + summary: Required["InsightSummary"] + """Summary of the insights report. Required.""" + clusters: Required[list["InsightCluster"]] + """List of clusters identified in the insights. Required.""" + coordinates: dict[str, "ChartCoordinate"] + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" + + +class ClusterTokenUsage(TypedDict, total=False): + """Token usage for cluster analysis. + + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int + """ + + inputTokenUsage: Required[int] + """input token usage. Required.""" + outputTokenUsage: Required[int] + """output token usage. Required.""" + totalTokenUsage: Required[int] + """total token usage. Required.""" + + +class CodeBasedEvaluatorDefinition(TypedDict, total=False): + """Code-based evaluator definition using python code. + + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, Any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, Any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, "EvaluatorMetric"] + :ivar type: Required. Code-based definition. + :vartype type: Literal[EvaluatorDefinitionType.CODE] + :ivar code_text: Inline code text for the evaluator. + :vartype code_text: str + :ivar entry_point: The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py'). + :vartype entry_point: str + :ivar image_tag: The container image tag to use for evaluator code execution. + :vartype image_tag: str + :ivar blob_uri: The blob URI for the evaluator storage. + :vartype blob_uri: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.CODE]] + """Required. Code-based definition.""" + code_text: str + """Inline code text for the evaluator.""" + entry_point: str + """The entry point Python file name for the uploaded evaluator code (e.g. + 'answer_length_evaluator.py').""" + image_tag: str + """The container image tag to use for evaluator code execution.""" + blob_uri: str + """The blob URI for the evaluator storage.""" + + +class CodeConfiguration(TypedDict, total=False): + """Code-based deployment configuration for a hosted agent. + + :ivar runtime: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', + 'python_3_13'). Required. + :vartype runtime: str + :ivar entry_point: The entry point command and arguments for the code execution. Required. + :vartype entry_point: list[str] + :ivar dependency_resolution: How package dependencies are resolved at deployment time. Defaults + to ``bundled``, where the caller bundles all dependencies into the uploaded zip and the service + performs no remote build. ``remote_build`` instructs the service to build dependencies remotely + from the manifest included in the uploaded zip. Required. Known values are: "bundled" and + "remote_build". + :vartype dependency_resolution: Union[str, "CodeDependencyResolution"] + :ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from + the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in + request payloads. + :vartype content_hash: str + """ + + runtime: Required[str] + """The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13'). + Required.""" + entry_point: Required[list[str]] + """The entry point command and arguments for the code execution. Required.""" + dependency_resolution: Required[Union[str, "CodeDependencyResolution"]] + """How package dependencies are resolved at deployment time. Defaults to ``bundled``, where the + caller bundles all dependencies into the uploaded zip and the service performs no remote build. + ``remote_build`` instructs the service to build dependencies remotely from the manifest + included in the uploaded zip. Required. Known values are: \"bundled\" and \"remote_build\".""" + content_hash: str + """The SHA-256 hex digest of the uploaded code zip. Set by the service from the + ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request + payloads.""" + + +class CodeInterpreterTool(TypedDict, total=False): + """Code interpreter. + + :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + CODE_INTERPRETER. + :vartype type: Literal[ToolType.CODE_INTERPRETER] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar container: The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an optional + ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a + AutoCodeInterpreterToolParam type. + :vartype container: Union[str, "AutoCodeInterpreterToolParam"] + """ + + type: Required[Literal[ToolType.CODE_INTERPRETER]] + """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + container: Union[str, "AutoCodeInterpreterToolParam"] + """The code interpreter container. Can be a container ID or an object that specifies uploaded file + IDs to make available to your code, along with an optional ``memory_limit`` setting. If not + provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam + type.""" + + +class CodeInterpreterToolboxTool(TypedDict, total=False): + """A code interpreter tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. CODE_INTERPRETER. + :vartype type: Literal[ToolboxToolType.CODE_INTERPRETER] + :ivar container: The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an optional + ``memory_limit`` setting. If not provided, the service assumes auto. Is either a str type or a + AutoCodeInterpreterToolParam type. + :vartype container: Union[str, "AutoCodeInterpreterToolParam"] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.CODE_INTERPRETER]] + """Required. CODE_INTERPRETER.""" + container: Union[str, "AutoCodeInterpreterToolParam"] + """The code interpreter container. Can be a container ID or an object that specifies uploaded file + IDs to make available to your code, along with an optional ``memory_limit`` setting. If not + provided, the service assumes auto. Is either a str type or a AutoCodeInterpreterToolParam + type.""" + + +class ComparisonFilter(TypedDict, total=False): + """Comparison Filter. + + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], + Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] + :vartype type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] + :ivar key: The key to compare against the value. Required. + :vartype key: str + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, [Union[str, float]] + :vartype value: Union[str, float, bool, list[Union[str, float]]] + """ + + type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]] + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal[\"eq\"], + Literal[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"], + Literal[\"in\"], Literal[\"nin\"]""" + key: Required[str] + """The key to compare against the value. Required.""" + value: Required[Union[str, float, bool, list[Union[str, float]]]] + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, [Union[str, float]]""" + + +class CompoundFilter(TypedDict, total=False): + """Compound Filter. + + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :vartype type: Literal["and", "or"] + :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or + ``CompoundFilter``. Required. + :vartype filters: list[Union["ComparisonFilter", Any]] + """ + + type: Required[Literal["and", "or"]] + """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a + Literal[\"or\"] type.""" + filters: Required[list[Union["ComparisonFilter", Any]]] + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + + +class ComputerTool(TypedDict, total=False): + """Computer. + + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: Literal[ToolType.COMPUTER] + """ + + type: Required[Literal[ToolType.COMPUTER]] + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" + + +class ComputerUsePreviewTool(TypedDict, total=False): + """Computer use preview. + + :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW. + :vartype type: Literal[ToolType.COMPUTER_USE_PREVIEW] + :ivar environment: The type of computer environment to control. Required. Known values are: + "windows", "mac", "linux", "ubuntu", and "browser". + :vartype environment: Union[str, "ComputerEnvironment"] + :ivar display_width: The width of the computer display. Required. + :vartype display_width: int + :ivar display_height: The height of the computer display. Required. + :vartype display_height: int + """ + + type: Required[Literal[ToolType.COMPUTER_USE_PREVIEW]] + """The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW.""" + environment: Required[Union[str, "ComputerEnvironment"]] + """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", + \"linux\", \"ubuntu\", and \"browser\".""" + display_width: Required[int] + """The width of the computer display. Required.""" + display_height: Required[int] + """The height of the computer display. Required.""" + + +class ContainerAutoParam(TypedDict, total=False): + """ContainerAutoParam. + + :ivar type: Automatically creates a container for this request. Required. CONTAINER_AUTO. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + :ivar file_ids: An optional list of uploaded files to make available to your code. + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: Union[str, "ContainerMemoryLimit"] + :ivar skills: An optional list of skills referenced by id or inline data. + :vartype skills: list["ContainerSkill"] + :ivar network_policy: + :vartype network_policy: "ContainerNetworkPolicyParam" + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO]] + """Automatically creates a container for this request. Required. CONTAINER_AUTO.""" + file_ids: list[str] + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "ContainerMemoryLimit"]] + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" + skills: list["ContainerSkill"] + """An optional list of skills referenced by id or inline data.""" + network_policy: "ContainerNetworkPolicyParam" + + +class ContainerConfiguration(TypedDict, total=False): + """Container-based deployment configuration for a hosted agent. + + :ivar image: The container image for the hosted agent. Required. + :vartype image: str + """ + + image: Required[str] + """The container image for the hosted agent. Required.""" + + +class ContainerNetworkPolicyAllowlistParam(TypedDict, total=False): + """ContainerNetworkPolicyAllowlistParam. + + :ivar type: Allow outbound network access only to specified domains. Always ``allowlist``. + Required. ALLOWLIST. + :vartype type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + :ivar allowed_domains: A list of allowed domains when type is ``allowlist``. Required. + :vartype allowed_domains: list[str] + :ivar domain_secrets: Optional domain-scoped secrets for allowlisted domains. + :vartype domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] + """ + + type: Required[Literal[ContainerNetworkPolicyParamType.ALLOWLIST]] + """Allow outbound network access only to specified domains. Always ``allowlist``. Required. + ALLOWLIST.""" + allowed_domains: Required[list[str]] + """A list of allowed domains when type is ``allowlist``. Required.""" + domain_secrets: list["ContainerNetworkPolicyDomainSecretParam"] + """Optional domain-scoped secrets for allowlisted domains.""" + + +class ContainerNetworkPolicyDisabledParam(TypedDict, total=False): + """ContainerNetworkPolicyDisabledParam. + + :ivar type: Disable outbound network access. Always ``disabled``. Required. DISABLED. + :vartype type: Literal[ContainerNetworkPolicyParamType.DISABLED] + """ + + type: Required[Literal[ContainerNetworkPolicyParamType.DISABLED]] + """Disable outbound network access. Always ``disabled``. Required. DISABLED.""" + + +class ContainerNetworkPolicyDomainSecretParam(TypedDict, total=False): + """ContainerNetworkPolicyDomainSecretParam. + + :ivar domain: The domain associated with the secret. Required. + :vartype domain: str + :ivar name: The name of the secret to inject for the domain. Required. + :vartype name: str + :ivar value: The secret value to inject for the domain. Required. + :vartype value: str + """ + + domain: Required[str] + """The domain associated with the secret. Required.""" + name: Required[str] + """The name of the secret to inject for the domain. Required.""" + value: Required[str] + """The secret value to inject for the domain. Required.""" + + +class ContinuousEvaluationRuleAction(TypedDict, total=False): + """Evaluation rule action for continuous evaluation. + + :ivar type: Required. Continuous evaluation. + :vartype type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int + :ivar sampling_rate: Percentage (0-100] chance that a matching event triggers an evaluation. + When omitted, the service-default is to evaluate every event, which is equivalent to setting a + sampling rate of 100. + :vartype sampling_rate: float + """ + + type: Required[Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION]] + """Required. Continuous evaluation.""" + evalId: Required[str] + """Eval Id to add continuous evaluation runs to. Required.""" + maxHourlyRuns: int + """Maximum number of evaluation runs allowed per hour.""" + samplingRate: float + """Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the + service-default is to evaluate every event, which is equivalent to setting a sampling rate of + 100.""" + + +class CosmosDBIndex(TypedDict, total=False): + """CosmosDB Vector Store Index Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. CosmosDB. + :vartype type: Literal[IndexType.COSMOS_DB] + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: "EmbeddingConfiguration" + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: "FieldMapping" + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.COSMOS_DB]] + """Type of index. Required. CosmosDB.""" + connectionName: Required[str] + """Name of connection to CosmosDB. Required.""" + databaseName: Required[str] + """Name of the CosmosDB Database. Required.""" + containerName: Required[str] + """Name of CosmosDB Container. Required.""" + embeddingConfiguration: Required["EmbeddingConfiguration"] + """Embedding model configuration. Required.""" + fieldMapping: Required["FieldMapping"] + """Field mapping configuration. Required.""" + + +class CreateSkillVersionFromFilesBody(TypedDict, total=False): + """Multipart request body for creating a skill version from files. Accepts either a single zip + file or multiple individual skill files (directory upload). For zip uploads, the server + extracts and validates contents. For directory uploads, files are validated as-is. + + :ivar files: Skill files to upload. Upload a single zip file or multiple individual files with + relative paths. Required. + :vartype files: list[FileType] + :ivar default: Whether to set this version as the default. Defaults to false. + :vartype default: bool + """ + + files: Required[list[FileType]] + """Skill files to upload. Upload a single zip file or multiple individual files with relative + paths. Required.""" + default: bool + """Whether to set this version as the default. Defaults to false.""" + + +class CronTrigger(TypedDict, total=False): + """Cron based trigger. + + :ivar type: Required. Cron based trigger. + :vartype type: Literal[TriggerType.CRON] + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: str + """ + + type: Required[Literal[TriggerType.CRON]] + """Required. Cron based trigger.""" + expression: Required[str] + """Cron expression that defines the schedule frequency. Required.""" + timeZone: str + """Time zone for the cron schedule. Defaults to ``UTC``.""" + startTime: str + """Start time for the cron schedule in ISO 8601 format.""" + endTime: str + """End time for the cron schedule in ISO 8601 format.""" + + +class CustomGrammarFormatParam(TypedDict, total=False): + """Grammar format. + + :ivar type: Grammar format. Always ``grammar``. Required. GRAMMAR. + :vartype type: Literal[CustomToolParamFormatType.GRAMMAR] + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: Union[str, "GrammarSyntax1"] + :ivar definition: The grammar definition. Required. + :vartype definition: str + """ + + type: Required[Literal[CustomToolParamFormatType.GRAMMAR]] + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" + syntax: Required[Union[str, "GrammarSyntax1"]] + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: Required[str] + """The grammar definition. Required.""" + + +class CustomRoutineTrigger(TypedDict, total=False): + """A custom event routine trigger. + + :ivar type: The trigger type. Required. A custom event trigger. + :vartype type: Literal[RoutineTriggerType.CUSTOM] + :ivar provider: The external provider that emits the custom event. Required. + :vartype provider: str + :ivar event_name: The provider-specific event name that fires the routine. + :vartype event_name: str + :ivar parameters: Provider-specific trigger parameters. Required. + :vartype parameters: dict[str, Any] + """ + + type: Required[Literal[RoutineTriggerType.CUSTOM]] + """The trigger type. Required. A custom event trigger.""" + provider: Required[str] + """The external provider that emits the custom event. Required.""" + event_name: str + """The provider-specific event name that fires the routine.""" + parameters: Required[dict[str, Any]] + """Provider-specific trigger parameters. Required.""" + + +class CustomTextFormatParam(TypedDict, total=False): + """Text format. + + :ivar type: Unconstrained text format. Always ``text``. Required. TEXT. + :vartype type: Literal[CustomToolParamFormatType.TEXT] + """ + + type: Required[Literal[CustomToolParamFormatType.TEXT]] + """Unconstrained text format. Always ``text``. Required. TEXT.""" + + +class CustomToolParam(TypedDict, total=False): + """Custom tool. + + :ivar type: The type of the custom tool. Always ``custom``. Required. CUSTOM. + :vartype type: Literal[ToolType.CUSTOM] + :ivar name: The name of the custom tool, used to identify it in tool calls. Required. + :vartype name: str + :ivar description: Optional description of the custom tool, used to provide more context. + :vartype description: str + :ivar format: The input format for the custom tool. Default is unconstrained text. + :vartype format: "CustomToolParamFormat" + :ivar defer_loading: Whether this tool should be deferred and discovered via tool search. + :vartype defer_loading: bool + """ + + type: Required[Literal[ToolType.CUSTOM]] + """The type of the custom tool. Always ``custom``. Required. CUSTOM.""" + name: Required[str] + """The name of the custom tool, used to identify it in tool calls. Required.""" + description: str + """Optional description of the custom tool, used to provide more context.""" + format: "CustomToolParamFormat" + """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: bool + """Whether this tool should be deferred and discovered via tool search.""" + + +class DailyRecurrenceSchedule(TypedDict, total=False): + """Daily recurrence schedule. + + :ivar type: Daily recurrence type. Required. Daily recurrence pattern. + :vartype type: Literal[RecurrenceType.DAILY] + :ivar hours: Hours for the recurrence schedule. Required. + :vartype hours: list[int] + """ + + type: Required[Literal[RecurrenceType.DAILY]] + """Daily recurrence type. Required. Daily recurrence pattern.""" + hours: Required[list[int]] + """Hours for the recurrence schedule. Required.""" + + +class DataGenerationJob(TypedDict, total=False): + """Data Generation Job resource. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "DataGenerationJobInputs" + :ivar result: Result produced on success. + :vartype result: "DataGenerationJobResult" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: int + :ivar finished_at: The timestamp when the job was finished, represented in Unix time (seconds + since January 1, 1970). + :vartype finished_at: int + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "DataGenerationJobInputs" + """Caller-supplied inputs.""" + result: "DataGenerationJobResult" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: int + """The timestamp when the job was finished, represented in Unix time (seconds since January 1, + 1970).""" + + +class DataGenerationJobInputs(TypedDict, total=False): + """Caller-supplied inputs for a data generation job. + + :ivar name: The display name of the data generation job. Required. + :vartype name: str + :ivar sources: The sources used for the data generation job. Required. + :vartype sources: list["DataGenerationJobSource"] + :ivar options: The options for the data generation job. Required. + :vartype options: "DataGenerationJobOptions" + :ivar scenario: The scenario of the data generation job. Either for fine-tuning or evaluation. + Required. Known values are: "supervised_finetuning", "reinforcement_finetuning", and + "evaluation". + :vartype scenario: Union[str, "DataGenerationJobScenario"] + :ivar output_options: Optional caller-supplied metadata for the job's output. See individual + fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs + (evaluation scenario), or both. + :vartype output_options: "DataGenerationJobOutputOptions" + """ + + name: Required[str] + """The display name of the data generation job. Required.""" + sources: Required[list["DataGenerationJobSource"]] + """The sources used for the data generation job. Required.""" + options: Required["DataGenerationJobOptions"] + """The options for the data generation job. Required.""" + scenario: Required[Union[str, "DataGenerationJobScenario"]] + """The scenario of the data generation job. Either for fine-tuning or evaluation. Required. Known + values are: \"supervised_finetuning\", \"reinforcement_finetuning\", and \"evaluation\".""" + output_options: "DataGenerationJobOutputOptions" + """Optional caller-supplied metadata for the job's output. See individual fields for whether they + apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.""" + + +class DataGenerationJobOutputOptions(TypedDict, total=False): + """Output options for data generation job. + + :ivar name: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + :vartype name: str + :ivar description: Description to assign to the output. Applies only to dataset outputs + (evaluation scenario); ignored for Azure OpenAI file outputs. + :vartype description: str + :ivar tags: Tags to assign to the output. Applies only to dataset outputs (evaluation + scenario); ignored for Azure OpenAI file outputs. + :vartype tags: dict[str, str] + """ + + name: str + """Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning + scenarios) and as the dataset name for dataset outputs (evaluation scenario).""" + description: str + """Description to assign to the output. Applies only to dataset outputs (evaluation scenario); + ignored for Azure OpenAI file outputs.""" + tags: dict[str, str] + """Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored + for Azure OpenAI file outputs.""" + + +class DataGenerationJobResult(TypedDict, total=False): + """Result produced by a successful data generation job. + + :ivar outputs: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for + evaluation. + :vartype outputs: list["DataGenerationJobOutput"] + :ivar generated_samples: The number of samples actually generated. Required. + :vartype generated_samples: int + :ivar token_usage: The token usage information for the data generation job. + :vartype token_usage: "DataGenerationTokenUsage" + """ + + outputs: list["DataGenerationJobOutput"] + """The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.""" + generated_samples: Required[int] + """The number of samples actually generated. Required.""" + token_usage: "DataGenerationTokenUsage" + """The token usage information for the data generation job.""" + + +class DataGenerationModelOptions(TypedDict, total=False): + """LLM model options for data generation jobs. + + :ivar model: Base model name used to generate data. Required. + :vartype model: str + """ + + model: Required[str] + """Base model name used to generate data. Required.""" + + +class DataGenerationTokenUsage(TypedDict, total=False): + """Token usage information for a data generation job. + + :ivar prompt_tokens: The number of prompt tokens used. Required. + :vartype prompt_tokens: int + :ivar completion_tokens: The number of completion tokens generated. Required. + :vartype completion_tokens: int + :ivar total_tokens: Total number of tokens used. Required. + :vartype total_tokens: int + """ + + prompt_tokens: Required[int] + """The number of prompt tokens used. Required.""" + completion_tokens: Required[int] + """The number of completion tokens generated. Required.""" + total_tokens: Required[int] + """Total number of tokens used. Required.""" + + +class DatasetDataGenerationJobOutput(TypedDict, total=False): + """Dataset output for a data generation job. + + :ivar type: Dataset output. Required. The generated data is a Dataset. + :vartype type: Literal[DataGenerationJobOutputType.DATASET] + :ivar id: The id of the output dataset created. + :vartype id: str + :ivar name: The name of the output dataset. + :vartype name: str + :ivar version: The version of the output dataset. + :vartype version: str + :ivar description: Description of the output dataset. + :vartype description: str + :ivar tags: Tag dictionary of the output dataset. + :vartype tags: dict[str, str] + """ + + type: Required[Literal[DataGenerationJobOutputType.DATASET]] + """Dataset output. Required. The generated data is a Dataset.""" + id: str + """The id of the output dataset created.""" + name: str + """The name of the output dataset.""" + version: str + """The version of the output dataset.""" + description: str + """Description of the output dataset.""" + tags: dict[str, str] + """Tag dictionary of the output dataset.""" + + +class DatasetEvaluatorGenerationJobSource(TypedDict, total=False): + """Dataset source for evaluator generation jobs — reference to a dataset. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Dataset. Required. Dataset source — + reference to a dataset. + :vartype type: Literal[EvaluatorGenerationJobSourceType.DATASET] + :ivar name: The name of the dataset. Required. + :vartype name: str + :ivar version: The version of the dataset. If not specified, the latest version is used. + :vartype version: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[EvaluatorGenerationJobSourceType.DATASET]] + """The source type for this source, which is Dataset. Required. Dataset source — reference to a + dataset.""" + name: Required[str] + """The name of the dataset. Required.""" + version: str + """The version of the dataset. If not specified, the latest version is used.""" + + +class DatasetReference(TypedDict, total=False): + """Reference to a versioned Foundry Dataset. + + :ivar name: Dataset name. Required. + :vartype name: str + :ivar version: Dataset version. Required. + :vartype version: str + """ + + name: Required[str] + """Dataset name. Required.""" + version: Required[str] + """Dataset version. Required.""" + + +class Dimension(TypedDict, total=False): + """A single dimension — one independent, measurable quality dimension within a rubric evaluator's + scoring blueprint. + + :ivar id: Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). + Required. Provided by the user when manually creating a rubric evaluator or during + human-in-the-loop review of a generated set; the generation pipeline produces an initial value + the user can edit. Editable when saving new versions. Required. + :vartype id: str + :ivar description: What this dimension measures (e.g., 'Correctly identifies the user's + reservation intent and pursues the appropriate workflow'). Required. + :vartype description: str + :ivar weight: Relative weight of this dimension (1-10). The generation pipeline assigns exactly + one dimension weight 8-10; all others use 1-6. User edits are not constrained by this + heuristic. Required. + :vartype weight: int + :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of + relevance (skips applicability assessment). The service-generated general quality/policy + dimension has this set to true and is non-editable. Users may set this on their own custom + dimensions. The service defaults to ``false`` if a value is not specified by the caller. + :vartype always_applicable: bool + :ivar metadata: Service-generated version lineage for this dimension. Present only when lineage + tracking is available. + :vartype metadata: "DimensionMetadata" + """ + + id: Required[str] + """Stable identifier for this dimension (snake_case, e.g., ``correct_resolution``). Required. + Provided by the user when manually creating a rubric evaluator or during human-in-the-loop + review of a generated set; the generation pipeline produces an initial value the user can edit. + Editable when saving new versions. Required.""" + description: Required[str] + """What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and + pursues the appropriate workflow'). Required.""" + weight: Required[int] + """Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension + weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. Required.""" + always_applicable: bool + """When true, the LLM judge always scores this dimension regardless of relevance (skips + applicability assessment). The service-generated general quality/policy dimension has this set + to true and is non-editable. Users may set this on their own custom dimensions. The service + defaults to ``false`` if a value is not specified by the caller.""" + metadata: "DimensionMetadata" + """Service-generated version lineage for this dimension. Present only when lineage tracking is + available.""" + + +class DimensionMetadata(TypedDict, total=False): + """Service-generated version lineage for a rubric dimension. + + :ivar origin_version: The evaluator version in which the dimension was first introduced, or the + earliest version known after lineage tracking began. Required. + :vartype origin_version: str + :ivar last_modified_version: The evaluator version containing the most recent substantive + change to the dimension. Required. + :vartype last_modified_version: str + :ivar change_kind: How the dimension changed relative to the preceding evaluator version. + Required. Known values are: "new", "carried_over", "amplified", "regenerated", and + "human_edited". + :vartype change_kind: Union[str, "DimensionChangeKind"] + :ivar change_detail: A bounded service-generated explanation of the version transition. + :vartype change_detail: str + """ + + origin_version: Required[str] + """The evaluator version in which the dimension was first introduced, or the earliest version + known after lineage tracking began. Required.""" + last_modified_version: Required[str] + """The evaluator version containing the most recent substantive change to the dimension. Required.""" + change_kind: Required[Union[str, "DimensionChangeKind"]] + """How the dimension changed relative to the preceding evaluator version. Required. Known values + are: \"new\", \"carried_over\", \"amplified\", \"regenerated\", and \"human_edited\".""" + change_detail: str + """A bounded service-generated explanation of the version transition.""" + + +class EmbeddingConfiguration(TypedDict, total=False): + """Embedding configuration class. + + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str + """ + + modelDeploymentName: Required[str] + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embeddingField: Required[str] + """Embedding field. Required.""" + + +class EmptyModelParam(TypedDict, total=False): + """EmptyModelParam.""" + + +class EndpointBasedEvaluatorDefinition(TypedDict, total=False): + """Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that + implements the evaluation contract. The evaluator references a Project Connection by name; the + connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, + the service resolves the connection to obtain the endpoint URL and authentication details, then + calls the endpoint for each evaluation row. + + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, Any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, Any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, "EvaluatorMetric"] + :ivar type: Required. Endpoint-based evaluator definition. References a customer-owned HTTP + endpoint via a Project Connection. + :vartype type: Literal[EvaluatorDefinitionType.ENDPOINT] + :ivar connection_name: Name of the Project Connection that stores the endpoint URL and + credentials. The connection must exist on the project and have a non-empty target URL. + Supported auth types: ApiKey (sends ``api-key`` header) and AAD/Entra ID (acquires a bearer + token via the project's Managed Identity). Required. + :vartype connection_name: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.ENDPOINT]] + """Required. Endpoint-based evaluator definition. References a customer-owned HTTP endpoint via a + Project Connection.""" + connection_name: Required[str] + """Name of the Project Connection that stores the endpoint URL and credentials. The connection + must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends + ``api-key`` header) and AAD/Entra ID (acquires a bearer token via the project's Managed + Identity). Required.""" + + +class EntraAuthorizationScheme(TypedDict, total=False): + """EntraAuthorizationScheme. + + :ivar type: Required. ENTRA. + :vartype type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + """ + + type: Required[Literal[AgentEndpointAuthorizationSchemeType.ENTRA]] + """Required. ENTRA.""" + + +class EvalResult(TypedDict, total=False): + """Result of the evaluation. + + :ivar name: name of the check. Required. + :vartype name: str + :ivar type: type of the check. Required. + :vartype type: str + :ivar score: score. Required. + :vartype score: float + :ivar passed: indicates if the check passed or failed. Required. + :vartype passed: bool + """ + + name: Required[str] + """name of the check. Required.""" + type: Required[str] + """type of the check. Required.""" + score: Required[float] + """score. Required.""" + passed: Required[bool] + """indicates if the check passed or failed. Required.""" + + +class EvalRunResultCompareItem(TypedDict, total=False): + """Metric comparison for a treatment against the baseline. + + :ivar treatment_run_id: The treatment run ID. Required. + :vartype treatment_run_id: str + :ivar treatment_run_summary: Summary statistics of the treatment run. Required. + :vartype treatment_run_summary: "EvalRunResultSummary" + :ivar delta_estimate: Estimated difference between treatment and baseline. Required. + :vartype delta_estimate: float + :ivar p_value: P-value for the treatment effect. Required. + :vartype p_value: float + :ivar treatment_effect: Type of treatment effect. Required. Known values are: "TooFewSamples", + "Inconclusive", "Changed", "Improved", and "Degraded". + :vartype treatment_effect: Union[str, "TreatmentEffectType"] + """ + + treatmentRunId: Required[str] + """The treatment run ID. Required.""" + treatmentRunSummary: Required["EvalRunResultSummary"] + """Summary statistics of the treatment run. Required.""" + deltaEstimate: Required[float] + """Estimated difference between treatment and baseline. Required.""" + pValue: Required[float] + """P-value for the treatment effect. Required.""" + treatmentEffect: Required[Union[str, "TreatmentEffectType"]] + """Type of treatment effect. Required. Known values are: \"TooFewSamples\", \"Inconclusive\", + \"Changed\", \"Improved\", and \"Degraded\".""" + + +class EvalRunResultComparison(TypedDict, total=False): + """Comparison results for treatment runs against the baseline. + + :ivar testing_criteria: Name of the testing criteria. Required. + :vartype testing_criteria: str + :ivar metric: Metric being evaluated. Required. + :vartype metric: str + :ivar evaluator: Name of the evaluator for this testing criteria. Required. + :vartype evaluator: str + :ivar baseline_run_summary: Summary statistics of the baseline run. Required. + :vartype baseline_run_summary: "EvalRunResultSummary" + :ivar compare_items: List of comparison results for each treatment run. Required. + :vartype compare_items: list["EvalRunResultCompareItem"] + """ + + testingCriteria: Required[str] + """Name of the testing criteria. Required.""" + metric: Required[str] + """Metric being evaluated. Required.""" + evaluator: Required[str] + """Name of the evaluator for this testing criteria. Required.""" + baselineRunSummary: Required["EvalRunResultSummary"] + """Summary statistics of the baseline run. Required.""" + compareItems: Required[list["EvalRunResultCompareItem"]] + """List of comparison results for each treatment run. Required.""" + + +class EvalRunResultSummary(TypedDict, total=False): + """Summary statistics of a metric in an evaluation run. + + :ivar run_id: The evaluation run ID. Required. + :vartype run_id: str + :ivar sample_count: Number of samples in the evaluation run. Required. + :vartype sample_count: int + :ivar average: Average value of the metric in the evaluation run. Required. + :vartype average: float + :ivar standard_deviation: Standard deviation of the metric in the evaluation run. Required. + :vartype standard_deviation: float + """ + + runId: Required[str] + """The evaluation run ID. Required.""" + sampleCount: Required[int] + """Number of samples in the evaluation run. Required.""" + average: Required[float] + """Average value of the metric in the evaluation run. Required.""" + standardDeviation: Required[float] + """Standard deviation of the metric in the evaluation run. Required.""" + + +class EvaluationComparisonInsightRequest(TypedDict, total=False): + """Evaluation Comparison Request. + + :ivar type: The type of request. Required. Evaluation Comparison. + :vartype type: Literal[InsightType.EVALUATION_COMPARISON] + :ivar eval_id: Identifier for the evaluation. Required. + :vartype eval_id: str + :ivar baseline_run_id: The baseline run ID for comparison. Required. + :vartype baseline_run_id: str + :ivar treatment_run_ids: List of treatment run IDs for comparison. Required. + :vartype treatment_run_ids: list[str] + """ + + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + """The type of request. Required. Evaluation Comparison.""" + evalId: Required[str] + """Identifier for the evaluation. Required.""" + baselineRunId: Required[str] + """The baseline run ID for comparison. Required.""" + treatmentRunIds: Required[list[str]] + """List of treatment run IDs for comparison. Required.""" + + +class EvaluationComparisonInsightResult(TypedDict, total=False): + """Insights from the evaluation comparison. + + :ivar type: The type of insights result. Required. Evaluation Comparison. + :vartype type: Literal[InsightType.EVALUATION_COMPARISON] + :ivar comparisons: Comparison results for each treatment run against the baseline. Required. + :vartype comparisons: list["EvalRunResultComparison"] + :ivar method: The statistical method used for comparison. Required. + :vartype method: str + """ + + type: Required[Literal[InsightType.EVALUATION_COMPARISON]] + """The type of insights result. Required. Evaluation Comparison.""" + comparisons: Required[list["EvalRunResultComparison"]] + """Comparison results for each treatment run against the baseline. Required.""" + method: Required[str] + """The statistical method used for comparison. Required.""" + + +class EvaluationResultSample(TypedDict, total=False): + """A sample from the evaluation result. + + :ivar id: The unique identifier for the analysis sample. Required. + :vartype id: str + :ivar features: Features to help with additional filtering of data in UX. Required. + :vartype features: dict[str, Any] + :ivar correlation_info: Info about the correlation for the analysis sample. Required. + :vartype correlation_info: dict[str, Any] + :ivar type: Evaluation Result Sample Type. Required. A sample from the evaluation result. + :vartype type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + :ivar evaluation_result: Evaluation result for the analysis sample. Required. + :vartype evaluation_result: "EvalResult" + """ + + id: Required[str] + """The unique identifier for the analysis sample. Required.""" + features: Required[dict[str, Any]] + """Features to help with additional filtering of data in UX. Required.""" + correlationInfo: Required[dict[str, Any]] + """Info about the correlation for the analysis sample. Required.""" + type: Required[Literal[SampleType.EVALUATION_RESULT_SAMPLE]] + """Evaluation Result Sample Type. Required. A sample from the evaluation result.""" + evaluationResult: Required["EvalResult"] + """Evaluation result for the analysis sample. Required.""" + + +class EvaluationRule(TypedDict, total=False): + """Evaluation rule model. + + :ivar id: Unique identifier for the evaluation rule. Required. + :vartype id: str + :ivar display_name: Display Name for the evaluation rule. + :vartype display_name: str + :ivar description: Description for the evaluation rule. + :vartype description: str + :ivar action: Definition of the evaluation rule action. Required. + :vartype action: "EvaluationRuleAction" + :ivar filter: Filter condition of the evaluation rule. + :vartype filter: "EvaluationRuleFilter" + :ivar event_type: Event type that the evaluation rule applies to. Required. Known values are: + "responseCompleted" and "manual". + :vartype event_type: Union[str, "EvaluationRuleEventType"] + :ivar enabled: Indicates whether the evaluation rule is enabled. Default is true. Required. + :vartype enabled: bool + :ivar system_data: System metadata for the evaluation rule. Required. + :vartype system_data: dict[str, str] + """ + + id: Required[str] + """Unique identifier for the evaluation rule. Required.""" + displayName: str + """Display Name for the evaluation rule.""" + description: str + """Description for the evaluation rule.""" + action: Required["EvaluationRuleAction"] + """Definition of the evaluation rule action. Required.""" + filter: "EvaluationRuleFilter" + """Filter condition of the evaluation rule.""" + eventType: Required[Union[str, "EvaluationRuleEventType"]] + """Event type that the evaluation rule applies to. Required. Known values are: + \"responseCompleted\" and \"manual\".""" + enabled: Required[bool] + """Indicates whether the evaluation rule is enabled. Default is true. Required.""" + systemData: Required[dict[str, str]] + """System metadata for the evaluation rule. Required.""" + + +class EvaluationRuleFilter(TypedDict, total=False): + """Evaluation filter model. + + :ivar agent_name: Filter by agent name. Required. + :vartype agent_name: str + """ + + agentName: Required[str] + """Filter by agent name. Required.""" + + +class EvaluationRunClusterInsightRequest(TypedDict, total=False): + """Insights on set of Evaluation Results. + + :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + :ivar eval_id: Evaluation Id for the insights. Required. + :vartype eval_id: str + :ivar run_ids: List of evaluation run IDs for the insights. Required. + :vartype run_ids: list[str] + :ivar model_configuration: Configuration of the model used in the insight generation. + :vartype model_configuration: "InsightModelConfiguration" + """ + + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + """The type of insights request. Required. Insights on an Evaluation run result.""" + evalId: Required[str] + """Evaluation Id for the insights. Required.""" + runIds: Required[list[str]] + """List of evaluation run IDs for the insights. Required.""" + modelConfiguration: "InsightModelConfiguration" + """Configuration of the model used in the insight generation.""" + + +class EvaluationRunClusterInsightResult(TypedDict, total=False): + """Insights from the evaluation run cluster analysis. + + :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :vartype type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + :ivar cluster_insight: Required. + :vartype cluster_insight: "ClusterInsightResult" + """ + + type: Required[Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT]] + """The type of insights result. Required. Insights on an Evaluation run result.""" + clusterInsight: Required["ClusterInsightResult"] + """Required.""" + + +class EvaluationScheduleTask(TypedDict, total=False): + """Evaluation task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Evaluation task. + :vartype type: Literal[ScheduleTaskType.EVALUATION] + :ivar eval_id: Identifier of the evaluation group. Required. + :vartype eval_id: str + :ivar eval_run: The evaluation run payload. Required. + :vartype eval_run: dict[str, Any] + """ + + configuration: dict[str, str] + """Configuration for the task.""" + type: Required[Literal[ScheduleTaskType.EVALUATION]] + """Required. Evaluation task.""" + evalId: Required[str] + """Identifier of the evaluation group. Required.""" + evalRun: Required[dict[str, Any]] + """The evaluation run payload. Required.""" + + +class EvaluationTaxonomy(TypedDict, total=False): + """Evaluation Taxonomy Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar taxonomy_input: Input configuration for the evaluation taxonomy. Required. + :vartype taxonomy_input: "EvaluationTaxonomyInput" + :ivar taxonomy_categories: List of taxonomy categories. + :vartype taxonomy_categories: list["TaxonomyCategory"] + :ivar properties: Additional properties for the evaluation taxonomy. + :vartype properties: dict[str, str] + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + taxonomyInput: Required["EvaluationTaxonomyInput"] + """Input configuration for the evaluation taxonomy. Required.""" + taxonomyCategories: list["TaxonomyCategory"] + """List of taxonomy categories.""" + properties: dict[str, str] + """Additional properties for the evaluation taxonomy.""" + + +class EvaluatorCredentialRequest(TypedDict, total=False): + """Request body for getting evaluator credentials. + + :ivar blob_uri: The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required. + :vartype blob_uri: str + """ + + blob_uri: Required[str] + """The blob URI for the evaluator storage. Example: + ``https://account.blob.core.windows.net:443/container``. Required.""" + + +class EvaluatorGenerationArtifacts(TypedDict, total=False): + """Service-managed provenance artifacts produced by an evaluator generation job. Present only on + EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry + Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace. + + :ivar dataset: Reference to the single Foundry Dataset (one combined JSONL file, + version-aligned to ``EvaluatorVersion.version``) holding all artifacts produced by the + generation pipeline. Each row in the JSONL carries a ``kind`` field discriminating its content + (e.g. ``spec``, ``tools``, ``context``). Required. + :vartype dataset: "DatasetReference" + :ivar kinds: The kinds of rows present in ``dataset``. Always contains ``"spec"`` (the + generated evaluation specification, a Markdown document describing what the evaluator + measures). May additionally contain ``"tools"`` (when the generation pipeline produced or + inferred OpenAI tool schemas) and/or ``"context"`` (when supplementary materials such as file + uploads or trace samples were used during generation). Required. + :vartype kinds: list[str] + """ + + dataset: Required["DatasetReference"] + """Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + ``EvaluatorVersion.version``) holding all artifacts produced by the generation pipeline. Each + row in the JSONL carries a ``kind`` field discriminating its content (e.g. ``spec``, ``tools``, + ``context``). Required.""" + kinds: Required[list[str]] + """The kinds of rows present in ``dataset``. Always contains ``\"spec\"`` (the generated + evaluation specification, a Markdown document describing what the evaluator measures). May + additionally contain ``\"tools\"`` (when the generation pipeline produced or inferred OpenAI + tool schemas) and/or ``\"context\"`` (when supplementary materials such as file uploads or + trace samples were used during generation). Required.""" + + +class EvaluatorGenerationInputs(TypedDict, total=False): + """Caller-supplied inputs for an evaluator generation job. + + :ivar sources: Source materials for generation — agent descriptions, prompts, traces, or + datasets. Each entry is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. + Required. + :vartype sources: list["EvaluatorGenerationJobSource"] + :ivar model: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + provide their own model rather than relying on service-owned capacity. Required. + :vartype model: str + :ivar evaluator_name: The evaluator name (immutable identifier). 1-256 characters; allowed + characters are ASCII letters, digits, underscore (``_``), period (``.``), tilde (``~``), and + hyphen (``-``). The prefix ``builtin.`` is reserved for system-managed evaluators and is + rejected by the service. If an evaluator with this name already exists in the project (and is + rubric-subtype), the service creates a new version under the same name and uses the prior + version's ``dimensions`` as context for incremental improvement (foundation of the post-//build + adaptive loop). Old versions remain queryable via ``get_version(name, version)``. If the + existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the + request is rejected with ``400 Bad Request``. Required. + :vartype evaluator_name: str + :ivar evaluator_display_name: Optional human-friendly display name for the resulting evaluator. + Surfaced as ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the + service uses ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates + this from the immutable ``evaluator_name`` identifier. + :vartype evaluator_display_name: str + :ivar evaluator_description: Optional human-friendly description for the resulting evaluator. + Surfaced as ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected + from the UI alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this + from any other description fields on related models. + :vartype evaluator_description: str + """ + + sources: Required[list["EvaluatorGenerationJobSource"]] + """Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry + is an ``EvaluatorGenerationJobSource`` variant discriminated by ``type``. Required.""" + model: Required[str] + """The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide + their own model rather than relying on service-owned capacity. Required.""" + evaluator_name: Required[str] + """The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII + letters, digits, underscore (``_``), period (``.``), tilde (``~``), and hyphen (``-``). The + prefix ``builtin.`` is reserved for system-managed evaluators and is rejected by the service. + If an evaluator with this name already exists in the project (and is rubric-subtype), the + service creates a new version under the same name and uses the prior version's ``dimensions`` + as context for incremental improvement (foundation of the post-//build adaptive loop). Old + versions remain queryable via ``get_version(name, version)``. If the existing evaluator is not + a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with + ``400 Bad Request``. Required.""" + evaluator_display_name: str + """Optional human-friendly display name for the resulting evaluator. Surfaced as + ``EvaluatorVersion.display_name`` on the persisted evaluator. When omitted, the service uses + ``evaluator_name`` as the display name. The ``evaluator_`` prefix disambiguates this from the + immutable ``evaluator_name`` identifier.""" + evaluator_description: str + """Optional human-friendly description for the resulting evaluator. Surfaced as + ``EvaluatorVersion.description`` on the persisted evaluator. Typically collected from the UI + alongside ``evaluator_display_name``. The ``evaluator_`` prefix disambiguates this from any + other description fields on related models.""" + + +class EvaluatorGenerationJob(TypedDict, total=False): + """Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator + definitions from source materials. On success, the result is the persisted EvaluatorVersion. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "EvaluatorGenerationInputs" + :ivar result: Result produced on success. + :vartype result: "EvaluatorVersion" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time (seconds + since January 1, 1970). Required. + :vartype created_at: int + :ivar finished_at: The timestamp when the job finished, represented in Unix time (seconds since + January 1, 1970). + :vartype finished_at: int + :ivar usage: Token consumption summary. Populated when the job reaches a terminal state. + :vartype usage: "EvaluatorGenerationTokenUsage" + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "EvaluatorGenerationInputs" + """Caller-supplied inputs.""" + result: "EvaluatorVersion" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time (seconds since January 1, + 1970). Required.""" + finished_at: int + """The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).""" + usage: "EvaluatorGenerationTokenUsage" + """Token consumption summary. Populated when the job reaches a terminal state.""" + + +class EvaluatorGenerationTokenUsage(TypedDict, total=False): + """Token consumption summary for an evaluator generation job. Populated when the job reaches a + terminal state. + + :ivar input_tokens: Number of input (prompt) tokens consumed. Required. + :vartype input_tokens: int + :ivar output_tokens: Number of output (completion) tokens generated. Required. + :vartype output_tokens: int + :ivar total_tokens: Total tokens consumed (input + output). Required. + :vartype total_tokens: int + """ + + input_tokens: Required[int] + """Number of input (prompt) tokens consumed. Required.""" + output_tokens: Required[int] + """Number of output (completion) tokens generated. Required.""" + total_tokens: Required[int] + """Total tokens consumed (input + output). Required.""" + + +class EvaluatorMetric(TypedDict, total=False): + """Evaluator Metric. + + :ivar type: Type of the metric. Known values are: "ordinal", "continuous", and "boolean". + :vartype type: Union[str, "EvaluatorMetricType"] + :ivar desirable_direction: It indicates whether a higher value is better or a lower value is + better for this metric. Known values are: "increase", "decrease", and "neutral". + :vartype desirable_direction: Union[str, "EvaluatorMetricDirection"] + :ivar min_value: Minimum value for the metric. + :vartype min_value: float + :ivar max_value: Maximum value for the metric. If not specified, it is assumed to be unbounded. + :vartype max_value: float + :ivar threshold: Default pass/fail threshold for this metric. + :vartype threshold: float + :ivar is_primary: Indicates if this metric is primary when there are multiple metrics. + :vartype is_primary: bool + """ + + type: Union[str, "EvaluatorMetricType"] + """Type of the metric. Known values are: \"ordinal\", \"continuous\", and \"boolean\".""" + desirable_direction: Union[str, "EvaluatorMetricDirection"] + """It indicates whether a higher value is better or a lower value is better for this metric. Known + values are: \"increase\", \"decrease\", and \"neutral\".""" + min_value: float + """Minimum value for the metric.""" + max_value: float + """Maximum value for the metric. If not specified, it is assumed to be unbounded.""" + threshold: float + """Default pass/fail threshold for this metric.""" + is_primary: bool + """Indicates if this metric is primary when there are multiple metrics.""" + + +class EvaluatorVersion(TypedDict, total=False): + """Evaluator Definition. + + :ivar display_name: Display Name for evaluator. It helps to find the evaluator easily in AI + Foundry. It does not need to be unique. + :vartype display_name: str + :ivar metadata: Metadata about the evaluator. + :vartype metadata: dict[str, str] + :ivar evaluator_type: The type of the evaluator. Required. Known values are: "builtin" and + "custom". + :vartype evaluator_type: Union[str, "EvaluatorType"] + :ivar categories: The categories of the evaluator. Required. + :vartype categories: list[Union[str, "EvaluatorCategory"]] + :ivar supported_evaluation_levels: Evaluation levels this evaluator supports (e.g., ``turn``, + ``conversation``). When omitted on create, the service defaults to ``["turn"]``. On update, + omitting this field leaves it unchanged; an empty list is rejected. Custom code-based + evaluators support only ``turn``; custom prompt-based evaluators support exactly one level + (``turn`` or ``conversation``). + :vartype supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] + :ivar definition: Definition of the evaluator. Required. + :vartype definition: "EvaluatorDefinition" + :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; + present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact + resolves to a versioned Foundry Dataset. + :vartype generation_artifacts: "EvaluatorGenerationArtifacts" + :ivar created_by: Creator of the evaluator. Required. + :vartype created_by: str + :ivar created_at: Creation date/time of the evaluator. Required. + :vartype created_at: str + :ivar modified_at: Last modified date/time of the evaluator. Required. + :vartype modified_at: str + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + """ + + display_name: str + """Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not + need to be unique.""" + metadata: dict[str, str] + """Metadata about the evaluator.""" + evaluator_type: Required[Union[str, "EvaluatorType"]] + """The type of the evaluator. Required. Known values are: \"builtin\" and \"custom\".""" + categories: Required[list[Union[str, "EvaluatorCategory"]]] + """The categories of the evaluator. Required.""" + supported_evaluation_levels: list[Union[str, "EvaluationLevel"]] + """Evaluation levels this evaluator supports (e.g., ``turn``, ``conversation``). When omitted on + create, the service defaults to ``[\"turn\"]``. On update, omitting this field leaves it + unchanged; an empty list is rejected. Custom code-based evaluators support only ``turn``; + custom prompt-based evaluators support exactly one level (``turn`` or ``conversation``).""" + definition: Required["EvaluatorDefinition"] + """Definition of the evaluator. Required.""" + generation_artifacts: "EvaluatorGenerationArtifacts" + """Provenance artifacts from the generation pipeline. Read-only; present only on evaluator + versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + Dataset.""" + created_by: Required[str] + """Creator of the evaluator. Required.""" + created_at: Required[str] + """Creation date/time of the evaluator. Required.""" + modified_at: Required[str] + """Last modified date/time of the evaluator. Required.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class ExternalAgentDefinition(TypedDict, total=False): + """The external agent definition. Represents a third-party agent hosted outside Foundry (for + example, on GCP or AWS). Registration is metadata-only: Foundry records the agent definition to + light up observability experiences (traces, evaluations) over customer-emitted OpenTelemetry + data. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. EXTERNAL. + :vartype kind: Literal[AgentKind.EXTERNAL] + :ivar otel_agent_id: The OpenTelemetry agent identifier used to attribute customer-emitted + spans to this Foundry agent. Spans must include the attribute ``gen_ai.agent.id = + `` to appear under this registration. Defaults to the top-level agent name when + omitted. Provide an explicit value only for migration scenarios where the running external + agent already emits a stable id that differs from the Foundry agent name. The resolved value is + always echoed on read. + :vartype otel_agent_id: str + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.EXTERNAL]] + """Required. EXTERNAL.""" + otel_agent_id: str + """The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry + agent. Spans must include the attribute ``gen_ai.agent.id = `` to appear under + this registration. Defaults to the top-level agent name when omitted. Provide an explicit value + only for migration scenarios where the running external agent already emits a stable id that + differs from the Foundry agent name. The resolved value is always echoed on read.""" + + +class FabricDataAgentToolParameters(TypedDict, total=False): + """The fabric data agent tool parameters. + + :ivar project_connections: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. + :vartype project_connections: list["ToolProjectConnection"] + """ + + project_connections: list["ToolProjectConnection"] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class FabricIQPreviewTool(TypedDict, total=False): + """A FabricIQ server-side tool. + + :ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW. + :vartype type: Literal[ToolType.FABRIC_IQ_PREVIEW] + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + type: Required[Literal[ToolType.FABRIC_IQ_PREVIEW]] + """The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the FabricIQ project connection. Required.""" + server_label: str + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: str + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + +class FabricIQPreviewToolboxTool(TypedDict, total=False): + """A FabricIQ tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. FABRIC_IQ_PREVIEW. + :vartype type: Literal[ToolboxToolType.FABRIC_IQ_PREVIEW] + :ivar project_connection_id: The ID of the FabricIQ project connection. Required. + :vartype project_connection_id: str + :ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to. + :vartype server_label: str + :ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from + the project connection will be used. + :vartype server_url: str + :ivar require_approval: (Optional) Whether the agent requires approval before executing + actions. Default is always. Is either a MCPToolRequireApproval type or a str type. + :vartype require_approval: Union["MCPToolRequireApproval", str] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.FABRIC_IQ_PREVIEW]] + """Required. FABRIC_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the FabricIQ project connection. Required.""" + server_label: str + """(Optional) The label of the FabricIQ MCP server to connect to.""" + server_url: str + """(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project + connection will be used.""" + require_approval: Optional[Union["MCPToolRequireApproval", str]] + """(Optional) Whether the agent requires approval before executing actions. Default is always. Is + either a MCPToolRequireApproval type or a str type.""" + + +class FieldMapping(TypedDict, total=False): + """Field mapping configuration class. + + :ivar content_fields: List of fields with text content. Required. + :vartype content_fields: list[str] + :ivar filepath_field: Path of file to be used as a source of text content. + :vartype filepath_field: str + :ivar title_field: Field containing the title of the document. + :vartype title_field: str + :ivar url_field: Field containing the url of the document. + :vartype url_field: str + :ivar vector_fields: List of fields with vector content. + :vartype vector_fields: list[str] + :ivar metadata_fields: List of fields with metadata content. + :vartype metadata_fields: list[str] + """ + + contentFields: Required[list[str]] + """List of fields with text content. Required.""" + filepathField: str + """Path of file to be used as a source of text content.""" + titleField: str + """Field containing the title of the document.""" + urlField: str + """Field containing the url of the document.""" + vectorFields: list[str] + """List of fields with vector content.""" + metadataFields: list[str] + """List of fields with metadata content.""" + + +class FileDataGenerationJobOutput(TypedDict, total=False): + """Azure OpenAI file output for a data generation job. + + :ivar type: Azure OpenAI file output. Required. The generated data is an Azure OpenAI File. + :vartype type: Literal[DataGenerationJobOutputType.FILE] + :ivar id: The id of the output Azure OpenAI file. Required. + :vartype id: str + :ivar filename: The filename of the output Azure OpenAI file. Required. + :vartype filename: str + """ + + type: Required[Literal[DataGenerationJobOutputType.FILE]] + """Azure OpenAI file output. Required. The generated data is an Azure OpenAI File.""" + id: Required[str] + """The id of the output Azure OpenAI file. Required.""" + filename: Required[str] + """The filename of the output Azure OpenAI file. Required.""" + + +class FileDataGenerationJobSource(TypedDict, total=False): + """File source for data generation jobs — Azure OpenAI file input. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this job, which is File. Required. File source — Azure OpenAI + file. + :vartype type: Literal[DataGenerationJobSourceType.FILE] + :ivar id: Input Azure Open AI file id used for data generation. Required. + :vartype id: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[DataGenerationJobSourceType.FILE]] + """The source type for this job, which is File. Required. File source — Azure OpenAI file.""" + id: Required[str] + """Input Azure Open AI file id used for data generation. Required.""" + + +class FileDatasetVersion(TypedDict, total=False): + """FileDatasetVersion Definition. + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Dataset type. Required. URI file. + :vartype type: Literal[DatasetType.URI_FILE] + """ + + dataUri: Required[str] + """URI of the data (`example `_). Required.""" + isReference: bool + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connectionName: str + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[DatasetType.URI_FILE]] + """Dataset type. Required. URI file.""" + + +class FileSearchTool(TypedDict, total=False): + """File search. + + :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. + :vartype type: Literal[ToolType.FILE_SEARCH] + :ivar vector_store_ids: The IDs of the vector stores to search. Required. + :vartype vector_store_ids: list[str] + :ivar max_num_results: The maximum number of results to return. This number should be between 1 + and 50 inclusive. + :vartype max_num_results: int + :ivar ranking_options: Ranking options for search. + :vartype ranking_options: "RankingOptions" + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: "_unions.Filters" + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + """ + + type: Required[Literal[ToolType.FILE_SEARCH]] + """The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH.""" + vector_store_ids: Required[list[str]] + """The IDs of the vector stores to search. Required.""" + max_num_results: int + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: "RankingOptions" + """Ranking options for search.""" + filters: Optional["_unions.Filters"] + """Is either a ComparisonFilter type or a CompoundFilter type.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class FileSearchToolboxTool(TypedDict, total=False): + """A file search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. FILE_SEARCH. + :vartype type: Literal[ToolboxToolType.FILE_SEARCH] + :ivar max_num_results: The maximum number of results to return. This number should be between 1 + and 50 inclusive. + :vartype max_num_results: int + :ivar ranking_options: Ranking options for search. + :vartype ranking_options: "RankingOptions" + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. + :vartype filters: "_unions.Filters" + :ivar vector_store_ids: The IDs of the vector stores to search. + :vartype vector_store_ids: list[str] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.FILE_SEARCH]] + """Required. FILE_SEARCH.""" + max_num_results: int + """The maximum number of results to return. This number should be between 1 and 50 inclusive.""" + ranking_options: "RankingOptions" + """Ranking options for search.""" + filters: Optional["_unions.Filters"] + """Is either a ComparisonFilter type or a CompoundFilter type.""" + vector_store_ids: list[str] + """The IDs of the vector stores to search.""" + + +class FixedRatioVersionSelectionRule(TypedDict, total=False): + """FixedRatioVersionSelectionRule. + + :ivar agent_version: The agent version to route traffic to. Required. + :vartype agent_version: str + :ivar type: Required. FIXED_RATIO. + :vartype type: Literal[VersionSelectorType.FIXED_RATIO] + :ivar traffic_percentage: The percentage of traffic to route to the version. Must be between 0 + and 100. Required. + :vartype traffic_percentage: int + """ + + agent_version: Required[str] + """The agent version to route traffic to. Required.""" + type: Required[Literal[VersionSelectorType.FIXED_RATIO]] + """Required. FIXED_RATIO.""" + traffic_percentage: Required[int] + """The percentage of traffic to route to the version. Must be between 0 and 100. Required.""" + + +class FolderDatasetVersion(TypedDict, total=False): + """FileDatasetVersion Definition. + + :ivar data_uri: URI of the data (`example `_). + Required. + :vartype data_uri: str + :ivar is_reference: Indicates if the dataset holds a reference to the storage, or the dataset + manages storage itself. If true, the underlying data will not be deleted when the dataset + version is deleted. + :vartype is_reference: bool + :ivar connection_name: The Azure Storage Account connection name. Required if + startPendingUploadVersion was not called before creating the Dataset. + :vartype connection_name: str + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Dataset type. Required. URI folder. + :vartype type: Literal[DatasetType.URI_FOLDER] + """ + + dataUri: Required[str] + """URI of the data (`example `_). Required.""" + isReference: bool + """Indicates if the dataset holds a reference to the storage, or the dataset manages storage + itself. If true, the underlying data will not be deleted when the dataset version is deleted.""" + connectionName: str + """The Azure Storage Account connection name. Required if startPendingUploadVersion was not called + before creating the Dataset.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[DatasetType.URI_FOLDER]] + """Dataset type. Required. URI folder.""" + + +class FoundryModelWarning(TypedDict, total=False): + """A warning associated with a model. + + :ivar code: The warning code. Known values are: "RuntimeDependentArtifact" and + "UnclassifiedArtifact". + :vartype code: Union[str, "FoundryModelWarningCode"] + :ivar message: The warning message. + :vartype message: str + """ + + code: Union[str, "FoundryModelWarningCode"] + """The warning code. Known values are: \"RuntimeDependentArtifact\" and \"UnclassifiedArtifact\".""" + message: str + """The warning message.""" + + +class FunctionShellToolParam(TypedDict, total=False): + """Shell tool. + + :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. + :vartype type: Literal[ToolType.SHELL] + :ivar environment: + :vartype environment: "FunctionShellToolParamEnvironment" + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + """ + + type: Required[Literal[ToolType.SHELL]] + """The type of the shell tool. Always ``shell``. Required. SHELL.""" + environment: Optional["FunctionShellToolParamEnvironment"] + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class FunctionShellToolParamEnvironmentContainerReferenceParam(TypedDict, total=False): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentContainerReferenceParam. + + :ivar type: References a container created with the /v1/containers endpoint. Required. + CONTAINER_REFERENCE. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + :ivar container_id: The ID of the referenced container. Required. + :vartype container_id: str + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE]] + """References a container created with the /v1/containers endpoint. Required. CONTAINER_REFERENCE.""" + container_id: Required[str] + """The ID of the referenced container. Required.""" + + +class FunctionShellToolParamEnvironmentLocalEnvironmentParam(TypedDict, total=False): # pylint: disable=name-too-long + """FunctionShellToolParamEnvironmentLocalEnvironmentParam. + + :ivar type: Use a local computer environment. Required. LOCAL. + :vartype type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + :ivar skills: An optional list of skills. + :vartype skills: list["LocalSkillParam"] + """ + + type: Required[Literal[FunctionShellToolParamEnvironmentType.LOCAL]] + """Use a local computer environment. Required. LOCAL.""" + skills: list["LocalSkillParam"] + """An optional list of skills.""" + + +class FunctionTool(TypedDict, total=False): + """Function. + + :ivar type: The type of the function tool. Always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: Required. + :vartype parameters: dict[str, Any] + :ivar strict: Required. + :vartype strict: bool + :ivar defer_loading: Whether this function is deferred and loaded via tool search. + :vartype defer_loading: bool + """ + + type: Required[Literal[ToolType.FUNCTION]] + """The type of the function tool. Always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + description: Optional[str] + parameters: Required[Optional[dict[str, Any]]] + """Required.""" + strict: Required[Optional[bool]] + """Required.""" + defer_loading: bool + """Whether this function is deferred and loaded via tool search.""" + + +class FunctionToolParam(TypedDict, total=False): + """FunctionToolParam. + + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: "EmptyModelParam" + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: Literal["function"] + :ivar defer_loading: Whether this function should be deferred and discovered via tool search. + :vartype defer_loading: bool + """ + + name: Required[str] + """Required.""" + description: Optional[str] + parameters: Optional["EmptyModelParam"] + strict: Optional[bool] + type: Required[Literal["function"]] + """Required. Default value is \"function\".""" + defer_loading: bool + """Whether this function should be deferred and discovered via tool search.""" + + +class GitHubIssueRoutineTrigger(TypedDict, total=False): + """A GitHub issue routine trigger. + + :ivar type: The trigger type. Required. A GitHub issue trigger. + :vartype type: Literal[RoutineTriggerType.GITHUB_ISSUE] + :ivar connection_id: The workspace connection identifier that resolves the GitHub configuration + for the trigger. Required. + :vartype connection_id: str + :ivar owner: The GitHub owner or organization that scopes which issues can fire the trigger. + Required. + :vartype owner: str + :ivar repository: The GitHub repository filter that scopes which issues can fire the trigger. + Required. + :vartype repository: str + :ivar issue_event: The GitHub issue event that fires the routine. Required. Known values are: + "opened" and "closed". + :vartype issue_event: Union[str, "GitHubIssueEvent"] + """ + + type: Required[Literal[RoutineTriggerType.GITHUB_ISSUE]] + """The trigger type. Required. A GitHub issue trigger.""" + connection_id: Required[str] + """The workspace connection identifier that resolves the GitHub configuration for the trigger. + Required.""" + owner: Required[str] + """The GitHub owner or organization that scopes which issues can fire the trigger. Required.""" + repository: Required[str] + """The GitHub repository filter that scopes which issues can fire the trigger. Required.""" + issue_event: Required[Union[str, "GitHubIssueEvent"]] + """The GitHub issue event that fires the routine. Required. Known values are: \"opened\" and + \"closed\".""" + + +class HeaderTelemetryEndpointAuth(TypedDict, total=False): + """Header-based secret authentication for a telemetry endpoint. The resolved secret value is + injected as an HTTP header. + + :ivar type: The authentication type, always 'header' for header-based secret authentication. + Required. Header-based secret authentication. + :vartype type: Literal[TelemetryEndpointAuthType.HEADER] + :ivar header_name: The name of the HTTP header to inject the secret value into. Required. + :vartype header_name: str + :ivar secret_id: The identifier of the secret store or connection. Required. + :vartype secret_id: str + :ivar secret_key: The key within the secret to retrieve the authentication value. Required. + :vartype secret_key: str + """ + + type: Required[Literal[TelemetryEndpointAuthType.HEADER]] + """The authentication type, always 'header' for header-based secret authentication. Required. + Header-based secret authentication.""" + header_name: Required[str] + """The name of the HTTP header to inject the secret value into. Required.""" + secret_id: Required[str] + """The identifier of the secret store or connection. Required.""" + secret_key: Required[str] + """The key within the secret to retrieve the authentication value. Required.""" + + +class HostedAgentDefinition(TypedDict, total=False): + """The hosted agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. HOSTED. + :vartype kind: Literal[AgentKind.HOSTED] + :ivar cpu: The CPU configuration for the hosted agent. Required. + :vartype cpu: str + :ivar memory: The memory configuration for the hosted agent. Required. + :vartype memory: str + :ivar environment_variables: Environment variables to set in the hosted agent container. + :vartype environment_variables: dict[str, str] + :ivar container_configuration: Container-based deployment configuration. Provide this for + image-based deployments. Mutually exclusive with code_configuration — the service validates + that exactly one is set. + :vartype container_configuration: "ContainerConfiguration" + :ivar protocol_versions: The protocols that the agent supports for ingress communication. + :vartype protocol_versions: list["ProtocolVersionRecord"] + :ivar code_configuration: Code-based deployment configuration. Provide this for code-based + deployments. Mutually exclusive with container_configuration — the service validates that + exactly one is set. + :vartype code_configuration: "CodeConfiguration" + :ivar telemetry_config: Optional customer-supplied telemetry configuration for exporting + container logs, traces, and metrics. + :vartype telemetry_config: "TelemetryConfig" + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.HOSTED]] + """Required. HOSTED.""" + cpu: Required[str] + """The CPU configuration for the hosted agent. Required.""" + memory: Required[str] + """The memory configuration for the hosted agent. Required.""" + environment_variables: dict[str, str] + """Environment variables to set in the hosted agent container.""" + container_configuration: "ContainerConfiguration" + """Container-based deployment configuration. Provide this for image-based deployments. Mutually + exclusive with code_configuration — the service validates that exactly one is set.""" + protocol_versions: list["ProtocolVersionRecord"] + """The protocols that the agent supports for ingress communication.""" + code_configuration: "CodeConfiguration" + """Code-based deployment configuration. Provide this for code-based deployments. Mutually + exclusive with container_configuration — the service validates that exactly one is set.""" + telemetry_config: "TelemetryConfig" + """Optional customer-supplied telemetry configuration for exporting container logs, traces, and + metrics.""" + + +class HourlyRecurrenceSchedule(TypedDict, total=False): + """Hourly recurrence schedule. + + :ivar type: Required. Hourly recurrence pattern. + :vartype type: Literal[RecurrenceType.HOURLY] + """ + + type: Required[Literal[RecurrenceType.HOURLY]] + """Required. Hourly recurrence pattern.""" + + +class HumanEvaluationPreviewRuleAction(TypedDict, total=False): + """Evaluation rule action for human evaluation. + + :ivar type: Required. Human evaluation preview. + :vartype type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str + """ + + type: Required[Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW]] + """Required. Human evaluation preview.""" + templateId: Required[str] + """Human evaluation template Id. Required.""" + + +class HybridSearchOptions(TypedDict, total=False): + """HybridSearchOptions. + + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float + """ + + embedding_weight: Required[float] + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: Required[float] + """The weight of the text in the reciprocal ranking fusion. Required.""" + + +class ImageGenTool(TypedDict, total=False): + """Image generation tool. + + :ivar type: The type of the image generation tool. Always ``image_generation``. Required. + IMAGE_GENERATION. + :vartype type: Literal[ToolType.IMAGE_GENERATION] + :ivar model: Is one of the following types: Literal["gpt-image-1"], + Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str + :vartype model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], + Literal["gpt-image-1.5"], str] + :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, or + ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype quality: Literal["low", "medium", "high", "auto"] + :ivar size: The size of the generated images. For ``gpt-image-2`` and + ``gpt-image-2-2026-04-21``, arbitrary resolutions are supported as ``WIDTHxHEIGHT`` strings, + for example ``1536x864``. Width and height must both be divisible by 16 and the requested + aspect ratio must be between 1:3 and 3:1. Resolutions above ``2560x1440`` are experimental, and + the maximum supported resolution is ``3840x2160``. The requested size must also satisfy the + model's current pixel and edge limits. The standard sizes ``1024x1024``, ``1536x1024``, and + ``1024x1536`` are supported by the GPT image models; ``auto`` is supported for models that + allow automatic sizing. For ``dall-e-2``, use one of ``256x256``, ``512x512``, or + ``1024x1024``. For ``dall-e-3``, use one of ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is + one of the following types: Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], + Literal["auto"], str + :vartype size: Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], + Literal["auto"], str] + :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or + ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], + Literal["jpeg"] + :vartype output_format: Literal["png", "webp", "jpeg"] + :ivar output_compression: Compression level for the output image. Default: 100. + :vartype output_compression: int + :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a + Literal["auto"] type or a Literal["low"] type. + :vartype moderation: Literal["auto", "low"] + :ivar background: Background type for the generated image. One of ``transparent``, ``opaque``, + or ``auto``. Default: ``auto``. Is one of the following types: Literal["transparent"], + Literal["opaque"], Literal["auto"] + :vartype background: Literal["transparent", "opaque", "auto"] + :ivar input_fidelity: Known values are: "high" and "low". + :vartype input_fidelity: Union[str, "InputFidelity"] + :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` (string, optional) + and ``file_id`` (string, optional). + :vartype input_image_mask: "ImageGenToolInputImageMask" + :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default + value) to 3. + :vartype partial_images: int + :ivar action: Whether to generate a new image or edit an existing image. Default: ``auto``. + Known values are: "generate", "edit", and "auto". + :vartype action: Union[str, "ImageGenAction"] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + """ + + type: Required[Literal[ToolType.IMAGE_GENERATION]] + """The type of the image generation tool. Always ``image_generation``. Required. IMAGE_GENERATION.""" + model: Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] + """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], + Literal[\"gpt-image-1.5\"], str""" + quality: Literal["low", "medium", "high", "auto"] + """The quality of the generated image. One of ``low``, ``medium``, ``high``, or ``auto``. Default: + ``auto``. Is one of the following types: Literal[\"low\"], Literal[\"medium\"], + Literal[\"high\"], Literal[\"auto\"]""" + size: Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + """The size of the generated images. For ``gpt-image-2`` and ``gpt-image-2-2026-04-21``, arbitrary + resolutions are supported as ``WIDTHxHEIGHT`` strings, for example ``1536x864``. Width and + height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. + Resolutions above ``2560x1440`` are experimental, and the maximum supported resolution is + ``3840x2160``. The requested size must also satisfy the model's current pixel and edge limits. + The standard sizes ``1024x1024``, ``1536x1024``, and ``1024x1536`` are supported by the GPT + image models; ``auto`` is supported for models that allow automatic sizing. For ``dall-e-2``, + use one of ``256x256``, ``512x512``, or ``1024x1024``. For ``dall-e-3``, use one of + ``1024x1024``, ``1792x1024``, or ``1024x1792``. Is one of the following types: + Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"], str""" + output_format: Literal["png", "webp", "jpeg"] + """The output format of the generated image. One of ``png``, ``webp``, or ``jpeg``. Default: + ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], Literal[\"jpeg\"]""" + output_compression: int + """Compression level for the output image. Default: 100.""" + moderation: Literal["auto", "low"] + """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type + or a Literal[\"low\"] type.""" + background: Literal["transparent", "opaque", "auto"] + """Background type for the generated image. One of ``transparent``, ``opaque``, or ``auto``. + Default: ``auto``. Is one of the following types: Literal[\"transparent\"], + Literal[\"opaque\"], Literal[\"auto\"]""" + input_fidelity: Optional[Union[str, "InputFidelity"]] + """Known values are: \"high\" and \"low\".""" + input_image_mask: "ImageGenToolInputImageMask" + """Optional mask for inpainting. Contains ``image_url`` (string, optional) and ``file_id`` + (string, optional).""" + partial_images: int + """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" + action: Union[str, "ImageGenAction"] + """Whether to generate a new image or edit an existing image. Default: ``auto``. Known values are: + \"generate\", \"edit\", and \"auto\".""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class ImageGenToolInputImageMask(TypedDict, total=False): + """ImageGenToolInputImageMask. + + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str + """ + + image_url: str + file_id: str + + +class InlineSkillParam(TypedDict, total=False): + """InlineSkillParam. + + :ivar type: Defines an inline skill for this request. Required. INLINE. + :vartype type: Literal[ContainerSkillType.INLINE] + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar source: Inline skill payload. Required. + :vartype source: "InlineSkillSourceParam" + """ + + type: Required[Literal[ContainerSkillType.INLINE]] + """Defines an inline skill for this request. Required. INLINE.""" + name: Required[str] + """The name of the skill. Required.""" + description: Required[str] + """The description of the skill. Required.""" + source: Required["InlineSkillSourceParam"] + """Inline skill payload. Required.""" + + +class InlineSkillSourceParam(TypedDict, total=False): + """Inline skill payload. + + :ivar type: The type of the inline skill source. Must be ``base64``. Required. Default value is + "base64". + :vartype type: Literal["base64"] + :ivar media_type: The media type of the inline skill payload. Must be ``application/zip``. + Required. Default value is "application/zip". + :vartype media_type: Literal["application/zip"] + :ivar data: Base64-encoded skill zip bundle. Required. + :vartype data: str + """ + + type: Required[Literal["base64"]] + """The type of the inline skill source. Must be ``base64``. Required. Default value is \"base64\".""" + media_type: Required[Literal["application/zip"]] + """The media type of the inline skill payload. Must be ``application/zip``. Required. Default + value is \"application/zip\".""" + data: Required[str] + """Base64-encoded skill zip bundle. Required.""" + + +class Insight(TypedDict, total=False): + """The response body for cluster insights. + + :ivar insight_id: The unique identifier for the insights report. Required. + :vartype insight_id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: "InsightsMetadata" + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: Union[str, "OperationState"] + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str + :ivar request: Request for the insights analysis. Required. + :vartype request: "InsightRequest" + :ivar result: The result of the insights report. + :vartype result: "InsightResult" + """ + + id: Required[str] + """The unique identifier for the insights report. Required.""" + metadata: Required["InsightsMetadata"] + """Metadata about the insights report. Required.""" + state: Required[Union[str, "OperationState"]] + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + displayName: Required[str] + """User friendly display name for the insight. Required.""" + request: Required["InsightRequest"] + """Request for the insights analysis. Required.""" + result: "InsightResult" + """The result of the insights report.""" + + +class InsightCluster(TypedDict, total=False): + """A cluster of analysis samples. + + :ivar id: The id of the analysis cluster. Required. + :vartype id: str + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str + :ivar description: Description of the analysis cluster. Required. + :vartype description: str + :ivar weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list["InsightCluster"] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list["InsightSample"] + """ + + id: Required[str] + """The id of the analysis cluster. Required.""" + label: Required[str] + """Label for the cluster. Required.""" + suggestion: Required[str] + """Suggestion for the cluster. Required.""" + suggestionTitle: Required[str] + """The title of the suggestion for the cluster. Required.""" + description: Required[str] + """Description of the analysis cluster. Required.""" + weight: Required[int] + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + subClusters: list["InsightCluster"] + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: list["InsightSample"] + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + + +class InsightModelConfiguration(TypedDict, total=False): + """Configuration of the model used in the insight generation. + + :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: str + """ + + modelDeploymentName: Required[str] + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" + + +class InsightScheduleTask(TypedDict, total=False): + """Insight task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: Literal[ScheduleTaskType.INSIGHT] + :ivar insight: The insight payload. Required. + :vartype insight: "Insight" + """ + + configuration: dict[str, str] + """Configuration for the task.""" + type: Required[Literal[ScheduleTaskType.INSIGHT]] + """Required. Insight task.""" + insight: Required["Insight"] + """The insight payload. Required.""" + + +class InsightsMetadata(TypedDict, total=False): + """Metadata about the insights. + + :ivar created_at: The timestamp when the insights were created. Required. + :vartype created_at: str + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: str + """ + + createdAt: Required[str] + """The timestamp when the insights were created. Required.""" + completedAt: str + """The timestamp when the insights were completed.""" + + +class InsightSummary(TypedDict, total=False): + """Summary of the error cluster analysis. + + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: "ClusterTokenUsage" + """ + + sampleCount: Required[int] + """Total number of samples analyzed. Required.""" + uniqueSubclusterCount: Required[int] + """Total number of unique subcluster labels. Required.""" + uniqueClusterCount: Required[int] + """Total number of unique clusters. Required.""" + method: Required[str] + """Method used for clustering. Required.""" + usage: Required["ClusterTokenUsage"] + """Token usage while performing clustering analysis. Required.""" + + +class InvocationsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the invocations protocol.""" + + +class InvocationsWsProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the WebSocket-based invocations protocol.""" + + +class InvokeAgentInvocationsApiDispatchPayload(TypedDict, total=False): + """A manual payload used to test an invocations API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for an invocations API + routine dispatch. + :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + :ivar input: The JSON value sent as the complete downstream invocations input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: Any + """ + + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API]] + """The manual dispatch payload type. Required. A manual payload for an invocations API routine + dispatch.""" + input: Required[Any] + """The JSON value sent as the complete downstream invocations input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + +class InvokeAgentInvocationsApiRoutineAction(TypedDict, total=False): + """Dispatches a routine through the raw invocations API. Exactly one of agent_name or + agent_endpoint_id must be provided. + + :ivar type: The action type. Required. Dispatches through the raw invocations API. + :vartype type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: Any + :ivar session_id: An optional existing hosted-agent session identifier to continue during the + downstream dispatch. + :vartype session_id: str + """ + + type: Required[Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API]] + """The action type. Required. Dispatches through the raw invocations API.""" + agent_name: str + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: str + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Any + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + session_id: str + """An optional existing hosted-agent session identifier to continue during the downstream + dispatch.""" + + +class InvokeAgentResponsesApiDispatchPayload(TypedDict, total=False): + """A manual payload used to test a responses API routine dispatch. + + :ivar type: The manual dispatch payload type. Required. A manual payload for a responses API + routine dispatch. + :vartype type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + :ivar input: The JSON value sent as the complete downstream responses input. The value is + passed through as-is and can be an object, string, number, boolean, array, or null. Required. + :vartype input: Any + """ + + type: Required[Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API]] + """The manual dispatch payload type. Required. A manual payload for a responses API routine + dispatch.""" + input: Required[Any] + """The JSON value sent as the complete downstream responses input. The value is passed through + as-is and can be an object, string, number, boolean, array, or null. Required.""" + + +class InvokeAgentResponsesApiRoutineAction(TypedDict, total=False): + """Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id + must be provided. + + :ivar type: The action type. Required. Dispatches through the responses API. + :vartype type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + :ivar agent_name: The project-scoped agent name for routine dispatch. + :vartype agent_name: str + :ivar agent_endpoint_id: Legacy endpoint-scoped agent identifier for routine dispatch. + :vartype agent_endpoint_id: str + :ivar input: Static JSON value sent as the complete downstream input when the routine fires. + The value is passed through as-is; no templating is applied. + :vartype input: Any + :ivar conversation: An optional existing conversation identifier to continue during the + downstream dispatch. + :vartype conversation: str + """ + + type: Required[Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API]] + """The action type. Required. Dispatches through the responses API.""" + agent_name: str + """The project-scoped agent name for routine dispatch.""" + agent_endpoint_id: str + """Legacy endpoint-scoped agent identifier for routine dispatch.""" + input: Any + """Static JSON value sent as the complete downstream input when the routine fires. The value is + passed through as-is; no templating is applied.""" + conversation: str + """An optional existing conversation identifier to continue during the downstream dispatch.""" + + +class LocalShellToolParam(TypedDict, total=False): + """Local shell tool. + + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL. + :vartype type: Literal[ToolType.LOCAL_SHELL] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + """ + + type: Required[Literal[ToolType.LOCAL_SHELL]] + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class LocalSkillParam(TypedDict, total=False): + """LocalSkillParam. + + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar description: The description of the skill. Required. + :vartype description: str + :ivar path: The path to the directory containing the skill. Required. + :vartype path: str + """ + + name: Required[str] + """The name of the skill. Required.""" + description: Required[str] + """The description of the skill. Required.""" + path: Required[str] + """The path to the directory containing the skill. Required.""" + + +class LoraConfig(TypedDict, total=False): + """Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment + time. + + :ivar rank: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + :vartype rank: int + :ivar alpha: LoRA scaling factor (α). Positive integer; typically 2× the rank. + :vartype alpha: int + :ivar target_modules: Model layers modified by the adapter (e.g., q_proj, v_proj). + Auto-detected from adapter_config.json if omitted. + :vartype target_modules: list[str] + :ivar dropout: Dropout rate used during training. Informational — not used at serving time. + :vartype dropout: float + """ + + rank: int + """LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.""" + alpha: int + """LoRA scaling factor (α). Positive integer; typically 2× the rank.""" + targetModules: list[str] + """Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + adapter_config.json if omitted.""" + dropout: float + """Dropout rate used during training. Informational — not used at serving time.""" + + +class ManagedAgentIdentityBlueprintReference(TypedDict, total=False): + """ManagedAgentIdentityBlueprintReference. + + :ivar type: Required. MANAGED_AGENT_IDENTITY_BLUEPRINT. + :vartype type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + :ivar blueprint_id: The ID of the managed blueprint. Required. + :vartype blueprint_id: str + """ + + type: Required[Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT]] + """Required. MANAGED_AGENT_IDENTITY_BLUEPRINT.""" + blueprint_id: Required[str] + """The ID of the managed blueprint. Required.""" + + +class ManagedAzureAISearchIndex(TypedDict, total=False): + """Managed Azure AI Search Index Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Managed Azure Search. + :vartype type: Literal[IndexType.MANAGED_AZURE_SEARCH] + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str + """ + + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + type: Required[Literal[IndexType.MANAGED_AZURE_SEARCH]] + """Type of index. Required. Managed Azure Search.""" + vectorStoreId: Required[str] + """Vector store id of managed index. Required.""" + + +class McpProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the MCP protocol.""" + + +class MCPTool(TypedDict, total=False): + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. MCP. + :vartype type: Literal[ToolType.MCP] + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here `_. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + :vartype connector_id: Literal["connector_dropbox", "connector_gmail", + "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", + "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: Union[list[str], "MCPToolFilter"] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + """ + + type: Required[Literal[ToolType.MCP]] + """The type of the MCP tool. Always ``mcp``. Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. Currently supported ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: str + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: str + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + + +class MCPToolboxTool(TypedDict, total=False): + """An MCP tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. MCP. + :vartype type: Literal[ToolboxToolType.MCP] + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url``, ``connector_id``, or + ``tunnel_id`` must be provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service + connectors `here `_. Currently supported + ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + :vartype connector_id: Literal["connector_dropbox", "connector_gmail", + "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", + "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"] + :ivar tunnel_id: The Secure MCP Tunnel ID to use instead of a direct server URL. One of + ``server_url``, ``connector_id``, or ``tunnel_id`` must be provided. + :vartype tunnel_id: str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application must handle the OAuth + authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: Union[list[str], "MCPToolFilter"] + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: Union["MCPToolRequireApproval", Literal["always"], Literal["never"]] + :ivar defer_loading: Whether this MCP tool is deferred and discovered via tool search. + :vartype defer_loading: bool + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.MCP]] + """Required. MCP.""" + server_label: Required[str] + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: str + """The URL for the MCP server. One of ``server_url``, ``connector_id``, or ``tunnel_id`` must be + provided.""" + connector_id: Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + """Identifier for service connectors, like those available in ChatGPT. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided. Learn more about service connectors `here + `_. Currently supported ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + tunnel_id: str + """The Secure MCP Tunnel ID to use instead of a direct server URL. One of ``server_url``, + ``connector_id``, or ``tunnel_id`` must be provided.""" + authorization: str + """An OAuth access token that can be used with a remote MCP server, either with a custom MCP + server URL or a service connector. Your application must handle the OAuth authorization flow + and provide the token here.""" + server_description: str + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] + allowed_tools: Optional[Union[list[str], "MCPToolFilter"]] + """Is either a [str] type or a MCPToolFilter type.""" + require_approval: Optional[Union["MCPToolRequireApproval", Literal["always"], Literal["never"]]] + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: bool + """Whether this MCP tool is deferred and discovered via tool search.""" + project_connection_id: str + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + + +class MCPToolFilter(TypedDict, total=False): + """MCP tool filter. + + :ivar tool_names: MCP allowed tools. + :vartype tool_names: list[str] + :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an MCP + server is `annotated with `readOnlyHint` + `_, + it will match this filter. + :vartype read_only: bool + """ + + tool_names: list[str] + """MCP allowed tools.""" + read_only: bool + """Indicates whether or not a tool modifies data or is read-only. If an MCP server is `annotated + with `readOnlyHint` + `_, + it will match this filter.""" + + +class MCPToolRequireApproval(TypedDict, total=False): + """MCPToolRequireApproval. + + :ivar always: + :vartype always: "MCPToolFilter" + :ivar never: + :vartype never: "MCPToolFilter" + """ + + always: "MCPToolFilter" + never: "MCPToolFilter" + + +class MemorySearchOptions(TypedDict, total=False): + """Memory search options. + + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int + """ + + max_memories: int + """Maximum number of memory items to return.""" + + +class MemorySearchPreviewTool(TypedDict, total=False): + """A tool for integrating memories into the agent. + + :ivar type: The type of the tool. Always ``memory_search_preview``. Required. + MEMORY_SEARCH_PREVIEW. + :vartype type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + :ivar memory_store_name: The name of the memory store to use. Required. + :vartype memory_store_name: str + :ivar scope: The namespace used to group and isolate memories, such as a user ID. Limits which + memories can be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to + the current signed-in user. Required. + :vartype scope: str + :ivar search_options: Options for searching the memory store. + :vartype search_options: "MemorySearchOptions" + :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default + 300. + :vartype update_delay: int + """ + + type: Required[Literal[ToolType.MEMORY_SEARCH_PREVIEW]] + """The type of the tool. Always ``memory_search_preview``. Required. MEMORY_SEARCH_PREVIEW.""" + memory_store_name: Required[str] + """The name of the memory store to use. Required.""" + scope: Required[str] + """The namespace used to group and isolate memories, such as a user ID. Limits which memories can + be retrieved or updated. Use special variable ``{{$userId}}`` to scope memories to the current + signed-in user. Required.""" + search_options: "MemorySearchOptions" + """Options for searching the memory store.""" + update_delay: int + """Time to wait before updating memories after inactivity (seconds). Default 300.""" + + +class MemoryStoreDefaultDefinition(TypedDict, total=False): + """Default memory store implementation. + + :ivar kind: The kind of the memory store. Required. The default memory store implementation. + :vartype kind: Literal[MemoryStoreKind.DEFAULT] + :ivar chat_model: The name or identifier of the chat completion model deployment used for + memory processing. Required. + :vartype chat_model: str + :ivar embedding_model: The name or identifier of the embedding model deployment used for memory + processing. Required. + :vartype embedding_model: str + :ivar options: Default memory store options. + :vartype options: "MemoryStoreDefaultOptions" + """ + + kind: Required[Literal[MemoryStoreKind.DEFAULT]] + """The kind of the memory store. Required. The default memory store implementation.""" + chat_model: Required[str] + """The name or identifier of the chat completion model deployment used for memory processing. + Required.""" + embedding_model: Required[str] + """The name or identifier of the embedding model deployment used for memory processing. Required.""" + options: "MemoryStoreDefaultOptions" + """Default memory store options.""" + + +class MemoryStoreDefaultOptions(TypedDict, total=False): + """Default memory store configurations. + + :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is + true. Required. + :vartype user_profile_enabled: bool + :ivar user_profile_details: Specific categories or types of user profile information to extract + and store. + :vartype user_profile_details: str + :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to + ``true``. Required. + :vartype chat_summary_enabled: bool + :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. + The service defaults to ``true`` if a value is not specified by the caller. + :vartype procedural_memory_enabled: bool + :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` + indicates that memories do not expire. Defaults to ``0``. + :vartype default_ttl_seconds: str + """ + + user_profile_enabled: Required[bool] + """Whether to enable user profile extraction and storage. Default is true. Required.""" + user_profile_details: str + """Specific categories or types of user profile information to extract and store.""" + chat_summary_enabled: Required[bool] + """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" + procedural_memory_enabled: bool + """Whether to enable procedural memory extraction and storage. The service defaults to ``true`` if + a value is not specified by the caller.""" + default_ttl_seconds: str + """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do + not expire. Defaults to ``0``.""" + + +class MicrosoftFabricPreviewTool(TypedDict, total=False): + """The input definition information for a Microsoft Fabric tool as used to configure an agent. + + :ivar type: The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW. + :vartype type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. + :vartype fabric_dataagent_preview: "FabricDataAgentToolParameters" + """ + + type: Required[Literal[ToolType.FABRIC_DATAAGENT_PREVIEW]] + """The object type, which is always 'fabric_dataagent_preview'. Required. + FABRIC_DATAAGENT_PREVIEW.""" + fabric_dataagent_preview: Required["FabricDataAgentToolParameters"] + """The fabric data agent tool parameters. Required.""" + + +class ModelCredentialRequest(TypedDict, total=False): + """Request to fetch credentials for a model asset. + + :ivar blob_uri: Blob URI of the model asset to fetch credentials for. Required. + :vartype blob_uri: str + """ + + blobUri: Required[str] + """Blob URI of the model asset to fetch credentials for. Required.""" + + +class ModelPendingUploadRequest(TypedDict, total=False): + """Represents a request for a pending upload of a model version. + + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Only TemporaryBlobReference is supported + for models. Required. Temporary blob reference. + :vartype pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + """ + + pendingUploadId: str + """If PendingUploadId is not provided, a random GUID will be used.""" + connectionName: str + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pendingUploadType: Required[Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE]] + """The type of pending upload. Only TemporaryBlobReference is supported for models. Required. + Temporary blob reference.""" + + +class ModelSamplingParams(TypedDict, total=False): + """Represents a set of parameters used to control the sampling behavior of a language model during + text generation. + + :ivar temperature: The temperature parameter for sampling. Defaults to 1.0. + :vartype temperature: float + :ivar top_p: The top-p parameter for nucleus sampling. Defaults to 1.0. + :vartype top_p: float + :ivar seed: The random seed for reproducibility. Defaults to 42. + :vartype seed: int + :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. + :vartype max_completion_tokens: int + """ + + temperature: float + """The temperature parameter for sampling. Defaults to 1.0.""" + top_p: float + """The top-p parameter for nucleus sampling. Defaults to 1.0.""" + seed: int + """The random seed for reproducibility. Defaults to 42.""" + max_completion_tokens: int + """The maximum number of tokens allowed in the completion.""" + + +class ModelSourceData(TypedDict, total=False): + """Source information for the model. + + :ivar source_type: The source type of the model. Known values are: "LocalUpload" and + "TrainingJob". + :vartype source_type: Union[str, "FoundryModelSourceType"] + :ivar job_id: The job ID that produced this model. + :vartype job_id: str + """ + + sourceType: Union[str, "FoundryModelSourceType"] + """The source type of the model. Known values are: \"LocalUpload\" and \"TrainingJob\".""" + jobId: str + """The job ID that produced this model.""" + + +class ModelVersion(TypedDict, total=False): + """Model Version Definition. + + :ivar blob_uri: URI of the model artifact in blob storage. Required. + :vartype blob_uri: str + :ivar weight_type: The weight type of the model. Known values are: "FullWeight", "LoRA", and + "DraftModel". + :vartype weight_type: Union[str, "FoundryModelWeightType"] + :ivar base_model: Base model asset ID. + :vartype base_model: str + :ivar source: The source of the model. + :vartype source: "ModelSourceData" + :ivar lora_config: Adapter-specific configuration. Required when weight_type is lora; ignored + otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — + user-provided values take precedence over auto-detected values. + :vartype lora_config: "LoraConfig" + :ivar artifact_profile: The artifact profile of the model. + :vartype artifact_profile: "ArtifactProfile" + :ivar warnings: Service-computed advisory warnings derived from the artifact profile. + :vartype warnings: list["FoundryModelWarning"] + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + """ + + blobUri: Required[str] + """URI of the model artifact in blob storage. Required.""" + weightType: Union[str, "FoundryModelWeightType"] + """The weight type of the model. Known values are: \"FullWeight\", \"LoRA\", and \"DraftModel\".""" + baseModel: str + """Base model asset ID.""" + source: "ModelSourceData" + """The source of the model.""" + loraConfig: "LoraConfig" + """Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be + auto-populated from adapter_config.json when present in the uploaded files — user-provided + values take precedence over auto-detected values.""" + artifactProfile: "ArtifactProfile" + """The artifact profile of the model.""" + warnings: list["FoundryModelWarning"] + """Service-computed advisory warnings derived from the artifact profile.""" + id: str + """Asset ID, a unique identifier for the asset.""" + name: Required[str] + """The name of the resource. Required.""" + version: Required[str] + """The version of the resource. Required.""" + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class MonthlyRecurrenceSchedule(TypedDict, total=False): + """Monthly recurrence schedule. + + :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. + :vartype type: Literal[RecurrenceType.MONTHLY] + :ivar days_of_month: Days of the month for the recurrence schedule. Required. + :vartype days_of_month: list[int] + """ + + type: Required[Literal[RecurrenceType.MONTHLY]] + """Monthly recurrence type. Required. Monthly recurrence pattern.""" + daysOfMonth: Required[list[int]] + """Days of the month for the recurrence schedule. Required.""" + + +class NamespaceToolParam(TypedDict, total=False): + """Namespace. + + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: Literal[ToolType.NAMESPACE] + :ivar name: The namespace name used in tool calls (for example, ``crm``). Required. + :vartype name: str + :ivar description: A description of the namespace shown to the model. Required. + :vartype description: str + :ivar tools: The function/custom tools available inside this namespace. Required. + :vartype tools: list[Union["FunctionToolParam", "CustomToolParam"]] + """ + + type: Required[Literal[ToolType.NAMESPACE]] + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: Required[str] + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: Required[str] + """A description of the namespace shown to the model. Required.""" + tools: Required[list[Union["FunctionToolParam", "CustomToolParam"]]] + """The function/custom tools available inside this namespace. Required.""" + + +class OneTimeTrigger(TypedDict, total=False): + """One-time trigger. + + :ivar type: Required. One-time trigger. + :vartype type: Literal[TriggerType.ONE_TIME] + :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype trigger_at: str + :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. + :vartype time_zone: str + """ + + type: Required[Literal[TriggerType.ONE_TIME]] + """Required. One-time trigger.""" + triggerAt: Required[str] + """Date and time for the one-time trigger in ISO 8601 format. Required.""" + timeZone: str + """Time zone for the one-time trigger. Defaults to ``UTC``.""" + + +class OpenApiAnonymousAuthDetails(TypedDict, total=False): + """Security details for OpenApi anonymous authentication. + + :ivar type: The object type, which is always 'anonymous'. Required. ANONYMOUS. + :vartype type: Literal[OpenApiAuthType.ANONYMOUS] + """ + + type: Required[Literal[OpenApiAuthType.ANONYMOUS]] + """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" + + +class OpenApiFunctionDefinition(TypedDict, total=False): + """The input definition information for an openapi function. + + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar spec: The openapi function shape, described as a JSON Schema object. Required. + :vartype spec: dict[str, Any] + :ivar auth: Open API authentication details. Required. + :vartype auth: "OpenApiAuthDetails" + :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. + :vartype default_params: list[str] + :ivar functions: List of function definitions used by OpenApi tool. + :vartype functions: list["OpenApiFunctionDefinitionFunction"] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + spec: Required[dict[str, Any]] + """The openapi function shape, described as a JSON Schema object. Required.""" + auth: Required["OpenApiAuthDetails"] + """Open API authentication details. Required.""" + default_params: list[str] + """List of OpenAPI spec parameters that will use user-provided defaults.""" + functions: list["OpenApiFunctionDefinitionFunction"] + """List of function definitions used by OpenApi tool.""" + + +class OpenApiFunctionDefinitionFunction(TypedDict, total=False): + """OpenApiFunctionDefinitionFunction. + + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: dict[str, Any] + """ + + name: Required[str] + """The name of the function to be called. Required.""" + description: str + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Required[dict[str, Any]] + """The parameters the functions accepts, described as a JSON Schema object. Required.""" + + +class OpenApiManagedAuthDetails(TypedDict, total=False): + """Security details for OpenApi managed_identity authentication. + + :ivar type: The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY. + :vartype type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + :ivar security_scheme: Connection auth security details. Required. + :vartype security_scheme: "OpenApiManagedSecurityScheme" + """ + + type: Required[Literal[OpenApiAuthType.MANAGED_IDENTITY]] + """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" + security_scheme: Required["OpenApiManagedSecurityScheme"] + """Connection auth security details. Required.""" + + +class OpenApiManagedSecurityScheme(TypedDict, total=False): + """Security scheme for OpenApi managed_identity authentication. + + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str + """ + + audience: Required[str] + """Authentication scope for managed_identity auth type. Required.""" + + +class OpenApiProjectConnectionAuthDetails(TypedDict, total=False): + """Security details for OpenApi project connection authentication. + + :ivar type: The object type, which is always 'project_connection'. Required. + PROJECT_CONNECTION. + :vartype type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + :ivar security_scheme: Project connection auth security details. Required. + :vartype security_scheme: "OpenApiProjectConnectionSecurityScheme" + """ + + type: Required[Literal[OpenApiAuthType.PROJECT_CONNECTION]] + """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" + security_scheme: Required["OpenApiProjectConnectionSecurityScheme"] + """Project connection auth security details. Required.""" + + +class OpenApiProjectConnectionSecurityScheme(TypedDict, total=False): + """Security scheme for OpenApi managed_identity authentication. + + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str + """ + + project_connection_id: Required[str] + """Project connection id for Project Connection auth type. Required.""" + + +class OpenApiTool(TypedDict, total=False): + """The input definition information for an OpenAPI tool as used to configure an agent. + + :ivar type: The object type, which is always 'openapi'. Required. OPENAPI. + :vartype type: Literal[ToolType.OPENAPI] + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: "OpenApiFunctionDefinition" + """ + + type: Required[Literal[ToolType.OPENAPI]] + """The object type, which is always 'openapi'. Required. OPENAPI.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + openapi: Required["OpenApiFunctionDefinition"] + """The openapi function definition. Required.""" + + +class OpenApiToolboxTool(TypedDict, total=False): + """An OpenAPI tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. OPENAPI. + :vartype type: Literal[ToolboxToolType.OPENAPI] + :ivar openapi: The openapi function definition. Required. + :vartype openapi: "OpenApiFunctionDefinition" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.OPENAPI]] + """Required. OPENAPI.""" + openapi: Required["OpenApiFunctionDefinition"] + """The openapi function definition. Required.""" + + +class OptimizationAgentIdentifier(TypedDict, total=False): + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. + + :ivar agent_name: Registered Foundry agent name (required). Required. + :vartype agent_name: str + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. + :vartype agent_version: str + """ + + agent_name: Required[str] + """Registered Foundry agent name (required). Required.""" + agent_version: str + """Pinned agent version. Defaults to latest if omitted.""" + + +class OptimizationCandidate(TypedDict, total=False): + """Aggregated evaluation result for a single candidate agent configuration across all tasks. + + :ivar candidate_id: Server-assigned candidate identifier. Use with GET /candidates/{id} + sub-endpoints. + :vartype candidate_id: str + :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. + :vartype name: str + :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + :vartype mutations: dict[str, Any] + :ivar avg_score: Average composite score across all tasks. Required. + :vartype avg_score: float + :ivar avg_tokens: Average token usage across all tasks. Required. + :vartype avg_tokens: float + :ivar eval_id: Foundry evaluation identifier used to score this candidate. + :vartype eval_id: str + :ivar eval_run_id: Foundry evaluation run identifier for this candidate's scoring run. + :vartype eval_run_id: str + :ivar promotion: Promotion metadata. Null if the candidate has not been promoted. + :vartype promotion: "PromotionInfo" + """ + + candidate_id: str + """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" + name: Required[str] + """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" + mutations: dict[str, Any] + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" + avg_score: Required[float] + """Average composite score across all tasks. Required.""" + avg_tokens: Required[float] + """Average token usage across all tasks. Required.""" + eval_id: str + """Foundry evaluation identifier used to score this candidate.""" + eval_run_id: str + """Foundry evaluation run identifier for this candidate's scoring run.""" + promotion: "PromotionInfo" + """Promotion metadata. Null if the candidate has not been promoted.""" + + +class OptimizationDatasetCriterion(TypedDict, total=False): + """Evaluation criterion: a name + instruction pair used for per-item scoring. + + :ivar name: Criterion name. Required. + :vartype name: str + :ivar instruction: Criterion instruction / description. Required. + :vartype instruction: str + """ + + name: Required[str] + """Criterion name. Required.""" + instruction: Required[str] + """Criterion instruction / description. Required.""" + + +class OptimizationDatasetItem(TypedDict, total=False): + """A single item in an inline dataset. + + :ivar query: The user query / prompt. + :vartype query: str + :ivar ground_truth: Expected ground truth answer. + :vartype ground_truth: str + :ivar desired_num_turns: Desired number of conversation turns for simulation mode (1-20). + :vartype desired_num_turns: int + :ivar criteria: Per-item evaluation criteria. + :vartype criteria: list["OptimizationDatasetCriterion"] + """ + + query: str + """The user query / prompt.""" + ground_truth: str + """Expected ground truth answer.""" + desired_num_turns: int + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: list["OptimizationDatasetCriterion"] + """Per-item evaluation criteria.""" + + +class OptimizationEvaluatorRef(TypedDict, total=False): + """Reference to a named evaluator, optionally pinned to a version. + + :ivar name: Evaluator name. Required. + :vartype name: str + :ivar version: Evaluator version. If not specified, the latest version is used. + :vartype version: str + """ + + name: Required[str] + """Evaluator name. Required.""" + version: str + """Evaluator version. If not specified, the latest version is used.""" + + +class OptimizationInlineDatasetInput(TypedDict, total=False): + """Inline dataset — items supplied directly in the request body. + + :ivar type: Dataset input type discriminator. Required. Inline dataset — items are provided + directly in the request body. + :vartype type: Literal[OptimizationDatasetInputType.INLINE] + :ivar dataset_items: Dataset items. Required. + :vartype dataset_items: list["OptimizationDatasetItem"] + """ + + type: Required[Literal[OptimizationDatasetInputType.INLINE]] + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + items: Required[list["OptimizationDatasetItem"]] + """Dataset items. Required.""" + + +class OptimizationJob(TypedDict, total=False): + """Agent optimization job resource — a long-running job that optimizes an agent's configuration + (instructions, model, skills, tools) to maximize evaluation scores. On success, the result + contains scored candidates. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: "OptimizationJobInputs" + :ivar result: Result produced on success. + :vartype result: "OptimizationJobResult" + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: Union[str, "JobStatus"] + :ivar error: Error details — populated only on failure. + :vartype error: "ApiError" + :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: int + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: int + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: "OptimizationJobProgress" + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] + """ + + id: Required[str] + """Server-assigned unique identifier. Required.""" + inputs: "OptimizationJobInputs" + """Caller-supplied inputs.""" + result: "OptimizationJobResult" + """Result produced on success.""" + status: Required[Union[str, "JobStatus"]] + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: "ApiError" + """Error details — populated only on failure.""" + created_at: Required[int] + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: Required[int] + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: "OptimizationJobProgress" + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: list[str] + """Non-fatal warnings emitted at any point during optimization.""" + + +class OptimizationJobInputs(TypedDict, total=False): + """Caller-supplied inputs for an optimization job. + + :ivar agent: The agent (and pinned version) being optimized. Required. + :vartype agent: "OptimizationAgentIdentifier" + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: "OptimizationDatasetInput" + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: "OptimizationDatasetInput" + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list["OptimizationEvaluatorRef"] + :ivar options: Tuning knobs and run-mode. + :vartype options: "OptimizationOptions" + """ + + agent: Required["OptimizationAgentIdentifier"] + """The agent (and pinned version) being optimized. Required.""" + train_dataset: Required["OptimizationDatasetInput"] + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: "OptimizationDatasetInput" + """Optional held-out validation dataset for measuring generalization of the final candidate.""" + evaluators: Required[list["OptimizationEvaluatorRef"]] + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" + options: "OptimizationOptions" + """Tuning knobs and run-mode.""" + + +class OptimizationJobProgress(TypedDict, total=False): + """In-flight progress; only populated while status is queued or in_progress. + + :ivar candidates_completed: Number of candidates whose evaluation has completed so far. + Required. + :vartype candidates_completed: int + :ivar best_score: Best score observed so far across all candidates. Required. + :vartype best_score: float + :ivar elapsed_seconds: Wall-clock time elapsed in seconds since the job began executing. + Required. + :vartype elapsed_seconds: float + """ + + candidates_completed: Required[int] + """Number of candidates whose evaluation has completed so far. Required.""" + best_score: Required[float] + """Best score observed so far across all candidates. Required.""" + elapsed_seconds: Required[float] + """Wall-clock time elapsed in seconds since the job began executing. Required.""" + + +class OptimizationJobResult(TypedDict, total=False): + """Terminal-state result body. Populated when status is succeeded or failed. + + :ivar baseline: Candidate ID of the original (un-optimized) baseline evaluation. + :vartype baseline: str + :ivar best: Candidate ID of the highest-scoring candidate found during optimization. + :vartype best: str + :ivar candidates: All evaluated candidates including baseline. + :vartype candidates: list["OptimizationCandidate"] + """ + + baseline: str + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: str + """Candidate ID of the highest-scoring candidate found during optimization.""" + candidates: list["OptimizationCandidate"] + """All evaluated candidates including baseline.""" + + +class OptimizationOptions(TypedDict, total=False): + """Tuning knobs and run-mode for an optimization job. + + :ivar max_candidates: Maximum number of optimization candidates to generate. Must be >= 1. + Default: 5. + :vartype max_candidates: int + :ivar optimization_config: Per-target-attribute configuration overrides. Contains skills, + tools, system_prompt for the agent, plus model space for model optimization. + :vartype optimization_config: dict[str, Any] + :ivar eval_model: Model deployment used for evaluation. Defaults to server config (typically + 'gpt-4o'). + :vartype eval_model: str + :ivar optimization_model: Model deployment for optimization reasoning (must be gpt-5 family). + Falls back to the default eval model when not set. + :vartype optimization_model: str + :ivar evaluation_level: Evaluation granularity. Null/omitted means per-item single-turn. Set to + 'conversation' for per-conversation multi-turn simulation scoring. Known values are: "turn" and + "conversation". + :vartype evaluation_level: Union[str, "EvaluationLevel"] + """ + + max_candidates: int + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" + optimization_config: dict[str, Any] + """Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the + agent, plus model space for model optimization.""" + eval_model: str + """Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o').""" + optimization_model: str + """Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default + eval model when not set.""" + evaluation_level: Union[str, "EvaluationLevel"] + """Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for + per-conversation multi-turn simulation scoring. Known values are: \"turn\" and + \"conversation\".""" + + +class OptimizationReferenceDatasetInput(TypedDict, total=False): + """Reference to a registered Foundry dataset. + + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: Literal[OptimizationDatasetInputType.REFERENCE] + :ivar name: Registered dataset name. Required. + :vartype name: str + :ivar version: Dataset version. If not specified, the latest version is used. + :vartype version: str + """ + + type: Required[Literal[OptimizationDatasetInputType.REFERENCE]] + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: Required[str] + """Registered dataset name. Required.""" + version: str + """Dataset version. If not specified, the latest version is used.""" + + +class OtlpTelemetryEndpoint(TypedDict, total=False): + """An OTLP (OpenTelemetry Protocol) telemetry export endpoint. + + :ivar data: Data types to export to this endpoint. Use an empty array to export no data. + Required. + :vartype data: list[Union[str, "TelemetryDataKind"]] + :ivar auth: Optional authentication configuration. + :vartype auth: "TelemetryEndpointAuth" + :ivar kind: The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. + OpenTelemetry Protocol (OTLP) endpoint. + :vartype kind: Literal[TelemetryEndpointKind.OTLP] + :ivar endpoint: The OTLP collector endpoint URL. Required. + :vartype endpoint: str + :ivar protocol: The transport protocol for the OTLP endpoint. Required. Known values are: + "Http" and "Grpc". + :vartype protocol: Union[str, "TelemetryTransportProtocol"] + """ + + data: Required[list[Union[str, "TelemetryDataKind"]]] + """Data types to export to this endpoint. Use an empty array to export no data. Required.""" + auth: "TelemetryEndpointAuth" + """Optional authentication configuration.""" + kind: Required[Literal[TelemetryEndpointKind.OTLP]] + """The endpoint kind, always 'OTLP' for OpenTelemetry Protocol endpoints. Required. OpenTelemetry + Protocol (OTLP) endpoint.""" + endpoint: Required[str] + """The OTLP collector endpoint URL. Required.""" + protocol: Required[Union[str, "TelemetryTransportProtocol"]] + """The transport protocol for the OTLP endpoint. Required. Known values are: \"Http\" and + \"Grpc\".""" + + +class PendingUploadRequest(TypedDict, total=False): + """Represents a request for a pending upload. + + :ivar pending_upload_id: If PendingUploadId is not provided, a random GUID will be used. + :vartype pending_upload_id: str + :ivar connection_name: Azure Storage Account connection name to use for generating temporary + SAS token. + :vartype connection_name: str + :ivar pending_upload_type: The type of pending upload. Required. Deprecated: the service never + read this value and silently ignored it. Use TemporaryBlobReference instead. + :vartype pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + """ + + pendingUploadId: str + """If PendingUploadId is not provided, a random GUID will be used.""" + connectionName: str + """Azure Storage Account connection name to use for generating temporary SAS token.""" + pendingUploadType: Required[Literal[PendingUploadType.BLOB_REFERENCE]] + """The type of pending upload. Required. Deprecated: the service never read this value and + silently ignored it. Use TemporaryBlobReference instead.""" + + +class PromotionInfo(TypedDict, total=False): + """Promotion metadata recorded when a candidate is deployed to a Foundry agent. + + :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. + :vartype promoted_at: int + :ivar agent_name: Name of the Foundry agent this candidate was promoted to. Required. + :vartype agent_name: str + :ivar agent_version: Version of the Foundry agent this candidate was promoted to. Required. + :vartype agent_version: str + """ + + promoted_at: Required[int] + """Timestamp when promotion occurred, represented in Unix time. Required.""" + agent_name: Required[str] + """Name of the Foundry agent this candidate was promoted to. Required.""" + agent_version: Required[str] + """Version of the Foundry agent this candidate was promoted to. Required.""" + + +class PromptAgentDefinition(TypedDict, total=False): + """The prompt agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. PROMPT. + :vartype kind: Literal[AgentKind.PROMPT] + :ivar model: The model deployment to use for this agent. Required. + :vartype model: str + :ivar instructions: A system (or developer) message inserted into the model's context. + :vartype instructions: str + :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 + will make the output more random, while lower values like 0.2 will make it more focused and + deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to + ``1``. + :vartype temperature: float + :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 means only the + tokens comprising the top 10% probability mass are considered. We generally recommend altering + this or ``temperature`` but not both. Defaults to ``1``. + :vartype top_p: float + :ivar reasoning: + :vartype reasoning: "Reasoning" + :ivar tools: An array of tools the model may call while generating a response. You can specify + which tool to use by setting the ``tool_choice`` parameter. + :vartype tools: list["Tool"] + :ivar tool_choice: How the model should select which tool (or tools) to use when generating a + response. See the ``tools`` parameter to see how to specify which tools the model can call. Is + either a str type or a ToolChoiceParam type. + :vartype tool_choice: Union[str, "ToolChoiceParam"] + :ivar text: Configuration options for a text response from the model. Can be plain text or + structured JSON data. + :vartype text: "PromptAgentDefinitionTextOptions" + :ivar structured_inputs: Set of structured inputs that can participate in prompt template + substitution or tool argument bindings. + :vartype structured_inputs: dict[str, "StructuredInputDefinition"] + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.PROMPT]] + """Required. PROMPT.""" + model: Required[str] + """The model deployment to use for this agent. Required.""" + instructions: Optional[str] + """A system (or developer) message inserted into the model's context.""" + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output + more random, while lower values like 0.2 will make it more focused and deterministic. We + generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" + top_p: Optional[float] + """An alternative to sampling with temperature, called nucleus sampling, where the model considers + the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising + the top 10% probability mass are considered. We generally recommend altering this or + ``temperature`` but not both. Defaults to ``1``.""" + reasoning: Optional["Reasoning"] + tools: list["Tool"] + """An array of tools the model may call while generating a response. You can specify which tool to + use by setting the ``tool_choice`` parameter.""" + tool_choice: Union[str, "ToolChoiceParam"] + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. Is either a str type + or a ToolChoiceParam type.""" + text: "PromptAgentDefinitionTextOptions" + """Configuration options for a text response from the model. Can be plain text or structured JSON + data.""" + structured_inputs: dict[str, "StructuredInputDefinition"] + """Set of structured inputs that can participate in prompt template substitution or tool argument + bindings.""" + + +class PromptAgentDefinitionTextOptions(TypedDict, total=False): + """Configuration options for a text response from the model. Can be plain text or structured JSON + data. + + :ivar format: + :vartype format: "TextResponseFormat" + """ + + format: "TextResponseFormat" + + +class PromptBasedEvaluatorDefinition(TypedDict, total=False): + """Prompt-based evaluator. + + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, Any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, Any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, "EvaluatorMetric"] + :ivar type: Required. Prompt-based definition. + :vartype type: Literal[EvaluatorDefinitionType.PROMPT] + :ivar prompt_text: The prompt text used for evaluation. Required. + :vartype prompt_text: str + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.PROMPT]] + """Required. Prompt-based definition.""" + prompt_text: Required[str] + """The prompt text used for evaluation. Required.""" + + +class PromptDataGenerationJobSource(TypedDict, total=False): + """Prompt source for data generation jobs — inline text provided by the user. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: Literal[DataGenerationJobSourceType.PROMPT] + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[DataGenerationJobSourceType.PROMPT]] + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: Required[str] + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + + +class PromptEvaluatorGenerationJobSource(TypedDict, total=False): + """Prompt source for evaluator generation jobs — inline text provided by the user. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Prompt. Required. Prompt source — inline + text provided by the user. + :vartype type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + :ivar prompt: Inline prompt text (e.g., agent description, policy text, supplementary context). + Required. + :vartype prompt: str + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[EvaluatorGenerationJobSourceType.PROMPT]] + """The source type for this source, which is Prompt. Required. Prompt source — inline text + provided by the user.""" + prompt: Required[str] + """Inline prompt text (e.g., agent description, policy text, supplementary context). Required.""" + + +class ProtocolConfiguration(TypedDict, total=False): + """Per-protocol configuration for the agent endpoint. + + :ivar activity: Configuration for the activity protocol. + :vartype activity: "ActivityProtocolConfiguration" + :ivar responses: Configuration for the responses protocol. + :vartype responses: "ResponsesProtocolConfiguration" + :ivar a2a: Configuration for the A2A protocol. + :vartype a2a: "A2AProtocolConfiguration" + :ivar mcp: Configuration for the MCP protocol. + :vartype mcp: "McpProtocolConfiguration" + :ivar invocations: Configuration for the invocations protocol. + :vartype invocations: "InvocationsProtocolConfiguration" + :ivar invocations_ws: Configuration for the WebSocket-based invocations protocol. + :vartype invocations_ws: "InvocationsWsProtocolConfiguration" + """ + + activity: "ActivityProtocolConfiguration" + """Configuration for the activity protocol.""" + responses: "ResponsesProtocolConfiguration" + """Configuration for the responses protocol.""" + a2a: "A2AProtocolConfiguration" + """Configuration for the A2A protocol.""" + mcp: "McpProtocolConfiguration" + """Configuration for the MCP protocol.""" + invocations: "InvocationsProtocolConfiguration" + """Configuration for the invocations protocol.""" + invocations_ws: "InvocationsWsProtocolConfiguration" + """Configuration for the WebSocket-based invocations protocol.""" + + +class ProtocolVersionRecord(TypedDict, total=False): + """A record mapping for a single protocol and its version. + + :ivar protocol: The protocol type. Required. Known values are: "activity", "responses", "a2a", + "mcp", "invocations", and "invocations_ws". + :vartype protocol: Union[str, "AgentEndpointProtocol"] + :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :vartype version: str + """ + + protocol: Required[Union[str, "AgentEndpointProtocol"]] + """The protocol type. Required. Known values are: \"activity\", \"responses\", \"a2a\", \"mcp\", + \"invocations\", and \"invocations_ws\".""" + version: Required[str] + """The version string for the protocol, e.g. 'v0.1.1'. Required.""" + + +class RaiConfig(TypedDict, total=False): + """Configuration for Responsible AI (RAI) content filtering and safety features. + + :ivar rai_policy_name: The name of the RAI policy to apply. Required. + :vartype rai_policy_name: str + """ + + rai_policy_name: Required[str] + """The name of the RAI policy to apply. Required.""" + + +class RankingOptions(TypedDict, total=False): + """RankingOptions. + + :ivar ranker: The ranker to use for the file search. Known values are: "auto" and + "default-2024-11-15". + :vartype ranker: Union[str, "RankerVersionType"] + :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. + Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer + results. + :vartype score_threshold: float + :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic + embedding matches versus sparse keyword matches when hybrid search is enabled. + :vartype hybrid_search: "HybridSearchOptions" + """ + + ranker: Union[str, "RankerVersionType"] + """The ranker to use for the file search. Known values are: \"auto\" and \"default-2024-11-15\".""" + score_threshold: float + """The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will + attempt to return only the most relevant results, but may return fewer results.""" + hybrid_search: "HybridSearchOptions" + """Weights that control how reciprocal rank fusion balances semantic embedding matches versus + sparse keyword matches when hybrid search is enabled.""" + + +class Reasoning(TypedDict, total=False): + """Reasoning. + + :ivar effort: Known values are: "none", "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: Union[str, "ReasoningEffort"] + :ivar summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype summary: Literal["auto", "concise", "detailed"] + :ivar context: Is one of the following types: Literal["auto"], Literal["current_turn"], + Literal["all_turns"] + :vartype context: Literal["auto", "current_turn", "all_turns"] + :ivar generate_summary: Is one of the following types: Literal["auto"], Literal["concise"], + Literal["detailed"] + :vartype generate_summary: Literal["auto", "concise", "detailed"] + """ + + effort: Optional[Union[str, "ReasoningEffort"]] + """Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" + summary: Optional[Literal["auto", "concise", "detailed"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + context: Optional[Literal["auto", "current_turn", "all_turns"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"current_turn\"], + Literal[\"all_turns\"]""" + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + + +class RecurrenceTrigger(TypedDict, total=False): + """Recurrence based trigger. + + :ivar type: Type of the trigger. Required. Recurrence based trigger. + :vartype type: Literal[TriggerType.RECURRENCE] + :ivar start_time: Start time for the recurrence schedule in ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the recurrence schedule in ISO 8601 format. + :vartype end_time: str + :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. + :vartype time_zone: str + :ivar interval: Interval for the recurrence schedule. Required. + :vartype interval: int + :ivar schedule: Recurrence schedule for the recurrence trigger. Required. + :vartype schedule: "RecurrenceSchedule" + """ + + type: Required[Literal[TriggerType.RECURRENCE]] + """Type of the trigger. Required. Recurrence based trigger.""" + startTime: str + """Start time for the recurrence schedule in ISO 8601 format.""" + endTime: str + """End time for the recurrence schedule in ISO 8601 format.""" + timeZone: str + """Time zone for the recurrence schedule. Defaults to ``UTC``.""" + interval: Required[int] + """Interval for the recurrence schedule. Required.""" + schedule: Required["RecurrenceSchedule"] + """Recurrence schedule for the recurrence trigger. Required.""" + + +class RedTeam(TypedDict, total=False): + """Red team details. + + :ivar name: Identifier of the red team run. Required. + :vartype name: str + :ivar display_name: Name of the red-team run. + :vartype display_name: str + :ivar num_turns: Number of simulation rounds. + :vartype num_turns: int + :ivar attack_strategies: List of attack strategies or nested lists of attack strategies. + :vartype attack_strategies: list[Union[str, "AttackStrategy"]] + :ivar simulation_only: Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs + conversation not evaluation result. The service defaults to ``false`` if a value is not + specified by the caller. + :vartype simulation_only: bool + :ivar risk_categories: List of risk categories to generate attack objectives for. + :vartype risk_categories: list[Union[str, "RiskCategory"]] + :ivar application_scenario: Application scenario for the red team operation, to generate + scenario specific attacks. + :vartype application_scenario: str + :ivar tags: Red team's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Red team's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar status: Status of the red-team. It is set by service and is read-only. + :vartype status: str + :ivar target: Target configuration for the red-team run. Required. + :vartype target: "RedTeamTargetConfig" + """ + + id: Required[str] + """Identifier of the red team run. Required.""" + displayName: str + """Name of the red-team run.""" + numTurns: int + """Number of simulation rounds.""" + attackStrategies: list[Union[str, "AttackStrategy"]] + """List of attack strategies or nested lists of attack strategies.""" + simulationOnly: bool + """Simulation-only or Simulation + Evaluation. If ``true`` the scan outputs conversation not + evaluation result. The service defaults to ``false`` if a value is not specified by the caller.""" + riskCategories: list[Union[str, "RiskCategory"]] + """List of risk categories to generate attack objectives for.""" + applicationScenario: str + """Application scenario for the red team operation, to generate scenario specific attacks.""" + tags: dict[str, str] + """Red team's tags. Unlike properties, tags are fully mutable.""" + properties: dict[str, str] + """Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + status: str + """Status of the red-team. It is set by service and is read-only.""" + target: Required["RedTeamTargetConfig"] + """Target configuration for the red-team run. Required.""" + + +class ReminderPreviewToolboxTool(TypedDict, total=False): + """A reminder tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. REMINDER_PREVIEW. + :vartype type: Literal[ToolboxToolType.REMINDER_PREVIEW] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.REMINDER_PREVIEW]] + """Required. REMINDER_PREVIEW.""" + + +class ResponsesProtocolConfiguration(TypedDict, total=False): + """Configuration specific to the responses protocol.""" + + +class RubricBasedEvaluatorDefinition(TypedDict, total=False): + """Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for + both quality and safety evaluators. + + :ivar init_parameters: The JSON schema (Draft 2020-12) for the evaluator's input parameters. + This includes parameters like type, properties, required. + :vartype init_parameters: dict[str, Any] + :ivar data_schema: The JSON schema (Draft 2020-12) for the evaluator's input data. This + includes parameters like type, properties, required. + :vartype data_schema: dict[str, Any] + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, "EvaluatorMetric"] + :ivar type: Required. Rubric-based evaluator definition. Stores dimensions (the scoring + blueprint) for both quality and safety evaluators. Can be created via the generate API or + manually via createVersion. + :vartype type: Literal[EvaluatorDefinitionType.RUBRIC] + :ivar dimensions: The set of dimensions — the scoring blueprint used by the LLM judge. Quality + evaluators include a non-editable residual dimension with id 'general_quality' + (always_applicable: true); safety evaluators include 'general_policy_compliance'. Both use the + same Dimension structure. Required. + :vartype dimensions: list["Dimension"] + :ivar pass_threshold: Pass/fail threshold for the aggregate rubric score, on the same + normalized 0.0-1.0 scale as the emitted ``score``. When the runtime weighted average meets or + exceeds this value, the result is ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted + average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this + threshold. + :vartype pass_threshold: float + :ivar health: Service-generated rubric health. Present only when health computation is enabled + and at least one signal is available. + :vartype health: "RubricHealth" + :ivar superseded_dimensions: Dimensions from the preceding evaluator version that are not + present in this rubric. Present only when version lineage is available. + :vartype superseded_dimensions: list["SupersededDimension"] + """ + + init_parameters: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters + like type, properties, required.""" + data_schema: dict[str, Any] + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: dict[str, "EvaluatorMetric"] + """List of output metrics produced by this evaluator.""" + type: Required[Literal[EvaluatorDefinitionType.RUBRIC]] + """Required. Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both + quality and safety evaluators. Can be created via the generate API or manually via + createVersion.""" + dimensions: Required[list["Dimension"]] + """The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include + a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety + evaluators include 'general_policy_compliance'. Both use the same Dimension structure. + Required.""" + pass_threshold: float + """Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the + emitted ``score``. When the runtime weighted average meets or exceeds this value, the result is + ``pass``. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension + scored 1 → fail' rule still applies regardless of this threshold.""" + health: "RubricHealth" + """Service-generated rubric health. Present only when health computation is enabled and at least + one signal is available.""" + superseded_dimensions: list["SupersededDimension"] + """Dimensions from the preceding evaluator version that are not present in this rubric. Present + only when version lineage is available.""" + + +class RubricHealth(TypedDict, total=False): + """Service-generated health signals for a rubric evaluator. + + :ivar diversity: Normalized non-redundancy among rubric dimensions. Higher values indicate + greater diversity. + :vartype diversity: float + :ivar coverage: Normalized coverage of concepts found in the evaluator-generation sources. + :vartype coverage: float + :ivar negative_vs_positive: Failure-path coverage normalized against the service's configured + target fraction. A value of 1.0 means the target was met or exceeded. + :vartype negative_vs_positive: float + :ivar overall: Normalized aggregate health score. Omitted when required component signals are + unavailable. + :vartype overall: float + :ivar confidence: The completeness of the evidence used to compute the health signals. Known + values are: "low", "med", and "high". + :vartype confidence: Union[str, "RubricHealthConfidence"] + """ + + diversity: float + """Normalized non-redundancy among rubric dimensions. Higher values indicate greater diversity.""" + coverage: float + """Normalized coverage of concepts found in the evaluator-generation sources.""" + negative_vs_positive: float + """Failure-path coverage normalized against the service's configured target fraction. A value of + 1.0 means the target was met or exceeded.""" + overall: float + """Normalized aggregate health score. Omitted when required component signals are unavailable.""" + confidence: Union[str, "RubricHealthConfidence"] + """The completeness of the evidence used to compute the health signals. Known values are: \"low\", + \"med\", and \"high\".""" + + +class Schedule(TypedDict, total=False): + """Schedule model. + + :ivar schedule_id: Identifier of the schedule. Required. + :vartype schedule_id: str + :ivar display_name: Name of the schedule. + :vartype display_name: str + :ivar description: Description of the schedule. + :vartype description: str + :ivar enabled: Enabled status of the schedule. Required. + :vartype enabled: bool + :ivar provisioning_status: Provisioning status of the schedule. Known values are: "Creating", + "Updating", "Deleting", "Succeeded", and "Failed". + :vartype provisioning_status: Union[str, "ScheduleProvisioningStatus"] + :ivar trigger: Trigger for the schedule. Required. + :vartype trigger: "Trigger" + :ivar task: Task for the schedule. Required. + :vartype task: "ScheduleTask" + :ivar tags: Schedule's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Schedule's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar system_data: System metadata for the resource. Required. + :vartype system_data: dict[str, str] + """ + + id: Required[str] + """Identifier of the schedule. Required.""" + displayName: str + """Name of the schedule.""" + description: str + """Description of the schedule.""" + enabled: Required[bool] + """Enabled status of the schedule. Required.""" + provisioningStatus: Union[str, "ScheduleProvisioningStatus"] + """Provisioning status of the schedule. Known values are: \"Creating\", \"Updating\", + \"Deleting\", \"Succeeded\", and \"Failed\".""" + trigger: Required["Trigger"] + """Trigger for the schedule. Required.""" + task: Required["ScheduleTask"] + """Task for the schedule. Required.""" + tags: dict[str, str] + """Schedule's tags. Unlike properties, tags are fully mutable.""" + properties: dict[str, str] + """Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be + removed.""" + systemData: Required[dict[str, str]] + """System metadata for the resource. Required.""" + + +class ScheduleRoutineTrigger(TypedDict, total=False): + """A recurring cron-based routine trigger. + + :ivar type: The trigger type. Required. A recurring cron-based trigger. + :vartype type: Literal[RoutineTriggerType.SCHEDULE] + :ivar cron_expression: A 5-field cron expression. The service enforces a minimum interval of + five minutes by default. Required. + :vartype cron_expression: str + :ivar time_zone: An IANA or Windows time zone identifier for the schedule. Required. + :vartype time_zone: str + """ + + type: Required[Literal[RoutineTriggerType.SCHEDULE]] + """The trigger type. Required. A recurring cron-based trigger.""" + cron_expression: Required[str] + """A 5-field cron expression. The service enforces a minimum interval of five minutes by default. + Required.""" + time_zone: Required[str] + """An IANA or Windows time zone identifier for the schedule. Required.""" + + +class SharepointGroundingToolParameters(TypedDict, total=False): + """The sharepoint grounding tool parameters. + + :ivar project_connections: The project connections attached to this tool. There can be a + maximum of 1 connection resource attached to the tool. + :vartype project_connections: list["ToolProjectConnection"] + """ + + project_connections: list["ToolProjectConnection"] + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class SharepointPreviewTool(TypedDict, total=False): + """The input definition information for a sharepoint tool as used to configure an agent. + + :ivar type: The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW. + :vartype type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + :ivar sharepoint_grounding_preview: The sharepoint grounding tool parameters. Required. + :vartype sharepoint_grounding_preview: "SharepointGroundingToolParameters" + """ + + type: Required[Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW]] + """The object type, which is always 'sharepoint_grounding_preview'. Required. + SHAREPOINT_GROUNDING_PREVIEW.""" + sharepoint_grounding_preview: Required["SharepointGroundingToolParameters"] + """The sharepoint grounding tool parameters. Required.""" + + +class SimpleQnADataGenerationJobOptions(TypedDict, total=False): + """The options for a data generation job with SimpleQnA type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is SimpleQnA for this model. Required. Simple + question and answers between user and agent. + :vartype type: Literal[DataGenerationJobType.SIMPLE_QNA] + :ivar question_types: The question types to generate. Used only for fine-tuning scenarios. + :vartype question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """The proportion of the generated data to be used for training when the data is used for + fine-tuning. The rest will be used for validation. Value should be between 0 and 1.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.SIMPLE_QNA]] + """The data generation job type, which is SimpleQnA for this model. Required. Simple question and + answers between user and agent.""" + question_types: list[Union[str, "SimpleQnAFineTuningQuestionType"]] + """The question types to generate. Used only for fine-tuning scenarios.""" + + +class SkillInlineContent(TypedDict, total=False): + """Inline content for defining a simple skill without uploading files. Follows the agentskills.io + SKILL.md specification. + + :ivar description: A human-readable description of what the skill does and when to use it. + Required. + :vartype description: str + :ivar instructions: The skill instructions in markdown format. This is the body content of the + SKILL.md file. Required. + :vartype instructions: str + :ivar license: License name or reference to a bundled license file. + :vartype license: str + :ivar compatibility: Environment requirements or compatibility notes for the skill. + :vartype compatibility: str + :ivar metadata: Arbitrary key-value metadata for additional properties. + :vartype metadata: dict[str, str] + :ivar allowed_tools: List of pre-approved tools the skill may use. Experimental. + :vartype allowed_tools: list[str] + """ + + description: Required[str] + """A human-readable description of what the skill does and when to use it. Required.""" + instructions: Required[str] + """The skill instructions in markdown format. This is the body content of the SKILL.md file. + Required.""" + license: str + """License name or reference to a bundled license file.""" + compatibility: str + """Environment requirements or compatibility notes for the skill.""" + metadata: dict[str, str] + """Arbitrary key-value metadata for additional properties.""" + allowed_tools: list[str] + """List of pre-approved tools the skill may use. Experimental.""" + + +class SkillReferenceParam(TypedDict, total=False): + """SkillReferenceParam. + + :ivar type: References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE. + :vartype type: Literal[ContainerSkillType.SKILL_REFERENCE] + :ivar skill_id: The ID of the referenced skill. Required. + :vartype skill_id: str + :ivar version: Optional skill version. Use a positive integer or 'latest'. Omit for default. + :vartype version: str + """ + + type: Required[Literal[ContainerSkillType.SKILL_REFERENCE]] + """References a skill created with the /v1/skills endpoint. Required. SKILL_REFERENCE.""" + skill_id: Required[str] + """The ID of the referenced skill. Required.""" + version: str + """Optional skill version. Use a positive integer or 'latest'. Omit for default.""" + + +class SpecificApplyPatchParam(TypedDict, total=False): + """Specific apply patch tool choice. + + :ivar type: The tool to call. Always ``apply_patch``. Required. APPLY_PATCH. + :vartype type: Literal[ToolChoiceParamType.APPLY_PATCH] + """ + + type: Required[Literal[ToolChoiceParamType.APPLY_PATCH]] + """The tool to call. Always ``apply_patch``. Required. APPLY_PATCH.""" + + +class SpecificFunctionShellParam(TypedDict, total=False): + """Specific shell tool choice. + + :ivar type: The tool to call. Always ``shell``. Required. SHELL. + :vartype type: Literal[ToolChoiceParamType.SHELL] + """ + + type: Required[Literal[ToolChoiceParamType.SHELL]] + """The tool to call. Always ``shell``. Required. SHELL.""" + + +class StructuredInputDefinition(TypedDict, total=False): + """An structured input that can participate in prompt template substitutions and tool argument + binding. + + :ivar description: A human-readable description of the input. + :vartype description: str + :ivar default_value: The default value for the input if no run-time value is provided. + :vartype default_value: Any + :ivar schema: The JSON schema for the structured input (optional). + :vartype schema: dict[str, Any] + :ivar required: Whether the input property is required when the agent is invoked. The service + defaults to ``false`` if a value is not specified by the caller. + :vartype required: bool + """ + + description: str + """A human-readable description of the input.""" + default_value: Any + """The default value for the input if no run-time value is provided.""" + schema: dict[str, Any] + """The JSON schema for the structured input (optional).""" + required: bool + """Whether the input property is required when the agent is invoked. The service defaults to + ``false`` if a value is not specified by the caller.""" + + +class StructuredOutputDefinition(TypedDict, total=False): + """A structured output that can be produced by the agent. + + :ivar name: The name of the structured output. Required. + :vartype name: str + :ivar description: A description of the output to emit. Used by the model to determine when to + emit the output. Required. + :vartype description: str + :ivar schema: The JSON schema for the structured output. Required. + :vartype schema: dict[str, Any] + :ivar strict: Whether to enforce strict validation. Default ``true``. Required. + :vartype strict: bool + """ + + name: Required[str] + """The name of the structured output. Required.""" + description: Required[str] + """A description of the output to emit. Used by the model to determine when to emit the output. + Required.""" + schema: Required[dict[str, Any]] + """The JSON schema for the structured output. Required.""" + strict: Required[Optional[bool]] + """Whether to enforce strict validation. Default ``true``. Required.""" + + +class SupersededDimension(TypedDict, total=False): + """A dimension from the preceding evaluator version that is not present in the current rubric. + + :ivar id: The stable identifier of the superseded dimension. Required. + :vartype id: str + :ivar reason: A bounded service-generated reason why the dimension was superseded. Required. + :vartype reason: str + """ + + id: Required[str] + """The stable identifier of the superseded dimension. Required.""" + reason: Required[str] + """A bounded service-generated reason why the dimension was superseded. Required.""" + + +class TaxonomyCategory(TypedDict, total=False): + """Taxonomy category definition. + + :ivar id: Unique identifier of the taxonomy category. Required. + :vartype id: str + :ivar name: Name of the taxonomy category. Required. + :vartype name: str + :ivar description: Description of the taxonomy category. + :vartype description: str + :ivar risk_category: Risk category associated with this taxonomy category. Required. Known + values are: "HateUnfairness", "Violence", "Sexual", "SelfHarm", "ProtectedMaterial", + "CodeVulnerability", "UngroundedAttributes", "ProhibitedActions", "SensitiveDataLeakage", and + "TaskAdherence". + :vartype risk_category: Union[str, "RiskCategory"] + :ivar sub_categories: List of taxonomy sub categories. Required. + :vartype sub_categories: list["TaxonomySubCategory"] + :ivar properties: Additional properties for the taxonomy category. + :vartype properties: dict[str, str] + """ + + id: Required[str] + """Unique identifier of the taxonomy category. Required.""" + name: Required[str] + """Name of the taxonomy category. Required.""" + description: str + """Description of the taxonomy category.""" + riskCategory: Required[Union[str, "RiskCategory"]] + """Risk category associated with this taxonomy category. Required. Known values are: + \"HateUnfairness\", \"Violence\", \"Sexual\", \"SelfHarm\", \"ProtectedMaterial\", + \"CodeVulnerability\", \"UngroundedAttributes\", \"ProhibitedActions\", + \"SensitiveDataLeakage\", and \"TaskAdherence\".""" + subCategories: Required[list["TaxonomySubCategory"]] + """List of taxonomy sub categories. Required.""" + properties: dict[str, str] + """Additional properties for the taxonomy category.""" + + +class TaxonomySubCategory(TypedDict, total=False): + """Taxonomy sub-category definition. + + :ivar id: Unique identifier of the taxonomy sub-category. Required. + :vartype id: str + :ivar name: Name of the taxonomy sub-category. Required. + :vartype name: str + :ivar description: Description of the taxonomy sub-category. + :vartype description: str + :ivar enabled: List of taxonomy items under this sub-category. Required. + :vartype enabled: bool + :ivar properties: Additional properties for the taxonomy sub-category. + :vartype properties: dict[str, str] + """ + + id: Required[str] + """Unique identifier of the taxonomy sub-category. Required.""" + name: Required[str] + """Name of the taxonomy sub-category. Required.""" + description: str + """Description of the taxonomy sub-category.""" + enabled: Required[bool] + """List of taxonomy items under this sub-category. Required.""" + properties: dict[str, str] + """Additional properties for the taxonomy sub-category.""" + + +class TelemetryConfig(TypedDict, total=False): + """Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + + :ivar endpoints: Customer-supplied telemetry export endpoint configurations. Required. + :vartype endpoints: list["TelemetryEndpoint"] + """ + + endpoints: Required[list["TelemetryEndpoint"]] + """Customer-supplied telemetry export endpoint configurations. Required.""" + + +class TextResponseFormatJsonObject(TypedDict, total=False): + """JSON object. + + :ivar type: The type of response format being defined. Always ``json_object``. Required. + JSON_OBJECT. + :vartype type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + """ + + type: Required[Literal[TextResponseFormatConfigurationType.JSON_OBJECT]] + """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" + + +class TextResponseFormatJsonSchema(TypedDict, total=False): + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + JSON_SCHEMA. + :vartype type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + :ivar description: A description of what the response format is for, used by the model to + determine how to respond in the format. + :vartype description: str + :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and + dashes, with a maximum length of 64. Required. + :vartype name: str + :ivar schema: Required. + :vartype schema: dict[str, Any] + :ivar strict: + :vartype strict: bool + """ + + type: Required[Literal[TextResponseFormatConfigurationType.JSON_SCHEMA]] + """The type of response format being defined. Always ``json_schema``. Required. JSON_SCHEMA.""" + description: str + """A description of what the response format is for, used by the model to determine how to respond + in the format.""" + name: Required[str] + """The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + a maximum length of 64. Required.""" + schema: Required[dict[str, Any]] + """Required.""" + strict: Optional[bool] + + +class TextResponseFormatText(TypedDict, total=False): + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. TEXT. + :vartype type: Literal[TextResponseFormatConfigurationType.TEXT] + """ + + type: Required[Literal[TextResponseFormatConfigurationType.TEXT]] + """The type of response format being defined. Always ``text``. Required. TEXT.""" + + +class TimerRoutineTrigger(TypedDict, total=False): + """A one-shot timer routine trigger. + + :ivar type: The trigger type. Required. A one-shot timer trigger. + :vartype type: Literal[RoutineTriggerType.TIMER] + :ivar at: The UTC date and time at which the timer fires. + :vartype at: int + """ + + type: Required[Literal[RoutineTriggerType.TIMER]] + """The trigger type. Required. A one-shot timer trigger.""" + at: int + """The UTC date and time at which the timer fires.""" + + +class ToolboxPolicies(TypedDict, total=False): + """Policy configuration for a toolbox, including content safety and other governance settings. + + :ivar rai_config: Responsible AI content filtering configuration. + :vartype rai_config: "RaiConfig" + """ + + rai_config: "RaiConfig" + """Responsible AI content filtering configuration.""" + + +class ToolboxSearchPreviewToolboxTool(TypedDict, total=False): + """A toolbox search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: The type of the tool. Always ``toolbox_search_preview``. Required. + TOOLBOX_SEARCH_PREVIEW. + :vartype type: Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW] + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.TOOLBOX_SEARCH_PREVIEW]] + """The type of the tool. Always ``toolbox_search_preview``. Required. TOOLBOX_SEARCH_PREVIEW.""" + + +class ToolboxSkillReference(TypedDict, total=False): + """A reference to an existing skill to include in a toolbox. + + :ivar type: The type of skill source. Required. Default value is "skill_reference". + :vartype type: Literal["skill_reference"] + :ivar name: The name of the skill. Required. + :vartype name: str + :ivar version: The version of the skill. If not specified, the skill's default version is used. + When a version is specified, the reference is pinned to that immutable version. + :vartype version: str + """ + + type: Required[Literal["skill_reference"]] + """The type of skill source. Required. Default value is \"skill_reference\".""" + name: Required[str] + """The name of the skill. Required.""" + version: str + """The version of the skill. If not specified, the skill's default version is used. When a version + is specified, the reference is pinned to that immutable version.""" + + +class ToolChoiceAllowed(TypedDict, total=False): + """Allowed tools. + + :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS. + :vartype type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + :ivar mode: Constrains the tools available to the model to a pre-defined set. ``auto`` allows + the model to pick from among the allowed tools and generate a message. ``required`` requires + the model to call one or more of the allowed tools. Required. Is either a Literal["auto"] type + or a Literal["required"] type. + :vartype mode: Literal["auto", "required"] + :ivar tools: Required. A list of tool definitions that the model should be allowed to call. For + the Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + :vartype tools: list[dict[str, Any]] + """ + + type: Required[Literal[ToolChoiceParamType.ALLOWED_TOOLS]] + """Allowed tool configuration type. Always ``allowed_tools``. Required. ALLOWED_TOOLS.""" + mode: Required[Literal["auto", "required"]] + """Constrains the tools available to the model to a pre-defined set. ``auto`` allows the model to + pick from among the allowed tools and generate a message. ``required`` requires the model to + call one or more of the allowed tools. Required. Is either a Literal[\"auto\"] type or a + Literal[\"required\"] type.""" + tools: Required[list[dict[str, Any]]] + """Required. A list of tool definitions that the model should be allowed to call. For the + Responses API, the list of tool definitions might look like: + + .. code-block:: json + + [ + { \"type\": \"function\", \"name\": \"get_weather\" }, + { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, + { \"type\": \"image_generation\" } + ]""" + + +class ToolChoiceCodeInterpreter(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. CODE_INTERPRETER. + :vartype type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + """ + + type: Required[Literal[ToolChoiceParamType.CODE_INTERPRETER]] + """Required. CODE_INTERPRETER.""" + + +class ToolChoiceComputer(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER. + :vartype type: Literal[ToolChoiceParamType.COMPUTER] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER]] + """Required. COMPUTER.""" + + +class ToolChoiceComputerUse(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE. + :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE]] + """Required. COMPUTER_USE.""" + + +class ToolChoiceComputerUsePreview(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. COMPUTER_USE_PREVIEW. + :vartype type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + """ + + type: Required[Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW]] + """Required. COMPUTER_USE_PREVIEW.""" + + +class ToolChoiceCustom(TypedDict, total=False): + """Custom tool. + + :ivar type: For custom tool calling, the type is always ``custom``. Required. CUSTOM. + :vartype type: Literal[ToolChoiceParamType.CUSTOM] + :ivar name: The name of the custom tool to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.CUSTOM]] + """For custom tool calling, the type is always ``custom``. Required. CUSTOM.""" + name: Required[str] + """The name of the custom tool to call. Required.""" + + +class ToolChoiceFileSearch(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. FILE_SEARCH. + :vartype type: Literal[ToolChoiceParamType.FILE_SEARCH] + """ + + type: Required[Literal[ToolChoiceParamType.FILE_SEARCH]] + """Required. FILE_SEARCH.""" + + +class ToolChoiceFunction(TypedDict, total=False): + """Function tool. + + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: Literal[ToolChoiceParamType.FUNCTION] + :ivar name: The name of the function to call. Required. + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.FUNCTION]] + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: Required[str] + """The name of the function to call. Required.""" + + +class ToolChoiceImageGeneration(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. IMAGE_GENERATION. + :vartype type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + """ + + type: Required[Literal[ToolChoiceParamType.IMAGE_GENERATION]] + """Required. IMAGE_GENERATION.""" + + +class ToolChoiceMCP(TypedDict, total=False): + """MCP tool. + + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: Literal[ToolChoiceParamType.MCP] + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: + :vartype name: str + """ + + type: Required[Literal[ToolChoiceParamType.MCP]] + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: Required[str] + """The label of the MCP server to use. Required.""" + name: Optional[str] + + +class ToolChoiceWebSearchPreview(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. WEB_SEARCH_PREVIEW. + :vartype type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + """ + + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW]] + """Required. WEB_SEARCH_PREVIEW.""" + + +class ToolChoiceWebSearchPreview20250311(TypedDict, total=False): + """Indicates that the model should use a built-in tool to generate a response. `Learn more about + built-in tools `_. + + :ivar type: Required. WEB_SEARCH_PREVIEW_2025_03_11. + :vartype type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + """ + + type: Required[Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11]] + """Required. WEB_SEARCH_PREVIEW_2025_03_11.""" + + +class ToolConfig(TypedDict, total=False): + """Per-tool configuration that controls tool visibility and search behavior. + + :ivar pin: When true, the tool is always included in agent context and visible in + ``tools/list``. When false (default), the tool is hidden from ``tools/list`` and only + discoverable via ``tool_search``. + :vartype pin: bool + :ivar additional_search_text: Additional text indexed for tool_search. Supplements the native + tool description to improve discoverability. Does not alter ``tools/list`` output. + :vartype additional_search_text: str + """ + + pin: bool + """When true, the tool is always included in agent context and visible in ``tools/list``. When + false (default), the tool is hidden from ``tools/list`` and only discoverable via + ``tool_search``.""" + additional_search_text: str + """Additional text indexed for tool_search. Supplements the native tool description to improve + discoverability. Does not alter ``tools/list`` output.""" + + +class ToolDescription(TypedDict, total=False): + """Description of a tool that can be used by an agent. + + :ivar name: The name of the tool. + :vartype name: str + :ivar description: A brief description of the tool's purpose. + :vartype description: str + """ + + name: str + """The name of the tool.""" + description: str + """A brief description of the tool's purpose.""" + + +class ToolProjectConnection(TypedDict, total=False): + """A project connection resource. + + :ivar project_connection_id: A project connection in a ToolProjectConnectionList attached to + this tool. Required. + :vartype project_connection_id: str + """ + + project_connection_id: Required[str] + """A project connection in a ToolProjectConnectionList attached to this tool. Required.""" + + +class ToolSearchToolParam(TypedDict, total=False): + """Tool search tool. + + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: Literal[ToolType.TOOL_SEARCH] + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: Union[str, "ToolSearchExecutionType"] + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: "EmptyModelParam" + """ + + type: Required[Literal[ToolType.TOOL_SEARCH]] + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Union[str, "ToolSearchExecutionType"] + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] + parameters: Optional["EmptyModelParam"] + + +class ToolUseFineTuningDataGenerationJobOptions(TypedDict, total=False): # pylint: disable=name-too-long + """The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is ToolUse for this model. Required. Tool + calling conversation between user and agent. + :vartype type: Literal[DataGenerationJobType.TOOL_USE] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """The proportion of the generated data to be used for training when the data is used for + fine-tuning. The rest will be used for validation. Value should be between 0 and 1.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.TOOL_USE]] + """The data generation job type, which is ToolUse for this model. Required. Tool calling + conversation between user and agent.""" + + +class TracesDataGenerationJobOptions(TypedDict, total=False): + """The options for a data generation job with Traces type. + + :ivar max_samples: Maximum number of samples to generate. Required. + :vartype max_samples: int + :ivar train_split: The proportion of the generated data to be used for training when the data + is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + :vartype train_split: float + :ivar model_options: The LLM model options. + :vartype model_options: "DataGenerationModelOptions" + :ivar type: The data generation job type, which is Traces for this model. Required. Single turn + query and response from agent traces. + :vartype type: Literal[DataGenerationJobType.TRACES] + """ + + max_samples: Required[int] + """Maximum number of samples to generate. Required.""" + train_split: float + """The proportion of the generated data to be used for training when the data is used for + fine-tuning. The rest will be used for validation. Value should be between 0 and 1.""" + model_options: "DataGenerationModelOptions" + """The LLM model options.""" + type: Required[Literal[DataGenerationJobType.TRACES]] + """The data generation job type, which is Traces for this model. Required. Single turn query and + response from agent traces.""" + + +class TracesDataGenerationJobSource(TypedDict, total=False): + """Traces source for data generation jobs — conversation traces from Application Insights. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: Literal[DataGenerationJobSourceType.TRACES] + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: int + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: int + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[DataGenerationJobSourceType.TRACES]] + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: str + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: str + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: str + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: Required[int] + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: int + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + + +class TracesEvaluatorGenerationJobSource(TypedDict, total=False): + """Traces source for evaluator generation jobs — conversation traces from Application Insights. + + :ivar description: Optional description of what this source represents — helps the pipeline + interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core + capabilities'). + :vartype description: str + :ivar type: The source type for this source, which is Traces. Required. Traces source — + conversation traces from Application Insights. + :vartype type: Literal[EvaluatorGenerationJobSourceType.TRACES] + :ivar agent_id: The unique agent ID used to filter traces. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_id: str + :ivar agent_name: The agent name to fetch traces for. Provide either ``agent_id`` or + ``agent_name`` — at least one is required. + :vartype agent_name: str + :ivar agent_version: The agent version. If not specified, traces for ALL versions of the agent + are included within the time window. + :vartype agent_version: str + :ivar start_time: Start of the time window (Unix timestamp in seconds) for fetching traces. + Required. + :vartype start_time: int + :ivar end_time: End of the time window (Unix timestamp in seconds). Defaults to current time. + :vartype end_time: int + """ + + description: str + """Optional description of what this source represents — helps the pipeline interpret its content + (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').""" + type: Required[Literal[EvaluatorGenerationJobSourceType.TRACES]] + """The source type for this source, which is Traces. Required. Traces source — conversation traces + from Application Insights.""" + agent_id: str + """The unique agent ID used to filter traces. Provide either ``agent_id`` or ``agent_name`` — at + least one is required.""" + agent_name: str + """The agent name to fetch traces for. Provide either ``agent_id`` or ``agent_name`` — at least + one is required.""" + agent_version: str + """The agent version. If not specified, traces for ALL versions of the agent are included within + the time window.""" + start_time: Required[int] + """Start of the time window (Unix timestamp in seconds) for fetching traces. Required.""" + end_time: int + """End of the time window (Unix timestamp in seconds). Defaults to current time.""" + + +class UpdateModelVersionRequest(TypedDict, total=False): + """Request body for updating a model version. Only description and tags can be modified. + + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + """ + + description: str + """The asset description text.""" + tags: dict[str, str] + """Tag dictionary. Tags can be added, removed, and updated.""" + + +class UpdateToolboxRequest(TypedDict, total=False): + """UpdateToolboxRequest. + + :ivar default_version: The version identifier that the toolbox should point to. When set, the + toolbox's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str + """ + + default_version: Required[str] + """The version identifier that the toolbox should point to. When set, the toolbox's default + version will resolve to this version instead of the latest. Required.""" + + +class VersionRefIndicator(TypedDict, total=False): + """Version indicator that references a specific agent version by name. + + :ivar type: Discriminator value for version_ref. Required. Direct reference to a specific agent + version. + :vartype type: Literal[VersionIndicatorType.VERSION_REF] + :ivar agent_version: The agent version identifier returned by the agent version APIs. Required. + :vartype agent_version: str + """ + + type: Required[Literal[VersionIndicatorType.VERSION_REF]] + """Discriminator value for version_ref. Required. Direct reference to a specific agent version.""" + agent_version: Required[str] + """The agent version identifier returned by the agent version APIs. Required.""" + + +class VersionSelector(TypedDict, total=False): + """VersionSelector. + + :ivar version_selection_rules: Required. + :vartype version_selection_rules: list["VersionSelectionRule"] + """ + + version_selection_rules: Required[list["VersionSelectionRule"]] + """Required.""" + + +class WebSearchApproximateLocation(TypedDict, total=False): + """Web search approximate location. + + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". + :vartype type: Literal["approximate"] + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str + """ + + type: Required[Literal["approximate"]] + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] + region: Optional[str] + city: Optional[str] + timezone: Optional[str] + + +class WebSearchConfiguration(TypedDict, total=False): + """A web search configuration for bing custom search. + + :ivar project_connection_id: Project connection id for grounding with bing custom search. + Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + """ + + project_connection_id: Required[str] + """Project connection id for grounding with bing custom search. Required.""" + instance_name: Required[str] + """Name of the custom configuration instance given to config. Required.""" + + +class WebSearchPreviewTool(TypedDict, total=False): + """Web search preview. + + :ivar type: The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. + :vartype type: Literal[ToolType.WEB_SEARCH_PREVIEW] + :ivar user_location: + :vartype user_location: "ApproximateLocation" + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known + values are: "low", "medium", and "high". + :vartype search_context_size: Union[str, "SearchContextSize"] + :ivar search_content_types: + :vartype search_content_types: list[Union[str, "SearchContentType"]] + """ + + type: Required[Literal[ToolType.WEB_SEARCH_PREVIEW]] + """The type of the web search tool. One of ``web_search_preview`` or + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" + user_location: Optional["ApproximateLocation"] + search_context_size: Union[str, "SearchContextSize"] + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", + \"medium\", and \"high\".""" + search_content_types: list[Union[str, "SearchContentType"]] + + +class WebSearchTool(TypedDict, total=False): + """Web search. + + :ivar type: The type of the web search tool. One of ``web_search`` or + ``web_search_2025_08_26``. Required. WEB_SEARCH. + :vartype type: Literal[ToolType.WEB_SEARCH] + :ivar filters: + :vartype filters: "WebSearchToolFilters" + :ivar user_location: + :vartype user_location: "WebSearchApproximateLocation" + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of + the following types: Literal["low"], Literal["medium"], Literal["high"] + :vartype search_context_size: Literal["low", "medium", "high"] + :ivar name: Deprecated. This property is deprecated and will be removed in a future version. + :vartype name: str + :ivar description: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype description: str + :ivar tool_configs: Deprecated. This property is deprecated and will be removed in a future + version. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar custom_search_configuration: The project connections attached to this tool. There can be + a maximum of 1 connection resource attached to the tool. + :vartype custom_search_configuration: "WebSearchConfiguration" + """ + + type: Required[Literal[ToolType.WEB_SEARCH]] + """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. + WEB_SEARCH.""" + filters: Optional["WebSearchToolFilters"] + user_location: Optional["WebSearchApproximateLocation"] + search_context_size: Literal["low", "medium", "high"] + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: + Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" + name: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + description: str + """Deprecated. This property is deprecated and will be removed in a future version.""" + tool_configs: dict[str, "ToolConfig"] + """Deprecated. This property is deprecated and will be removed in a future version.""" + custom_search_configuration: "WebSearchConfiguration" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class WebSearchToolboxTool(TypedDict, total=False): + """A web search tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. WEB_SEARCH. + :vartype type: Literal[ToolboxToolType.WEB_SEARCH] + :ivar filters: + :vartype filters: "WebSearchToolFilters" + :ivar user_location: + :vartype user_location: "WebSearchApproximateLocation" + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of + the following types: Literal["low"], Literal["medium"], Literal["high"] + :vartype search_context_size: Literal["low", "medium", "high"] + :ivar custom_search_configuration: The project connections attached to this tool. There can be + a maximum of 1 connection resource attached to the tool. + :vartype custom_search_configuration: "WebSearchConfiguration" + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.WEB_SEARCH]] + """Required. WEB_SEARCH.""" + filters: Optional["WebSearchToolFilters"] + user_location: Optional["WebSearchApproximateLocation"] + search_context_size: Literal["low", "medium", "high"] + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: + Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" + custom_search_configuration: "WebSearchConfiguration" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" + + +class WebSearchToolFilters(TypedDict, total=False): + """WebSearchToolFilters. + + :ivar allowed_domains: + :vartype allowed_domains: list[str] + """ + + allowed_domains: Optional[list[str]] + + +class WeeklyRecurrenceSchedule(TypedDict, total=False): + """Weekly recurrence schedule. + + :ivar type: Weekly recurrence type. Required. Weekly recurrence pattern. + :vartype type: Literal[RecurrenceType.WEEKLY] + :ivar days_of_week: Days of the week for the recurrence schedule. Required. + :vartype days_of_week: list[Union[str, "DayOfWeek"]] + """ + + type: Required[Literal[RecurrenceType.WEEKLY]] + """Weekly recurrence type. Required. Weekly recurrence pattern.""" + daysOfWeek: Required[list[Union[str, "DayOfWeek"]]] + """Days of the week for the recurrence schedule. Required.""" + + +class WorkflowAgentDefinition(TypedDict, total=False): + """The workflow agent definition. + + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: "RaiConfig" + :ivar kind: Required. WORKFLOW. + :vartype kind: Literal[AgentKind.WORKFLOW] + :ivar workflow: The CSDL YAML definition of the workflow. + :vartype workflow: str + """ + + rai_config: "RaiConfig" + """Configuration for Responsible AI (RAI) content filtering and safety features.""" + kind: Required[Literal[AgentKind.WORKFLOW]] + """Required. WORKFLOW.""" + workflow: str + """The CSDL YAML definition of the workflow.""" + + +class WorkIQPreviewTool(TypedDict, total=False): + """A WorkIQ server-side tool. + + :ivar type: The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW. + :vartype type: Literal[ToolType.WORK_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WorkIQ project connection. Required. + :vartype project_connection_id: str + """ + + type: Required[Literal[ToolType.WORK_IQ_PREVIEW]] + """The object type, which is always 'work_iq_preview'. Required. WORK_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WorkIQ project connection. Required.""" + + +class WorkIQPreviewToolboxTool(TypedDict, total=False): + """A WorkIQ tool stored in a toolbox. + + :ivar name: Optional user-defined name for this tool or configuration. + :vartype name: str + :ivar description: Optional user-defined description for this tool or configuration. + :vartype description: str + :ivar tool_configs: Per-tool configuration map. Keys are tool names or ``*`` (catch-all + default). Resolution order: exact tool name match takes priority over ``*``. Unknown tool names + are silently ignored at runtime. + :vartype tool_configs: dict[str, "ToolConfig"] + :ivar type: Required. WORK_IQ_PREVIEW. + :vartype type: Literal[ToolboxToolType.WORK_IQ_PREVIEW] + :ivar project_connection_id: The ID of the WorkIQ project connection. Required. + :vartype project_connection_id: str + """ + + name: str + """Optional user-defined name for this tool or configuration.""" + description: str + """Optional user-defined description for this tool or configuration.""" + tool_configs: dict[str, "ToolConfig"] + """Per-tool configuration map. Keys are tool names or ``*`` (catch-all default). Resolution order: + exact tool name match takes priority over ``*``. Unknown tool names are silently ignored at + runtime.""" + type: Required[Literal[ToolboxToolType.WORK_IQ_PREVIEW]] + """Required. WORK_IQ_PREVIEW.""" + project_connection_id: Required[str] + """The ID of the WorkIQ project connection. Required.""" + + +class CreateMemoryStoreRequest(TypedDict, total=False): + """CreateMemoryStoreRequest. + + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar description: A human-readable description of the memory store. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the memory store. + :vartype metadata: dict[str, str] + :ivar definition: The memory store definition. Required. + :vartype definition: "MemoryStoreDefinition" + """ + + name: Required[str] + """The name of the memory store. Required.""" + description: str + """A human-readable description of the memory store.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the memory store.""" + definition: Required["MemoryStoreDefinition"] + """The memory store definition. Required.""" + + +class UpdateMemoryStoreRequest(TypedDict, total=False): + """UpdateMemoryStoreRequest. + + :ivar description: A human-readable description of the memory store. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the memory store. + :vartype metadata: dict[str, str] + """ + + description: str + """A human-readable description of the memory store.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the memory store.""" + + +class SearchMemoriesRequest(TypedDict, total=False): + """SearchMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar items: Items for which to search for relevant memories. + :vartype items: list[dict[str, Any]] + :ivar previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. + :vartype previous_search_id: str + :ivar options: Memory search options. + :vartype options: "MemorySearchOptions" + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + items: list[dict[str, Any]] + """Items for which to search for relevant memories.""" + previous_search_id: str + """The unique ID of the previous search request, enabling incremental memory search from where the + last operation left off.""" + options: "MemorySearchOptions" + """Memory search options.""" + + +class UpdateMemoriesRequest(TypedDict, total=False): + """UpdateMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar items_property: Conversation items to be stored in memory. + :vartype items_property: list[dict[str, Any]] + :ivar previous_update_id: The unique ID of the previous update request, enabling incremental + memory updates from where the last operation left off. + :vartype previous_update_id: str + :ivar update_delay: Timeout period before processing the memory update in seconds. If a new + update request is received during this period, it will cancel the current request and reset the + timeout. Set to 0 to immediately trigger the update without delay. Defaults to 300 (5 minutes). + :vartype update_delay: int + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + items: list[dict[str, Any]] + """Conversation items to be stored in memory.""" + previous_update_id: str + """The unique ID of the previous update request, enabling incremental memory updates from where + the last operation left off.""" + update_delay: int + """Timeout period before processing the memory update in seconds. If a new update request is + received during this period, it will cancel the current request and reset the timeout. Set to 0 + to immediately trigger the update without delay. Defaults to 300 (5 minutes).""" + + +class DeleteScopeRequest(TypedDict, total=False): + """DeleteScopeRequest. + + :ivar scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :vartype scope: str + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories to delete, such as a user ID. + Required.""" + + +class CreateMemoryRequest(TypedDict, total=False): + """CreateMemoryRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Known values are: "user_profile", + "chat_summary", and "procedural". + :vartype kind: Union[str, "MemoryItemKind"] + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: Required[str] + """The content of the memory. Required.""" + kind: Required[Union[str, "MemoryItemKind"]] + """The kind of the memory item. Required. Known values are: \"user_profile\", \"chat_summary\", + and \"procedural\".""" + + +class UpdateMemoryRequest(TypedDict, total=False): + """UpdateMemoryRequest. + + :ivar content: The updated content of the memory. Required. + :vartype content: str + """ + + content: Required[str] + """The updated content of the memory. Required.""" + + +class ListMemoriesRequest(TypedDict, total=False): + """ListMemoriesRequest. + + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + """ + + scope: Required[str] + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + + +class CreateOrUpdateRoutineRequest(TypedDict, total=False): + """CreateOrUpdateRoutineRequest. + + :ivar description: A human-readable description of the routine. + :vartype description: str + :ivar enabled: Whether the routine is enabled. + :vartype enabled: bool + :ivar triggers: The triggers configured for the routine. In v1, exactly one trigger entry is + supported. + :vartype triggers: dict[str, "RoutineTrigger"] + :ivar action: The action executed when the routine fires. + :vartype action: "RoutineAction" + """ + + description: str + """A human-readable description of the routine.""" + enabled: bool + """Whether the routine is enabled.""" + triggers: dict[str, "RoutineTrigger"] + """The triggers configured for the routine. In v1, exactly one trigger entry is supported.""" + action: "RoutineAction" + """The action executed when the routine fires.""" + + +class DispatchRoutineAsyncRequest(TypedDict, total=False): + """DispatchRoutineAsyncRequest. + + :ivar payload: A direct action-input override sent downstream when testing a routine. + :vartype payload: "RoutineDispatchPayload" + """ + + payload: "RoutineDispatchPayload" + """A direct action-input override sent downstream when testing a routine.""" + + +class UpdateSkillRequest(TypedDict, total=False): + """UpdateSkillRequest. + + :ivar default_version: The version identifier that the skill should point to. When set, the + skill's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str + """ + + default_version: Required[str] + """The version identifier that the skill should point to. When set, the skill's default version + will resolve to this version instead of the latest. Required.""" + + +class CreateSkillVersionRequest(TypedDict, total=False): + """CreateSkillVersionRequest. + + :ivar inline_content: Inline skill content for simple skills without file uploads. + Foundry-specific extension. + :vartype inline_content: "SkillInlineContent" + :ivar default: Whether to set this version as the default. + :vartype default: bool + """ + + inline_content: "SkillInlineContent" + """Inline skill content for simple skills without file uploads. Foundry-specific extension.""" + default: bool + """Whether to set this version as the default.""" + + +class CreateAgentVersionRequest(TypedDict, total=False): + """CreateAgentVersionRequest. + + :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar definition: The agent definition. This can be a workflow, hosted agent, or a simple agent + definition. Required. + :vartype definition: "AgentDefinition" + :ivar blueprint_reference: The blueprint reference for the agent. + :vartype blueprint_reference: "AgentBlueprintReference" + :ivar draft: (Preview) Whether this agent version is a draft (candidate) rather than a release. + The service defaults to ``false`` if a value is not specified by the caller. Draft versions are + recorded but excluded from default 'latest' resolution and are not auto-promoted. + :vartype draft: bool + """ + + metadata: dict[str, str] + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters.""" + description: str + """A human-readable description of the agent.""" + definition: Required["AgentDefinition"] + """The agent definition. This can be a workflow, hosted agent, or a simple agent definition. + Required.""" + blueprint_reference: "AgentBlueprintReference" + """The blueprint reference for the agent.""" + draft: bool + """(Preview) Whether this agent version is a draft (candidate) rather than a release. The service + defaults to ``false`` if a value is not specified by the caller. Draft versions are recorded + but excluded from default 'latest' resolution and are not auto-promoted.""" + + +class CreateAgentVersionFromManifestRequest(TypedDict, total=False): + """CreateAgentVersionFromManifestRequest. + + :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + :vartype metadata: dict[str, str] + :ivar description: A human-readable description of the agent. + :vartype description: str + :ivar manifest_id: The manifest ID to import the agent version from. Required. + :vartype manifest_id: str + :ivar parameter_values: The inputs to the manifest that will result in a fully materialized + Agent. Required. + :vartype parameter_values: dict[str, Any] + """ + + metadata: dict[str, str] + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters.""" + description: str + """A human-readable description of the agent.""" + manifest_id: Required[str] + """The manifest ID to import the agent version from. Required.""" + parameter_values: Required[dict[str, Any]] + """The inputs to the manifest that will result in a fully materialized Agent. Required.""" + + +class PatchAgentObjectRequest(TypedDict, total=False): + """PatchAgentObjectRequest. + + :ivar agent_endpoint: The endpoint configuration for the agent. + :vartype agent_endpoint: "AgentEndpointConfig" + :ivar agent_card: Optional agent card for the agent. + :vartype agent_card: "AgentCard" + """ + + agent_endpoint: "AgentEndpointConfig" + """The endpoint configuration for the agent.""" + agent_card: "AgentCard" + """Optional agent card for the agent.""" + + +class CreateSessionRequest(TypedDict, total=False): + """CreateSessionRequest. + + :ivar agent_session_id: Optional caller-provided session ID. If specified, it must be unique + within the agent endpoint. Auto-generated if omitted. + :vartype agent_session_id: str + :ivar version_indicator: Determines which agent version backs the session. Required. + :vartype version_indicator: "VersionIndicator" + """ + + agent_session_id: str + """Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. + Auto-generated if omitted.""" + version_indicator: Required["VersionIndicator"] + """Determines which agent version backs the session. Required.""" + + +class CreateToolboxVersionRequest(TypedDict, total=False): + """CreateToolboxVersionRequest. + + :ivar description: A human-readable description of the toolbox. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the toolbox. + :vartype metadata: dict[str, str] + :ivar tools: The list of tools to include in this version. Required. + :vartype tools: list["ToolboxTool"] + :ivar skills: The list of skill sources to include in this version. A skill reference specifies + a skill name and optionally a version. If version is omitted, the skill's default version is + used. + :vartype skills: list["ToolboxSkill"] + :ivar policies: Policy configuration for this toolbox version. + :vartype policies: "ToolboxPolicies" + """ + + description: str + """A human-readable description of the toolbox.""" + metadata: dict[str, str] + """Arbitrary key-value metadata to associate with the toolbox.""" + tools: Required[list["ToolboxTool"]] + """The list of tools to include in this version. Required.""" + skills: list["ToolboxSkill"] + """The list of skill sources to include in this version. A skill reference specifies a skill name + and optionally a version. If version is omitted, the skill's default version is used.""" + policies: "ToolboxPolicies" + """Policy configuration for this toolbox version.""" + + +class UpdateToolboxRequest1(TypedDict, total=False): + """UpdateToolboxRequest1. + + :ivar default_version: The version identifier that the toolbox should point to. When set, the + toolbox's default version will resolve to this version instead of the latest. Required. + :vartype default_version: str + """ + + default_version: Required[str] + """The version identifier that the toolbox should point to. When set, the toolbox's default + version will resolve to this version instead of the latest. Required.""" + + +Tool = Union[ + A2APreviewTool, + ApplyPatchToolParam, + AzureAISearchTool, + AzureFunctionTool, + BingCustomSearchPreviewTool, + BingGroundingTool, + BrowserAutomationPreviewTool, + CaptureStructuredOutputsTool, + CodeInterpreterTool, + ComputerTool, + ComputerUsePreviewTool, + CustomToolParam, + MicrosoftFabricPreviewTool, + FabricIQPreviewTool, + FileSearchTool, + FunctionTool, + ImageGenTool, + LocalShellToolParam, + MCPTool, + MemorySearchPreviewTool, + NamespaceToolParam, + OpenApiTool, + SharepointPreviewTool, + FunctionShellToolParam, + ToolSearchToolParam, + WebSearchTool, + WebSearchPreviewTool, + WorkIQPreviewTool, +] +ToolboxTool = Union[ + A2APreviewToolboxTool, + AzureAISearchToolboxTool, + BrowserAutomationPreviewToolboxTool, + CodeInterpreterToolboxTool, + FabricIQPreviewToolboxTool, + FileSearchToolboxTool, + MCPToolboxTool, + OpenApiToolboxTool, + ReminderPreviewToolboxTool, + ToolboxSearchPreviewToolboxTool, + WebSearchToolboxTool, + WorkIQPreviewToolboxTool, +] +AgentBlueprintReference = Union[ManagedAgentIdentityBlueprintReference] +InsightRequest = Union[ + AgentClusterInsightRequest, EvaluationComparisonInsightRequest, EvaluationRunClusterInsightRequest +] +InsightResult = Union[AgentClusterInsightResult, EvaluationComparisonInsightResult, EvaluationRunClusterInsightResult] +DataGenerationJobSource = Union[ + AgentDataGenerationJobSource, + FileDataGenerationJobSource, + PromptDataGenerationJobSource, + TracesDataGenerationJobSource, +] +AgentDefinition = Union[ExternalAgentDefinition, HostedAgentDefinition, PromptAgentDefinition, WorkflowAgentDefinition] +AgentEndpointAuthorizationScheme = Union[ + BotServiceAuthorizationScheme, + BotServiceRbacAuthorizationScheme, + BotServiceTenantAuthorizationScheme, + EntraAuthorizationScheme, +] +EvaluatorGenerationJobSource = Union[ + AgentEvaluatorGenerationJobSource, + DatasetEvaluatorGenerationJobSource, + PromptEvaluatorGenerationJobSource, + TracesEvaluatorGenerationJobSource, +] +EvaluationTaxonomyInput = Union[AgentTaxonomyInput] +EvaluationTarget = Union[AzureAIAgentTarget, AzureAIModelTarget] +Index = Union[AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex] +RedTeamTargetConfig = Union[AzureOpenAIModelConfiguration] +EvaluatorDefinition = Union[ + CodeBasedEvaluatorDefinition, + EndpointBasedEvaluatorDefinition, + PromptBasedEvaluatorDefinition, + RubricBasedEvaluatorDefinition, +] +FunctionShellToolParamEnvironment = Union[ + ContainerAutoParam, + FunctionShellToolParamEnvironmentContainerReferenceParam, + FunctionShellToolParamEnvironmentLocalEnvironmentParam, +] +ContainerNetworkPolicyParam = Union[ContainerNetworkPolicyAllowlistParam, ContainerNetworkPolicyDisabledParam] +ContainerSkill = Union[InlineSkillParam, SkillReferenceParam] +EvaluationRuleAction = Union[ContinuousEvaluationRuleAction, HumanEvaluationPreviewRuleAction] +Trigger = Union[CronTrigger, OneTimeTrigger, RecurrenceTrigger] +CustomToolParamFormat = Union[CustomGrammarFormatParam, CustomTextFormatParam] +RoutineTrigger = Union[CustomRoutineTrigger, GitHubIssueRoutineTrigger, ScheduleRoutineTrigger, TimerRoutineTrigger] +RecurrenceSchedule = Union[ + DailyRecurrenceSchedule, HourlyRecurrenceSchedule, MonthlyRecurrenceSchedule, WeeklyRecurrenceSchedule +] +DataGenerationJobOptions = Union[ + SimpleQnADataGenerationJobOptions, ToolUseFineTuningDataGenerationJobOptions, TracesDataGenerationJobOptions +] +DataGenerationJobOutput = Union[DatasetDataGenerationJobOutput, FileDataGenerationJobOutput] +DatasetVersion = Union[FileDatasetVersion, FolderDatasetVersion] +InsightSample = Union[EvaluationResultSample] +ScheduleTask = Union[EvaluationScheduleTask, InsightScheduleTask] +VersionSelectionRule = Union[FixedRatioVersionSelectionRule] +TelemetryEndpointAuth = Union[HeaderTelemetryEndpointAuth] +RoutineDispatchPayload = Union[InvokeAgentInvocationsApiDispatchPayload, InvokeAgentResponsesApiDispatchPayload] +RoutineAction = Union[InvokeAgentInvocationsApiRoutineAction, InvokeAgentResponsesApiRoutineAction] +MemoryStoreDefinition = Union[MemoryStoreDefaultDefinition] +OpenApiAuthDetails = Union[OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails] +OptimizationDatasetInput = Union[OptimizationInlineDatasetInput, OptimizationReferenceDatasetInput] +TelemetryEndpoint = Union[OtlpTelemetryEndpoint] +ToolChoiceParam = Union[ + ToolChoiceAllowed, + SpecificApplyPatchParam, + ToolChoiceCodeInterpreter, + ToolChoiceComputer, + ToolChoiceComputerUse, + ToolChoiceComputerUsePreview, + ToolChoiceCustom, + ToolChoiceFileSearch, + ToolChoiceFunction, + ToolChoiceImageGeneration, + ToolChoiceMCP, + SpecificFunctionShellParam, + ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311, +] +TextResponseFormat = Union[TextResponseFormatJsonObject, TextResponseFormatJsonSchema, TextResponseFormatText] +ToolboxSkill = Union[ToolboxSkillReference] +VersionIndicator = Union[VersionRefIndicator] diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py index 467b3f89aa56..ed5a094a4fb0 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_user_identity_isolation.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_user_identity_isolation.py index 83daa9486a28..d2384254bb6a 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_user_identity_isolation.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_agent_user_identity_isolation.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. diff --git a/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py b/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py index 085f5b5f1ec6..8211f50ab60c 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py +++ b/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py @@ -18,7 +18,8 @@ from typing import Final -agent_tools_instructions: Final[str] = """ +agent_tools_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a tool-driven assistant workflow. @@ -43,9 +44,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -memories_instructions: Final[str] = """ +memories_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a memories workflow. @@ -70,9 +73,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -agents_instructions: Final[str] = """ +agents_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct. @@ -103,9 +108,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -chat_completions_instructions: Final[str] = """ +chat_completions_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for Chat Completions scenarios. @@ -124,9 +131,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -resource_management_instructions: Final[str] = """ +resource_management_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for resource-management samples (for example connections, files, and deployments). @@ -152,9 +161,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -fine_tuning_instructions: Final[str] = """ +fine_tuning_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a fine-tuning workflow. @@ -178,9 +189,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -evaluations_instructions: Final[str] = """ +evaluations_instructions: Final[str] = ( + """ We just ran Python code for an evaluation sample and captured print/log output in an attached log file (TXT). Your job: determine if the sample code executed to completion WITHOUT throwing an unhandled exception. @@ -202,9 +215,11 @@ Always respond with `reason` indicating the reason for the response. """.strip() +) -hosted_agents_instructions: Final[str] = """ +hosted_agents_instructions: Final[str] = ( + """ We just ran Python code for a hosted-agent sample and captured print/log output in an attached log file (TXT). Validate whether the sample executed correctly. @@ -226,6 +241,7 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) # Folder (under samples/) -> instructions.