From be3b1813ff9151bed2442cf23f8c732224875648 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:46:42 -0700 Subject: [PATCH 01/40] Remove changelog update step from emitter skill --- .../SKILL.md | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md index 190df28bcbd0..a64f2072daa8 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md @@ -174,18 +174,7 @@ In the folder `sdk\ai\azure-ai-projects`, run `pip install -e .` to install the --- -## Step 12: Update CHANGELOG.md - -Use the **`azsdk-common-generate-sdk-locally`** skill's changelog capability (`azsdk_package_update_changelog_content`) to update `CHANGELOG.md` in the `sdk/ai/azure-ai-projects` folder with a summary of changes from the TypeSpec emit. Some guidelines to follow: -* Start by examining the public SDK API surface of the latest released version of the azure-ai-projects package. The source code for this version can be found in the Main branch of the `azure-sdk-for-python` repository, in the folder `sdk\ai\azure-ai-projects`. -* Then compare it to the public SDK API surface of current version in this topic branch. -* Look at the existing change log from the latest version (if exists) and edit or add to it to capture all the changes you see. If a change log does not exist for the current version at the top of `CHANGELOG.md`, create a new one. -* If a new method was added, there is no need to add the list of all new classes that define the inputs and output of the method. It's enough to mention that the new method was added. -* Show the user the proposed changelog entry and ask for confirmation or edits before saving. - ---- - -## Step 13: Commit and push +## Step 12: Commit and push Stage all changes (excluding file names that start with `.env`), commit, and push the topic branch: @@ -199,7 +188,7 @@ git push -u origin --- -## Step 14: Create a Pull Request +## Step 13: Create a Pull Request Create a draft PR from the **topic branch** to the **base branch** (recorded in Step 2): @@ -216,7 +205,7 @@ Open a new tab in the default browser and navigate to the PR URL. --- -## Step 15: Optionally run tests locally +## Step 14: Optionally run tests locally Prompt the user with this message: "Tests will run as part of the Pull Request. However, you can optionally run tests locally in a Python virtual environment, right now. It will take a few minutes. Do you want to run tests locally? (yes/no)" From 88c333c5de32deb9f9815129672a5df304a1bd12 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:53:27 -0700 Subject: [PATCH 02/40] restore tsp-location.yaml --- .../{tsp-location.yaml.saved => tsp-location.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sdk/ai/azure-ai-projects/{tsp-location.yaml.saved => tsp-location.yaml} (100%) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml similarity index 100% rename from sdk/ai/azure-ai-projects/tsp-location.yaml.saved rename to sdk/ai/azure-ai-projects/tsp-location.yaml From 5fce783a239a31149ff226c0f8db6def5b72d0b2 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:34:26 -0700 Subject: [PATCH 03/40] [azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294) --- .../azure-ai-projects/apiview-properties.json | 3 +- .../ai/projects/aio/operations/_operations.py | 106 +++++++++--------- .../azure/ai/projects/models/__init__.py | 2 - .../azure/ai/projects/models/_models.py | 51 +-------- .../ai/projects/operations/_operations.py | 101 ++++++++--------- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 6 files changed, 104 insertions(+), 161 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 9aebac269df8..84e5808339c6 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -24,7 +24,6 @@ "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", - "azure.ai.projects.models.AgentsPagedResultOptimizationCandidate": "Azure.AI.Projects.AgentsPagedResult", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", @@ -475,5 +474,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "c44eac94eea1" + "CrossLanguageVersion": "3ae42dbde611" } \ No newline at end of file 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 118e80092cf3..5104a3473fa8 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 @@ -4889,17 +4889,16 @@ async def delete_optimization_job(self, job_id: str, *, force: Optional[bool] = if cls: return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace_async - async def list_optimization_candidates( + @distributed_trace + def list_optimization_candidates( self, job_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultOptimizationCandidate: + ) -> AsyncItemPaged["_models.OptimizationCandidate"]: """Returns a list of candidates for an optimization job. List candidates produced by a job. @@ -4914,23 +4913,22 @@ async def list_optimization_candidates( ascending order and``desc`` for descending order. Known values are: "asc" and "desc". Default value is None. :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword after: A cursor for use in pagination. ``after`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :return: AgentsPagedResultOptimizationCandidate. The AgentsPagedResultOptimizationCandidate is - compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultOptimizationCandidate + :return: An iterator like instance of OptimizationCandidate + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4939,56 +4937,54 @@ async def list_optimization_candidates( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultOptimizationCandidate] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=after, - before=before, - api_version=self._config.api_version, - 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) + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request - _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 - ) + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - if response.status_code not in [200]: - 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, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentsPagedResultOptimizationCandidate, response.json()) + if response.status_code not in [200]: + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async async def get_optimization_candidate( 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 29197fc4bbad..20c92f03d969 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 @@ -34,7 +34,6 @@ AgentTaxonomyInput, AgentVersionDetails, AgenticIdentityPreviewCredentials, - AgentsPagedResultOptimizationCandidate, ApiError, ApiErrorResponse, ApiKeyCredentials, @@ -462,7 +461,6 @@ "AgentTaxonomyInput", "AgentVersionDetails", "AgenticIdentityPreviewCredentials", - "AgentsPagedResultOptimizationCandidate", "ApiError", "ApiErrorResponse", "ApiKeyCredentials", 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 308e0e1be187..40f17df60f48 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 @@ -1013,51 +1013,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentsPagedResultOptimizationCandidate(_Model): - """The response data for a requested list of items. - - :ivar data: The requested list of items. Required. - :vartype data: list[~azure.ai.projects.models.OptimizationCandidate] - :ivar first_id: The first ID represented in this list. - :vartype first_id: str - :ivar last_id: The last ID represented in this list. - :vartype last_id: str - :ivar has_more: A value indicating whether there are additional values available not captured - in this list. Required. - :vartype has_more: bool - """ - - data: list["_models.OptimizationCandidate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The requested list of items. Required.""" - first_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The first ID represented in this list.""" - last_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The last ID represented in this list.""" - has_more: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A value indicating whether there are additional values available not captured in this list. - Required.""" - - @overload - def __init__( - self, - *, - data: list["_models.OptimizationCandidate"], - has_more: bool, - first_id: Optional[str] = None, - last_id: 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 EvaluationTaxonomyInput(_Model): """Input configuration for the evaluation taxonomy. @@ -6422,14 +6377,14 @@ class EvaluationScheduleTask(ScheduleTask, discriminator="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: any + :vartype eval_run: dict[str, any] """ type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. Evaluation task.""" eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) """Identifier of the evaluation group. Required.""" - eval_run: Any = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) + eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) """The evaluation run payload. Required.""" @overload @@ -6437,7 +6392,7 @@ def __init__( self, *, eval_id: str, - eval_run: Any, + eval_run: dict[str, Any], configuration: Optional[dict[str, str]] = None, ) -> None: ... 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 2ae3231aea70..e75ce4c9d73f 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 @@ -8499,10 +8499,9 @@ def list_optimization_candidates( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultOptimizationCandidate: + ) -> ItemPaged["_models.OptimizationCandidate"]: """Returns a list of candidates for an optimization job. List candidates produced by a job. @@ -8517,23 +8516,21 @@ def list_optimization_candidates( ascending order and``desc`` for descending order. Known values are: "asc" and "desc". Default value is None. :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword after: A cursor for use in pagination. ``after`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :return: AgentsPagedResultOptimizationCandidate. The AgentsPagedResultOptimizationCandidate is - compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultOptimizationCandidate + :return: An iterator like instance of OptimizationCandidate + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8542,56 +8539,54 @@ def list_optimization_candidates( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultOptimizationCandidate] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=after, - before=before, - api_version=self._config.api_version, - 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) + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request - _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 - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - if response.status_code not in [200]: - 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, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentsPagedResultOptimizationCandidate, response.json()) + if response.status_code not in [200]: + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index ce66d3088118..b9bf529d1e4c 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai-foundry/data-plane/Foundry -commit: e041b5a178996b62fe86a267dc468df5c1677c54 +commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 repo: Azure/azure-rest-api-specs additionalDirectories: From 04139a93e384edee99fa8816cc916120072c70f4 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:25:21 -0700 Subject: [PATCH 04/40] [azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318) --- eng/emitter-package-lock.json | 272 ++++++------- eng/emitter-package.json | 2 +- .../azure-ai-projects/apiview-properties.json | 11 +- .../azure/ai/projects/models/__init__.py | 18 + .../azure/ai/projects/models/_enums.py | 28 ++ .../azure/ai/projects/models/_models.py | 367 ++++++++++++++++-- 6 files changed, 519 insertions(+), 179 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 36f86e86f704..e682063f596c 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.62.1" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.11.0", + "@azure-tools/openai-typespec": "1.19.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", @@ -29,14 +29,14 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.11.0.tgz", - "integrity": "sha512-xxHeThd4CJZeOZ7JPV6lPj+8vSkO7V1qZ+zodQdZdlx0jDX7tTJ9VJ5ZakZ/R7g+3sfoECIuhE0TCz+Wq6nXWA==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", + "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", "dev": true, "license": "MIT", "peerDependencies": { - "@typespec/http": "*", - "@typespec/openapi": "*" + "@typespec/http": "^1.11.0", + "@typespec/openapi": "^1.11.0" } }, "node_modules/@azure-tools/typespec-autorest": { @@ -115,9 +115,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.68.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.68.1.tgz", - "integrity": "sha512-b27LO6KW3rE/SrLdMgsLKcIQ9tTglGLVQF2zv1cgHO5CWh/OeJhP6R2Cw5R0HPbDIcfpoLD6te++GlveL1VtVg==", + "version": "0.68.4", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.68.4.tgz", + "integrity": "sha512-p32EXsrSC9giZUNdsQ2gmvDENFIEW2E0zto3FmjBZ3OeB5wCw1ZAZ+KnO0rsoKFovBvHSsQatNCKJvM/x89AgA==", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -178,12 +178,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", - "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.28.5", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -192,9 +192,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -617,27 +617,27 @@ } }, "node_modules/@inquirer/ansi": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-2.0.5.tgz", - "integrity": "sha512-doc2sWgJpbFQ64UflSVd17ibMGDuxO1yKgOgLMwavzESnXjFWJqUeG8saYosqKpHp4kWiM5x1nXvEjbpx90gzw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-2.0.7.tgz", + "integrity": "sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q==", "license": "MIT", "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" } }, "node_modules/@inquirer/checkbox": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.1.5.tgz", - "integrity": "sha512-Jmf9tgBHIEK5SAOB7swYfStqmtkZb00xOTpSQmkoGEpdxOTpJi9RS0A8bkfDPHTTItZRJrRdZrEMu25wyj0VfQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.2.1.tgz", + "integrity": "sha512-b6xmA/VlTe0ZgDQHDui+Nav470u7u49nRd8/iuhOcQPO9Ch7lGuogydhi2VOmNlZ+zXcM8IcPuNSwQcdJaF/kw==", "license": "MIT", "dependencies": { - "@inquirer/ansi": "^2.0.5", - "@inquirer/core": "^11.1.10", - "@inquirer/figures": "^2.0.5", - "@inquirer/type": "^4.0.5" + "@inquirer/ansi": "^2.0.7", + "@inquirer/core": "^11.2.1", + "@inquirer/figures": "^2.0.7", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -649,16 +649,16 @@ } }, "node_modules/@inquirer/confirm": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.0.13.tgz", - "integrity": "sha512-wkGPC7yJ5WJk1DJ5SX7fzk+gfj4BM8cf5dDDi71B/551xHrdsZVRJOC0WyikXd0pEsb/9cLniuE4atbsMqmFkw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.1.1.tgz", + "integrity": "sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -670,21 +670,21 @@ } }, "node_modules/@inquirer/core": { - "version": "11.1.10", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.1.10.tgz", - "integrity": "sha512-a4Q5BXHQAHa9eO202sTaFCHFYVB3x5fauDuThEAdZ9gfn76pSxiKU7wWcEH0N1O0XmQvNfQNU6QXpiRxmYQx+A==", + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.2.1.tgz", + "integrity": "sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA==", "license": "MIT", "dependencies": { - "@inquirer/ansi": "^2.0.5", - "@inquirer/figures": "^2.0.5", - "@inquirer/type": "^4.0.5", + "@inquirer/ansi": "^2.0.7", + "@inquirer/figures": "^2.0.7", + "@inquirer/type": "^4.0.7", "cli-width": "^4.1.0", "fast-wrap-ansi": "^0.2.0", "mute-stream": "^3.0.0", "signal-exit": "^4.1.0" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -696,17 +696,17 @@ } }, "node_modules/@inquirer/editor": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.1.2.tgz", - "integrity": "sha512-Y3Nor7S/DhIPo+8Ym/dSY4efwKI4BsflKDwXh0jNeXJsSF3dteS/3Yf+z4wkibVZDvYMyCgknSTQlNahfunGHg==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.2.2.tgz", + "integrity": "sha512-ZRVd/oD+sYsUd5zVm0NflqEzlqfYCyHNsqkHl2oWXEUHs12tCbcSFi+wVFEvD8+LGRaMUsVrE7qeo6lSG/S1Vg==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/external-editor": "^3.0.0", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/external-editor": "^3.0.3", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -718,16 +718,16 @@ } }, "node_modules/@inquirer/expand": { - "version": "5.0.14", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.0.14.tgz", - "integrity": "sha512-qyY9zcIX2eKYwaAUiQo9zORd61Lc3sXeM72fVbeHkYnDkqfr8/armcRbmVAIrExeJhI2puk+uomeKtWrpUVUmQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.1.1.tgz", + "integrity": "sha512-YmQpenjbFSHAK3sOd44puHh3V1KXXr+JiNpUztoSQ4drLh2rTVzTap/YtlAVu/5xavifIlBfNEzJ/neZJ1a/1g==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -739,16 +739,16 @@ } }, "node_modules/@inquirer/external-editor": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-3.0.0.tgz", - "integrity": "sha512-lDSwMgg+M5rq6JKBYaJwSX6T9e/HK2qqZ1oxmOwn4AQoJE5D+7TumsxLGC02PWS//rkIVqbZv3XA3ejsc9FYvg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-6thf5I8q7lZwzGLAxPaaGEREEkZ3nyePPDQ1oyobblxmEE8mqTLguScP7pDjUTAibiyb4hfXl+qjUEJ+di/aNA==", "license": "MIT", "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.2" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -760,25 +760,25 @@ } }, "node_modules/@inquirer/figures": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-2.0.5.tgz", - "integrity": "sha512-NsSs4kzfm12lNetHwAn3GEuH317IzpwrMCbOuMIVytpjnJ90YYHNwdRgYGuKmVxwuIqSgqk3M5qqQt1cDk0tGQ==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-2.0.7.tgz", + "integrity": "sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw==", "license": "MIT", "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" } }, "node_modules/@inquirer/input": { - "version": "5.0.13", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.0.13.tgz", - "integrity": "sha512-0l0jCHlJnXIV8CTxwQC0C+5Ziq8WP22edWgmciW2xYvoeoSck4v5FvCS1ctKdqLLR0dUo93uAHgWHywgBSoRyw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.1.2.tgz", + "integrity": "sha512-9K/DDBSQpOyZSkt6sOVP9Vo0TR7atX2kuILsUu0x3wVcVbe97lJwIJKMLdMw25tDYuXl/qp6erT0Xs1rfmcfZg==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -790,16 +790,16 @@ } }, "node_modules/@inquirer/number": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.0.13.tgz", - "integrity": "sha512-WHmkYnnJAou5gx7RgcvAfUggnHNM1zWfoh0dFPl3dxVssuqt+dK5rIbaOYQXNyOegvFnopbKupjnhw2O8gANNg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.1.1.tgz", + "integrity": "sha512-XF4IXAbPnGPgw0wsbC/i2tPcyfdZgDpUlhsqU0SfT4IRIGWha6Xm9VRgN5yYxJq+jnyXlfXI/nQ3ulfk0iEICA==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -811,17 +811,17 @@ } }, "node_modules/@inquirer/password": { - "version": "5.0.13", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.0.13.tgz", - "integrity": "sha512-XDGu64ROHZjOOXLAANvJN7iIxWKhOSCG5VakrZ5kaScVR+snVJCFglD/hL3/677awtWcu4pXoWa280CDIYcBeg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.1.1.tgz", + "integrity": "sha512-3XBfF7DAsp5qeDsvN5Rd1HmbNokVvEQoUM0QLrRcybC9nX96w3Pbmu7qUsb3IT3J3jBvs2+mTXaKHOUsgHMLzg==", "license": "MIT", "dependencies": { - "@inquirer/ansi": "^2.0.5", - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/ansi": "^2.0.7", + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -833,24 +833,24 @@ } }, "node_modules/@inquirer/prompts": { - "version": "8.4.3", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.4.3.tgz", - "integrity": "sha512-ai5LseTw9HhegupIgmo4cn7RpnCGznjjXu4OI+7jMR8vu7T1ZCCNMzFFAovUCjL1fl0cceksIN1++yQE59SmZw==", + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.5.2.tgz", + "integrity": "sha512-IYR/3C/paEVVQYQvdDlFZVjRCJVYHHON0XXMH91KO9GSxs0TdKYWlUdvfQl2EfAHDxUaN3IBffkE/BDTh5nJ6g==", "license": "MIT", "dependencies": { - "@inquirer/checkbox": "^5.1.5", - "@inquirer/confirm": "^6.0.13", - "@inquirer/editor": "^5.1.2", - "@inquirer/expand": "^5.0.14", - "@inquirer/input": "^5.0.13", - "@inquirer/number": "^4.0.13", - "@inquirer/password": "^5.0.13", - "@inquirer/rawlist": "^5.2.9", - "@inquirer/search": "^4.1.9", - "@inquirer/select": "^5.1.5" + "@inquirer/checkbox": "^5.2.1", + "@inquirer/confirm": "^6.1.1", + "@inquirer/editor": "^5.2.2", + "@inquirer/expand": "^5.1.1", + "@inquirer/input": "^5.1.2", + "@inquirer/number": "^4.1.1", + "@inquirer/password": "^5.1.1", + "@inquirer/rawlist": "^5.3.1", + "@inquirer/search": "^4.2.1", + "@inquirer/select": "^5.2.1" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -862,16 +862,16 @@ } }, "node_modules/@inquirer/rawlist": { - "version": "5.2.9", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.2.9.tgz", - "integrity": "sha512-a1ErXEfgjfPYpyQ89dp+7n2IISjH9oQg3ygvF5adz8B7aHn4n2PjEgu1wpVTp69K3bj3lVLxP0qJ2b1clk1Whw==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.3.1.tgz", + "integrity": "sha512-QqdTqQddL3qPX/PPrjobpsO25NZ4dWXgTLenrR445L2ptLEYE6Z+PD5c5CNDJNx4ugRgELAIpSIJxZaO2jJ2Og==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -883,17 +883,17 @@ } }, "node_modules/@inquirer/search": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.1.9.tgz", - "integrity": "sha512-ZlbM28Q9lmLkFPNAIv+ZuY530n5Km8U1WW48oYEvDhe9yc2uL3m3t+JSdRUkQlk5fuIuskgiIVjcb7czFzQpuA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.2.1.tgz", + "integrity": "sha512-xJj8QWKRSrfKoBIITLZK61dD3zwo0Rz11fgDImku30/Oe81zMdIdGgrLY2h6RkJ+KZ/GhNYIRMKnH/62qBTA5g==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.1.10", - "@inquirer/figures": "^2.0.5", - "@inquirer/type": "^4.0.5" + "@inquirer/core": "^11.2.1", + "@inquirer/figures": "^2.0.7", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -905,18 +905,18 @@ } }, "node_modules/@inquirer/select": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.1.5.tgz", - "integrity": "sha512-6SRg6kHfK/sjLXOsuqNebuir+sjwrf/iWuRUnXgB2slzEewppI1WfzeS16XxDcOQmXBruMmmB9Cgrz7wsAxqMg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.2.1.tgz", + "integrity": "sha512-FlDndEUww8m7BfukO2nJa25vhD+H5jxxCv4oGioKqzyWz3nPHhhw4LKdYRSlXuAx7DsdWia7iyaBPKKS95Evfw==", "license": "MIT", "dependencies": { - "@inquirer/ansi": "^2.0.5", - "@inquirer/core": "^11.1.10", - "@inquirer/figures": "^2.0.5", - "@inquirer/type": "^4.0.5" + "@inquirer/ansi": "^2.0.7", + "@inquirer/core": "^11.2.1", + "@inquirer/figures": "^2.0.7", + "@inquirer/type": "^4.0.7" }, "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -928,12 +928,12 @@ } }, "node_modules/@inquirer/type": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-4.0.5.tgz", - "integrity": "sha512-aetVUNeKNc/VriqXlw1NRSW0zhMBB0W4bNbWRJgzRl/3d0QNDQFfk0GO5SDdtjMZVg6o8ZKEiadd7SCCzoOn5Q==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-4.0.7.tgz", + "integrity": "sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g==", "license": "MIT", "engines": { - "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" + "node": ">=23.5.0 || ^22.13.0 || ^20.17.0" }, "peerDependencies": { "@types/node": ">=18" @@ -957,9 +957,9 @@ } }, "node_modules/@scalar/helpers": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.0.tgz", - "integrity": "sha512-gmOC6VravNB9VDl6wnt/GOj4K/hn48tj5bpW4AM4MhH8Ubil6uu7g1DSoKHwltu8Ks79KEtR6JmOrROi9R7jaQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.1.tgz", + "integrity": "sha512-yuiuBCadP5bjAnIv23QvifVN/NaMi9xBF6b8Wdk4QOzwzLPJmp699MAdf33J0A5i2qKcvnu32iz/VkEJmQRe5g==", "dev": true, "license": "MIT", "engines": { @@ -967,13 +967,13 @@ } }, "node_modules/@scalar/json-magic": { - "version": "0.12.14", - "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.14.tgz", - "integrity": "sha512-dWrCy3ew1r7OQ1pu2r4ZjiKEVy0yVd66kXdmsl41bteOG2F2I2IBlPjmPV6p8ckjImQHxtNBIntFaQfNrdBhJg==", + "version": "0.12.15", + "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.15.tgz", + "integrity": "sha512-ZYgdYZ0jSZXQeyhG2lJ20FjzvKsaDRXk4bPguF/Ytl2nGBh9a6RIIr9NvVy4zAD67a/ahm+xipXlfoR1KtB5fg==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.8.0", + "@scalar/helpers": "0.8.1", "pathe": "^2.0.3", "yaml": "^2.8.3" }, @@ -1851,9 +1851,9 @@ } }, "node_modules/tar": { - "version": "7.5.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz", - "integrity": "sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==", + "version": "7.5.16", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.16.tgz", + "integrity": "sha512-56adEpPMouktRlBLXiaYFFzZ/3+JXa8P9n7WbR+ibIjtviN55mEaOkiysCnPnWm+7kkui1Dn8J9l+g6zV8731w==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", @@ -1882,9 +1882,9 @@ "license": "ISC" }, "node_modules/tsx": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.3.tgz", - "integrity": "sha512-mdoNxBC/cSQObGGVQ5Bpn5i+yv7j68gk3Nfm3wFjcJg3Z0Mix9jzAFfP12prmm5eVGmDKtp0yyArrs0Q+8gZHg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz", + "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==", "license": "MIT", "dependencies": { "esbuild": "~0.28.0" @@ -1960,9 +1960,9 @@ } }, "node_modules/ws": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", - "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", "license": "MIT", "engines": { "node": ">=10.0.0" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 1fb8161b69f1..5818b7083707 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -14,7 +14,7 @@ "@typespec/streams": "~0.82.0", "@typespec/xml": "~0.82.0", "@typespec/openapi3": "1.12.0", - "@azure-tools/openai-typespec": "1.11.0", + "@azure-tools/openai-typespec": "1.19.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 84e5808339c6..2495388ba138 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -78,6 +78,7 @@ "azure.ai.projects.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", "azure.ai.projects.models.ComparisonFilter": "OpenAI.ComparisonFilter", "azure.ai.projects.models.CompoundFilter": "OpenAI.CompoundFilter", + "azure.ai.projects.models.ComputerTool": "OpenAI.ComputerTool", "azure.ai.projects.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", "azure.ai.projects.models.FunctionShellToolParamEnvironment": "OpenAI.FunctionShellToolParamEnvironment", @@ -131,6 +132,7 @@ "azure.ai.projects.models.Dimension": "Azure.AI.Projects.Dimension", "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", "azure.ai.projects.models.EntraAuthorizationScheme": "Azure.AI.Projects.EntraAuthorizationScheme", "azure.ai.projects.models.EntraIDCredentials": "Azure.AI.Projects.EntraIDCredentials", "azure.ai.projects.models.IsolationKeySource": "Azure.AI.Projects.IsolationKeySource", @@ -173,6 +175,7 @@ "azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam": "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam": "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam", "azure.ai.projects.models.FunctionTool": "OpenAI.FunctionTool", + "azure.ai.projects.models.FunctionToolParam": "OpenAI.FunctionToolParam", "azure.ai.projects.models.GitHubIssueRoutineTrigger": "Azure.AI.Projects.GitHubIssueRoutineTrigger", "azure.ai.projects.models.HeaderIsolationKeySource": "Azure.AI.Projects.HeaderIsolationKeySource", "azure.ai.projects.models.TelemetryEndpointAuth": "Azure.AI.Projects.TelemetryEndpointAuth", @@ -228,6 +231,7 @@ "azure.ai.projects.models.ModelSourceData": "Azure.AI.Projects.ModelSourceData", "azure.ai.projects.models.ModelVersion": "Azure.AI.Projects.ModelVersion", "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", + "azure.ai.projects.models.NamespaceToolParam": "OpenAI.NamespaceToolParam", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", "azure.ai.projects.models.OneTimeTrigger": "Azure.AI.Projects.OneTimeTrigger", "azure.ai.projects.models.OpenApiAuthDetails": "Azure.AI.Projects.OpenApiAuthDetails", @@ -307,6 +311,8 @@ "azure.ai.projects.models.ToolboxVersionObject": "Azure.AI.Projects.ToolboxVersionObject", "azure.ai.projects.models.ToolChoiceAllowed": "OpenAI.ToolChoiceAllowed", "azure.ai.projects.models.ToolChoiceCodeInterpreter": "OpenAI.ToolChoiceCodeInterpreter", + "azure.ai.projects.models.ToolChoiceComputer": "OpenAI.ToolChoiceComputer", + "azure.ai.projects.models.ToolChoiceComputerUse": "OpenAI.ToolChoiceComputerUse", "azure.ai.projects.models.ToolChoiceComputerUsePreview": "OpenAI.ToolChoiceComputerUsePreview", "azure.ai.projects.models.ToolChoiceCustom": "OpenAI.ToolChoiceCustom", "azure.ai.projects.models.ToolChoiceFileSearch": "OpenAI.ToolChoiceFileSearch", @@ -318,6 +324,7 @@ "azure.ai.projects.models.ToolConfig": "Azure.AI.Projects.ToolConfig", "azure.ai.projects.models.ToolDescription": "Azure.AI.Projects.ToolDescription", "azure.ai.projects.models.ToolProjectConnection": "Azure.AI.Projects.ToolProjectConnection", + "azure.ai.projects.models.ToolSearchToolParam": "OpenAI.ToolSearchToolParam", "azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions": "Azure.AI.Projects.ToolUseFineTuningDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobOptions": "Azure.AI.Projects.TracesDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", @@ -351,7 +358,9 @@ "azure.ai.projects.models.OpenApiAuthType": "Azure.AI.Projects.OpenApiAuthType", "azure.ai.projects.models.FunctionShellToolParamEnvironmentType": "OpenAI.FunctionShellToolParamEnvironmentType", "azure.ai.projects.models.ContainerSkillType": "OpenAI.ContainerSkillType", + "azure.ai.projects.models.ToolSearchExecutionType": "OpenAI.ToolSearchExecutionType", "azure.ai.projects.models.SearchContextSize": "OpenAI.SearchContextSize", + "azure.ai.projects.models.SearchContentType": "OpenAI.SearchContentType", "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.CodeDependencyResolution": "Azure.AI.Projects.CodeDependencyResolution", "azure.ai.projects.models.TelemetryEndpointKind": "Azure.AI.Projects.TelemetryEndpointKind", @@ -474,5 +483,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "3ae42dbde611" + "CrossLanguageVersion": "ca205130211f" } \ No newline at end of file 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 20c92f03d969..0379362a10a5 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 @@ -80,6 +80,7 @@ CodeInterpreterTool, ComparisonFilter, CompoundFilter, + ComputerTool, ComputerUsePreviewTool, Connection, ContainerAutoParam, @@ -129,6 +130,7 @@ Dimension, DispatchRoutineResult, EmbeddingConfiguration, + EmptyModelParam, EntraAuthorizationScheme, EntraIDCredentials, EntraIsolationKeySource, @@ -173,6 +175,7 @@ FunctionShellToolParamEnvironmentContainerReferenceParam, FunctionShellToolParamEnvironmentLocalEnvironmentParam, FunctionTool, + FunctionToolParam, GitHubIssueRoutineTrigger, HeaderIsolationKeySource, HeaderTelemetryEndpointAuth, @@ -231,6 +234,7 @@ ModelSourceData, ModelVersion, MonthlyRecurrenceSchedule, + NamespaceToolParam, NoAuthenticationCredentials, OneTimeTrigger, OpenApiAnonymousAuthDetails, @@ -311,6 +315,8 @@ Tool, ToolChoiceAllowed, ToolChoiceCodeInterpreter, + ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, @@ -323,6 +329,7 @@ ToolConfig, ToolDescription, ToolProjectConnection, + ToolSearchToolParam, ToolUseFineTuningDataGenerationJobOptions, ToolboxObject, ToolboxPolicies, @@ -421,6 +428,7 @@ SampleType, ScheduleProvisioningStatus, ScheduleTaskType, + SearchContentType, SearchContextSize, SessionLogEventType, SimpleQnAFineTuningQuestionType, @@ -430,6 +438,7 @@ TelemetryTransportProtocol, TextResponseFormatConfigurationType, ToolChoiceParamType, + ToolSearchExecutionType, ToolType, TreatmentEffectType, TriggerType, @@ -507,6 +516,7 @@ "CodeInterpreterTool", "ComparisonFilter", "CompoundFilter", + "ComputerTool", "ComputerUsePreviewTool", "Connection", "ContainerAutoParam", @@ -556,6 +566,7 @@ "Dimension", "DispatchRoutineResult", "EmbeddingConfiguration", + "EmptyModelParam", "EntraAuthorizationScheme", "EntraIDCredentials", "EntraIsolationKeySource", @@ -600,6 +611,7 @@ "FunctionShellToolParamEnvironmentContainerReferenceParam", "FunctionShellToolParamEnvironmentLocalEnvironmentParam", "FunctionTool", + "FunctionToolParam", "GitHubIssueRoutineTrigger", "HeaderIsolationKeySource", "HeaderTelemetryEndpointAuth", @@ -658,6 +670,7 @@ "ModelSourceData", "ModelVersion", "MonthlyRecurrenceSchedule", + "NamespaceToolParam", "NoAuthenticationCredentials", "OneTimeTrigger", "OpenApiAnonymousAuthDetails", @@ -738,6 +751,8 @@ "Tool", "ToolChoiceAllowed", "ToolChoiceCodeInterpreter", + "ToolChoiceComputer", + "ToolChoiceComputerUse", "ToolChoiceComputerUsePreview", "ToolChoiceCustom", "ToolChoiceFileSearch", @@ -750,6 +765,7 @@ "ToolConfig", "ToolDescription", "ToolProjectConnection", + "ToolSearchToolParam", "ToolUseFineTuningDataGenerationJobOptions", "ToolboxObject", "ToolboxPolicies", @@ -845,6 +861,7 @@ "SampleType", "ScheduleProvisioningStatus", "ScheduleTaskType", + "SearchContentType", "SearchContextSize", "SessionLogEventType", "SimpleQnAFineTuningQuestionType", @@ -854,6 +871,7 @@ "TelemetryTransportProtocol", "TextResponseFormatConfigurationType", "ToolChoiceParamType", + "ToolSearchExecutionType", "ToolType", "TreatmentEffectType", "TriggerType", 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 fb8d84b06bce..bc29c0a8b58d 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 @@ -950,6 +950,15 @@ class ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Insight task.""" +class SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of SearchContentType.""" + + TEXT = "text" + """TEXT.""" + IMAGE = "image" + """IMAGE.""" + + class SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of SearchContextSize.""" @@ -1051,6 +1060,19 @@ class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IMAGE_GENERATION.""" CODE_INTERPRETER = "code_interpreter" """CODE_INTERPRETER.""" + COMPUTER = "computer" + """COMPUTER.""" + COMPUTER_USE = "computer_use" + """COMPUTER_USE.""" + + +class ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolSearchExecutionType.""" + + SERVER = "server" + """SERVER.""" + CLIENT = "client" + """CLIENT.""" class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1060,6 +1082,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """FUNCTION.""" FILE_SEARCH = "file_search" """FILE_SEARCH.""" + COMPUTER = "computer" + """COMPUTER.""" COMPUTER_USE_PREVIEW = "computer_use_preview" """COMPUTER_USE_PREVIEW.""" WEB_SEARCH = "web_search" @@ -1076,6 +1100,10 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SHELL.""" CUSTOM = "custom" """CUSTOM.""" + NAMESPACE = "namespace" + """NAMESPACE.""" + TOOL_SEARCH = "tool_search" + """TOOL_SEARCH.""" WEB_SEARCH_PREVIEW = "web_search_preview" """WEB_SEARCH_PREVIEW.""" APPLY_PATCH = "apply_patch" 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 40f17df60f48..368fad6a64fd 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 @@ -66,31 +66,32 @@ class Tool(_Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationPreviewTool, - CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerUsePreviewTool, CustomToolParam, - MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, - LocalShellToolParam, MCPTool, MemorySearchPreviewTool, OpenApiTool, SharepointPreviewTool, - FunctionShellToolParam, ToolboxSearchPreviewTool, WebSearchTool, WebSearchPreviewTool, - WorkIQPreviewTool - - :ivar type: Required. Known values are: "function", "file_search", "computer_use_preview", - "web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom", - "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". + CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, + CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, + ImageGenTool, LocalShellToolParam, MCPTool, MemorySearchPreviewTool, NamespaceToolParam, + OpenApiTool, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, + ToolboxSearchPreviewTool, 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". :vartype type: str or ~azure.ai.projects.models.ToolType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function\", \"file_search\", \"computer_use_preview\", - \"web_search\", \"mcp\", \"code_interpreter\", \"image_generation\", \"local_shell\", - \"shell\", \"custom\", \"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\".""" + """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\".""" @overload def __init__( @@ -3414,8 +3415,8 @@ class ComparisonFilter(_Model): * `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"] - :vartype type: str or str or str or str or str or str + Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] + :vartype type: str or str or str or str or str or str or str or str :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 @@ -3423,7 +3424,7 @@ class ComparisonFilter(_Model): :vartype value: str or float or bool or list[str or float] """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"] = rest_field( + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, @@ -3437,7 +3438,8 @@ class ComparisonFilter(_Model): * `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[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"], + Literal[\"in\"], Literal[\"nin\"]""" key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The key to compare against the value. Required.""" value: Union[str, float, bool, list[Union[str, float]]] = rest_field( @@ -3450,7 +3452,7 @@ class ComparisonFilter(_Model): def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"], + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], key: str, value: Union[str, float, bool, list[Union[str, float]]], ) -> None: ... @@ -3504,6 +3506,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ComputerTool(Tool, discriminator="computer"): + """Computer. + + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolType.COMPUTER # type: ignore + + class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): """Computer use preview. @@ -3758,7 +3787,7 @@ class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discrimi allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A list of allowed domains when type is ``allowlist``. Required.""" domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + visibility=["create"] ) """Optional domain-scoped secrets for allowlisted domains.""" @@ -3922,6 +3951,10 @@ class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="contin :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: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -3932,6 +3965,12 @@ class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="contin name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] ) """Maximum number of evaluation runs allowed per hour.""" + sampling_rate: Optional[float] = rest_field( + name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -3939,6 +3978,7 @@ def __init__( *, eval_id: str, max_hourly_runs: Optional[int] = None, + sampling_rate: Optional[float] = None, ) -> None: ... @overload @@ -4487,6 +4527,8 @@ class CustomToolParam(Tool, discriminator="custom"): :vartype description: str :ivar format: The input format for the custom tool. Default is unconstrained text. :vartype format: ~azure.ai.projects.models.CustomToolParamFormat + :ivar defer_loading: Whether this tool should be deferred and discovered via tool search. + :vartype defer_loading: bool """ type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -4499,6 +4541,8 @@ class CustomToolParam(Tool, discriminator="custom"): visibility=["read", "create", "update", "delete", "query"] ) """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this tool should be deferred and discovered via tool search.""" @overload def __init__( @@ -4507,6 +4551,7 @@ def __init__( name: str, description: Optional[str] = None, format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -5654,6 +5699,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class EmptyModelParam(_Model): + """EmptyModelParam.""" + + class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): """EntraAuthorizationScheme. @@ -7601,6 +7650,8 @@ class FunctionTool(Tool, discriminator="function"): :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: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -7612,6 +7663,8 @@ class FunctionTool(Tool, discriminator="function"): """Required.""" strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function is deferred and loaded via tool search.""" @overload def __init__( @@ -7621,6 +7674,7 @@ def __init__( parameters: dict[str, Any], strict: bool, description: Optional[str] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -7635,6 +7689,58 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FUNCTION # type: ignore +class FunctionToolParam(_Model): + """FunctionToolParam. + + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar defer_loading: Whether this function should be deferred and discovered via tool search. + :vartype defer_loading: bool + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function should be deferred and discovered via tool search.""" + + @overload + def __init__( + self, + *, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, + strict: Optional[bool] = None, + defer_loading: Optional[bool] = 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) + self.type: Literal["function"] = "function" + + class GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): """A GitHub issue routine trigger. @@ -7993,10 +8099,18 @@ class ImageGenTool(Tool, discriminator="image_generation"): ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["auto"] :vartype quality: str or str or str or str - :ivar size: The size of the generated image. One of ``1024x1024``, ``1024x1536``, - ``1536x1024``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"] - :vartype size: str or str or str or str + :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: str or str or str or str or 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"] @@ -8044,12 +8158,19 @@ class ImageGenTool(Tool, discriminator="image_generation"): """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: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The size of the generated image. One of ``1024x1024``, ``1024x1536``, ``1536x1024``, or - ``auto``. Default: ``auto``. Is one of the following types: Literal[\"1024x1024\"], - Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"]""" + """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: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -8103,7 +8224,9 @@ def __init__( Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] ] = None, quality: Optional[Literal["low", "medium", "high", "auto"]] = None, - size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None, + size: Optional[ + Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + ] = None, output_format: Optional[Literal["png", "webp", "jpeg"]] = None, output_compression: Optional[int] = None, moderation: Optional[Literal["auto", "low"]] = None, @@ -9024,6 +9147,8 @@ class MCPTool(Tool, discriminator="mcp"): :ivar require_approval: Is one of the following types: MCPToolRequireApproval, Literal["always"], Literal["never"] :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :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. @@ -9083,6 +9208,8 @@ class MCPTool(Tool, discriminator="mcp"): rest_field(visibility=["read", "create", "update", "delete", "query"]) ) """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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.""" @@ -9116,6 +9243,7 @@ def __init__( headers: Optional[dict[str, str]] = None, allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, project_connection_id: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @@ -10302,6 +10430,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.MONTHLY # type: ignore +class NamespaceToolParam(Tool, discriminator="namespace"): + """Namespace. + + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: str or ~azure.ai.projects.models.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[~azure.ai.projects.models.FunctionToolParam or + ~azure.ai.projects.models.CustomToolParam] + """ + + type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the namespace shown to the model. Required.""" + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The function/custom tools available inside this namespace. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + ) -> 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) + self.type = ToolType.NAMESPACE # type: ignore + + class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): """Credentials that do not require authentication. @@ -13177,14 +13351,15 @@ class ToolChoiceParam(_Model): ``tools`` parameter to see how to specify which tools the model can call. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, - ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, ToolChoiceFunction, - ToolChoiceImageGeneration, ToolChoiceMCP, SpecificFunctionShellParam, + ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, + ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, ToolChoiceWebSearchPreview20250311 :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", "apply_patch", "shell", "file_search", "web_search_preview", "computer_use_preview", - "web_search_preview_2025_03_11", "image_generation", and "code_interpreter". + "web_search_preview_2025_03_11", "image_generation", "code_interpreter", "computer", and + "computer_use". :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType """ @@ -13192,7 +13367,8 @@ class ToolChoiceParam(_Model): type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", \"apply_patch\", \"shell\", \"file_search\", \"web_search_preview\", \"computer_use_preview\", - \"web_search_preview_2025_03_11\", \"image_generation\", and \"code_interpreter\".""" + \"web_search_preview_2025_03_11\", \"image_generation\", \"code_interpreter\", \"computer\", + and \"computer_use\".""" @overload def __init__( @@ -14094,6 +14270,62 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore +class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): + """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: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolChoiceParamType.COMPUTER # type: ignore + + +class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): + """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: str or ~azure.ai.projects.models.COMPUTER_USE + """ + + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore + + class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): """Indicates that the model should use a built-in tool to generate a response. `Learn more about built-in tools `_. @@ -14438,6 +14670,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ToolSearchToolParam(Tool, discriminator="tool_search"): + """Tool search tool. + + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + """ + + type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = 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) + self.type = ToolType.TOOL_SEARCH # type: ignore + + class ToolUseFineTuningDataGenerationJobOptions( DataGenerationJobOptions, discriminator="tool_use" ): # pylint: disable=name-too-long @@ -14959,6 +15238,8 @@ class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: "low", "medium", and "high". :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize + :ivar search_content_types: + :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] """ type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -14973,6 +15254,9 @@ class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): """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: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( @@ -14980,6 +15264,7 @@ def __init__( *, user_location: Optional["_models.ApproximateLocation"] = None, search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, ) -> None: ... @overload From b3ad5b89c69a171eb3fb1826a658965df0f8f111 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:37:11 -0700 Subject: [PATCH 05/40] Cleanup unused `# [START` tages --- sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py | 1 - sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py | 1 - 2 files changed, 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py index 3285c1afb474..1c5727c583b9 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py @@ -30,7 +30,6 @@ def test_red_teams(self, **kwargs): with self.create_client(**kwargs) as project_client: - # [START red_team_sample] print("Creating a Red Team scan for direct model testing") # Create target configuration for testing an Azure OpenAI model diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py index 3fda37b15180..17f494cb2f8e 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py @@ -30,7 +30,6 @@ async def test_red_teams_async(self, **kwargs): async with self.create_async_client(**kwargs) as project_client: - # [START red_team_sample] print("Creating a Red Team scan for direct model testing") # Create target configuration for testing an Azure OpenAI model From 2404e453545f8452c03a4e37fe48bc181d48d09c Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:50:21 -0700 Subject: [PATCH 06/40] First --- .../azure-ai-projects/.github/skills/README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-projects/.github/skills/README.md b/sdk/ai/azure-ai-projects/.github/skills/README.md index 7ea120484d10..5fa39f44900e 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/README.md +++ b/sdk/ai/azure-ai-projects/.github/skills/README.md @@ -7,7 +7,7 @@ git clone https://github.com/Azure/azure-sdk-for-python.git ``` * Change to the directory `sdk\ai\azure-ai-projects`. -* Switch to the current feature branch: `git switch feature/azure-ai-projects/2.2.0`. +* Switch to the current feature branch, for example: `git switch feature/azure-ai-projects/2.3.0`. * Make sure you don't have any files edited or added in this branch (clean `git status` state). ## Emit from TypeSpec and create a PR @@ -17,16 +17,26 @@ * Open VSCode in the current folder. * Open the CoPilot chat window ("Toggle Chat"). * Make sure you are in "Agent" mode. -* Start typing `/azure-ai-projects` and press tab to auto complete it to `/azure-ai-projects-emit-from-typespec`, then press Enter. +* Start typing `/` followed by the skill name, like `/azure-ai-projects` and press tab to auto complete it to the designed skill, like `/azure-ai-projects-emit-from-typespec`, then press Enter. * Answer some questions and approve execution to go through the workflow ### Using CoPilot CLI or Agency Copilot CLI * Install [GitHub CoPilot CLI](https://docs.github.com/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) or [Agency CoPilot CLI](https://aka.ms/agency) (VPN required) if you don't already have it. * Run CoPilot CLI by typing `copilot` -* Start typing `/azure-ai-projects` and press tab to auto complete it to `/azure-ai-projects-emit-from-typespec`, then press Enter. +* Start typing `/` followed by the skill name, like `/azure-ai-projects` and press tab to auto complete it to the desired skill, like `/azure-ai-projects-emit-from-typespec`, then press Enter. * Answer some questions and approve execution to go through the workflow +## Skills + +### azure-ai-projects-emit-from-typespec + +This skill creates a new topic branch, emits SDK from TypeSpec, runs some post-processing and creates a PR. + +### azure-ai-projects-update-changelog + +This skill updates the file CHANGELOG.md, comparing the source in the current branch which the source of the latest public release. It does not create a new topic branch or a PR. + From 1ac28504dd322daa9471d4fd6530f7b3dc08bc7e Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:36:27 -0700 Subject: [PATCH 07/40] Separate skill for updating CHANGELOG.md file (#47327) --- .../SKILL.md | 342 ++++++++++++++++++ sdk/ai/azure-ai-projects/CHANGELOG.md | 6 + 2 files changed, 348 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md new file mode 100644 index 000000000000..eeb810776294 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md @@ -0,0 +1,342 @@ +--- +name: azure-ai-projects-update-changelog +license: MIT +metadata: + version: "1.0.0" + distribution: local +description: "Update CHANGELOG.md by comparing public APIs between the current branch and the latest released version on PyPI. WHEN: \"update changelog\", \"generate changelog\", \"add changelog entry\", \"what changed in this version\". DO NOT USE FOR: other Azure SDK packages. INVOKES: PyPI API, GitHub API (for tags), file operations." +compatibility: + requires: "local azure-sdk-for-python clone, git, internet access" +--- + +# Update azure-ai-projects Changelog + +This skill guides Copilot through updating the CHANGELOG.md file for the azure-ai-projects package by comparing public APIs between the current branch and the latest released version. + +**Working directory:** `sdk/ai/azure-ai-projects` + +--- + +## Overview + +The skill performs these steps: +1. Read the current version from `azure/ai/projects/_version.py` +2. Fetch the latest released version from PyPI +3. Compare public classes, methods, and properties between current branch and released version +4. Update CHANGELOG.md with a new section or update the existing "(Unreleased)" section + +--- + +## Step 1: Read the current version + +Read the current version from `azure/ai/projects/_version.py`. The file contains a line like: +```python +VERSION = "X.Y.Z" +``` + +Extract this version number and save it as `CURRENT_VERSION`. + +--- + +## Step 2: Fetch the latest released version from PyPI + +Use the PyPI JSON API to get the latest released version: + +``` +https://pypi.org/pypi/azure-ai-projects/json +``` + +From the JSON response: +- Extract `info.version` as `LATEST_PYPI_VERSION` +- This is the version we will compare against + +--- + +## Step 3: Determine if CHANGELOG needs updating + +Check if CHANGELOG.md already has a section for the current version: +- If there's a section `## {CURRENT_VERSION} (Unreleased)` — we will update it +- If there's a section `## {CURRENT_VERSION} (YYYY-MM-DD)` with an actual date — the version is already released, report this to the user and stop +- If there's no section for `CURRENT_VERSION` — we will create a new one + +--- + +## Step 4: Construct the GitHub tag for the released version + +The tag name for a released version follows this pattern: +``` +azure-ai-projects_{VERSION} +``` + +For example, for version `2.2.0`, the tag is `azure-ai-projects_2.2.0`. + +The source code for that release can be found at: +``` +https://github.com/Azure/azure-sdk-for-python/tree/azure-ai-projects_{VERSION}/sdk/ai/azure-ai-projects +``` + +--- + +## Step 5: Compare public APIs + +Compare the public APIs between the current branch and the latest released version. Focus on these locations: + +### 5a. Public classes and enums in `azure/ai/projects/models/__init__.py` + +Compare the `__all__` list and imports in both versions to identify: +- **New classes/enums**: Present in current branch but not in released version +- **Removed classes/enums**: Present in released version but not in current branch +- **Renamed classes/enums**: Check if a removed class has a similar new class (likely a rename) + +### 5b. Public operations in `azure/ai/projects/operations/__init__.py` + +Compare the `__all__` list to identify new or removed operation classes. + +### 5c. Public methods on sub-clients + +For each operations class (like `AgentsOperations`, `BetaOperations`, etc.), compare the public methods: +- Look at files under `azure/ai/projects/operations/` and `azure/ai/projects/aio/operations/` +- Also check `_patch.py` files which may define additional public methods +- Public methods are those that don't start with underscore `_` + +### 5d. Properties on model classes + +For significant model classes, compare public properties (attributes) between versions: +- Properties are defined in `azure/ai/projects/models/_models.py` +- Look for new, removed, or renamed properties +- Pay attention to required vs optional changes + +### 5e. Beta sub-clients on `BetaOperations` + +The `BetaOperations` class exposes beta/preview functionality. Check for: +- New sub-client properties (like `.beta.datasets`, `.beta.models`, `.beta.routines`, etc.) +- Removed sub-client properties +- Check both `azure/ai/projects/operations/_patch.py` and the released version + +### 5f. Sample files in `samples/` folder + +Compare sample files between the current branch and the released version: + +1. **List all `.py` files** recursively under `samples/` in both versions +2. **Identify new samples**: Files present in current branch but not in released version +3. **Identify removed samples**: Files present in released version but not in current branch +4. **Ignore async variants**: If a sample has both sync and async versions (e.g., `sample_foo.py` and `sample_foo_async.py`), only report the sync version +5. **Check existing changelog entries**: If a sample is already mentioned in the current changelog section, leave it as is +6. **Remove stale entries**: If a sample mentioned in the changelog has been removed from the codebase, remove it from the changelog + +For each new sample, provide a one-line description of what it demonstrates. Read the sample file to understand its purpose — typically the docstring at the top or the `if __name__ == "__main__"` block explains what it does. + +--- + +## Step 6: Categorize the changes + +Organize detected changes into these categories: + +### Features Added +- New sub-clients (e.g., "New `.beta.routines` sub-client with routine operations: `create_or_update`, `get`, `enable`, ...") +- New methods on existing sub-clients (e.g., "New methods on `.beta.agents` for optimization jobs: `create_optimization_job`, `get_optimization_job`, ...") +- New model classes that represent significant features (e.g., "Support integration of external Agents. See new `ExternalAgentDefinition` class.") +- New properties on existing classes (e.g., "New optional `force` parameter on `agents.delete` method.") +- New tools (e.g., "New Agent tool in preview `FabricIQPreviewTool`.") + +### Breaking Changes +List breaking changes in beta methods and classes separately: +- Renamed methods (e.g., "Method `.beta.agents.get_session_files` renamed to `.beta.agents.list_session_files`.") +- Renamed arguments (e.g., "Argument `body` in method `.beta.skills.create_from_files()` renamed to `content`.") +- Signature changes (e.g., "Method `.beta.skills.create` signature changed — now takes `name` and keyword `inline_content: SkillInlineContent`; returns `SkillVersion`.") +- Renamed classes (e.g., "Renamed class `AgentEndpoint` to `AgentEndpointConfig`.") +- Property changes (e.g., "Required property `isolation_key_source` removed from class `EntraAuthorizationScheme`.") +- Renamed properties (e.g., "Property `skill_id` renamed to `id` on class `SkillDetails`.") + +**Format for beta changes:** +```markdown +Breaking changes in beta methods: +* ... + +Breaking changes in beta classes: +* ... +``` + +### Bugs Fixed +This section typically contains bug fixes. Leave empty unless you have specific bug fix information to add. + +### Sample updates +List new sample files that were added, with a one-line description of what they demonstrate: +- Compare sample files in the `samples/` folder between current branch and released version +- Only report the sync version — do not list async samples separately (files ending with `_async.py`) +- If a sample is already mentioned in the existing changelog section, preserve that entry +- If a sample mentioned in the changelog has been removed from the codebase, remove it from the changelog +- Group related samples together (e.g., all agent samples, all evaluation samples) +- Use format: `Added \`sample_name.py\` demonstrating [brief description].` + +--- + +## Step 7: Format the changelog entry + +Use this format for the changelog entry: + +```markdown +## {CURRENT_VERSION} (Unreleased) + +### Features Added + +* [List each feature on its own bullet point] + +### Breaking Changes + +Breaking changes in beta methods: +* [List method changes] + +Breaking changes in beta classes: +* [List class changes] + +### Bugs Fixed + +* [List bug fixes, if any] + +### Sample updates + +* [List sample updates, if any] +``` + +**Guidelines for writing entries:** +- For new methods: mention the sub-client and method name, briefly describe what it does. Only report the sync version — do not list both sync and async versions separately. +- For new sub-clients: list all the methods it provides (sync versions only) +- For new tools: just mention the class name +- For property changes: mention the class name and the affected property +- For renames: show "X renamed to Y" format +- Use backticks for code references: `.beta.agents`, `create_version()`, `AgentDetails` + +--- + +## Step 8: Update CHANGELOG.md + +Insert or update the changelog entry in `CHANGELOG.md`: + +1. If updating an existing "(Unreleased)" section: + - Replace the existing section content with the new content + - Preserve any manually-added entries that aren't API-related (like "Sample updates" written by developers) + +2. If creating a new section: + - Insert the new section immediately after the `# Release History` header + - Keep all previous version sections intact + +--- + +## Step 9: Report to user + +After updating the changelog, report: +1. The current version and latest PyPI version compared +2. Summary of changes detected: + - Number of new classes/enums + - Number of new methods + - Number of breaking changes + - Number of removed items +3. Remind the user to: + - Review the generated changelog for accuracy + - Add any bug fixes that were made + - Review sample descriptions for accuracy + - Verify method descriptions are accurate + +--- + +## Tips for API Comparison + +### Using git to compare files + +You can compare files between the current branch and a tag: +```bash +git diff azure-ai-projects_{VERSION} -- azure/ai/projects/models/__init__.py +``` + +### Using GitHub raw URLs + +To fetch files from the released version: +``` +https://raw.githubusercontent.com/Azure/azure-sdk-for-python/azure-ai-projects_{VERSION}/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +``` + +### Identifying renames vs additions/removals + +If a class was removed and a similar class was added, it's likely a rename. Look for: +- Similar names (e.g., `SkillObject` → `SkillDetails`) +- Similar structure/properties +- Check if there's a corresponding note in the TypeSpec changes + +--- + +## Example Output + +Here's an example of a well-formatted changelog entry: + +```markdown +## 2.3.0 (Unreleased) + +### Features Added + +* Support integration of external Agents (in preview). See new `ExternalAgentDefinition` class. +* New Agent tool in preview `FabricIQPreviewTool`. +* New Agent tool in preview `ToolboxSearchPreviewTool`. +* New methods on `.beta.agents` for + * Code-based hosted agents: `create_version_from_code`, `download_code`. + * Optimization jobs: `create_optimization_job`, `get_optimization_job`, `list_optimization_jobs`, `cancel_optimization_job`, `list_optimization_candidates`. + * Optimization candidate management: `list_optimization_candidates`, `get_optimization_candidate`, `get_optimization_candidate_config`, `get_optimization_candidate_results`, `get_candidate_file`, `promote_candidate`. + * `stop_session` to stop a running agent session. +* New `.beta.datasets` sub-client with data generation job operations: `create_generation_job`, `get_generation_job`, `list_generation_jobs`, `cancel_generation_job`, `delete_generation_job`. +* New `.beta.models` sub-client to handle AI model weights: `create`, `list_versions`, `list`, `get`, `delete`, `update`, `pending_create_version`, `pending_upload`, `get_credentials`. +* New `.beta.routines` sub-client with routine operations: `create_or_update`, `get`, `enable`, `disable`, `list`, `delete`, `list_runs`, `dispatch`. +* New methods on `.beta.evaluators` for evaluator generation jobs: `create_generation_job`, `get_generation_job`, `list_generation_jobs`, `cancel_generation_job`, `delete_generation_job`. +* New methods on `.beta.memory_stores` to handle individual memory items: `create_memory`, `update_memory`, `list_memories`, `get_memory`, `delete_memory`. +* New methods on `.beta.skills` for versioned skill management: `create`, `list_versions`, `get_version`, `download_version`, `delete_version`. +* New optional string properties `description` and `name` added to Agent tools classes which did not have them before. +* New optional `tool_configs` added to Agent tool classes. +* New read-only property `content_hash` on `CodeConfiguration`, returning the SHA-256 hex digest of the uploaded code zip. +* New optional `force` parameter on `agents.delete` and `agents.delete_version` methods. +* New optional `blueprint_reference` parameters on `agents.create_version` method. + + +### Breaking Changes + +Breaking changes in beta methods: +* Argument `isolation_key` in methods `.beta.agents.create_session()` and `.beta.agents.delete_session()` renamed to `user_isolation_key`. +* Argument `body` in methods `.beta.evaluation_taxonomies.create()` and `.beta.evaluation_taxonomies.update()` renamed to `taxonomy`. +* Argument `body` in method `.beta.skills.create_from_files()` renamed to `content`. +* Method `.beta.agents.get_session_files` renamed to `.beta.agents.list_session_files`. +* Method `.beta.skills.create` signature changed — now takes `name` and keyword `inline_content: SkillInlineContent`; returns `SkillVersion`. +* Method `.beta.skills.create_from_package` renamed to `.beta.skills.create_from_files`. +* Method `.beta.skills.create_from_files` signature changed — now takes `name` and `content: CreateSkillVersionFromFilesBody`; returns `SkillVersion`. +* Method `.beta.skills.update` signature changed — now only accepts keyword `default_version`; returns `SkillDetails`. + +Breaking changes in beta classes: +* Required property `isolation_key_source` removed from class `EntraAuthorizationScheme`. +* Renamed class `AgentEndpoint` to `AgentEndpointConfig`. +* Renamed class `DeleteSkillResponse` to `DeleteSkillResult`. +* Renamed class `SessionDirectoryListResponse` to `SessionDirectoryListResult`. +* Renamed class `SessionFileWriteResponse` to `SessionFileWriteResult`. +* Renamed class `SkillObject` to `SkillDetails`. Property `skill_id` renamed to `id`. Properties `has_blob` and `metadata` were removed. +* Renamed class `Target` to `EvaluationTarget`. +* Renamed class `TargetConfig` to `RedTeamTargetConfig`. + +### Bugs Fixed + +* Fixed telemetry instrumentor to correctly call is_recording() as a method on spans, ensuring non-recording spans are properly skipped (e.g., when sampling is configured) ([GitHub issue 46544](https://github.com/Azure/azure-sdk-for-python/issues/46544)). + +### Sample updates + +* Added new Agent tool samples `sample_agent_work_iq.py` and `sample_agent_work_iq_async.py` demonstrating use of `WorkIQPreviewTool`. +* Added new Agent tool samples `sample_agent_fabric_iq.py` and `sample_agent_fabric_iq_async.py` demonstrating use of `FabricIQPreviewTool`. +* Hosted Agents: + * Added Hosted Agent creation samples `sample_create_hosted_agent.py` and `sample_create_hosted_agent_async.py`, demonstrating hosted agent version creation and retrieval with `AIProjectClient`. + * Added Hosted Agent code-upload samples `sample_create_hosted_agent_from_code.py` and `sample_create_hosted_agent_from_code_async.py`, demonstrating uploading a code package (zip) as a new hosted agent version. + * The Hosted Agent creation sample also demonstrates assigning the hosted agent managed identity the Azure AI User RBAC role on the backing Azure AI account. + * Updated the other Hosted Agent samples to reuse an existing Hosted Agent as a prerequisite, instead of creating a new hosted agent version in each sample. +* Added Toolbox tool-search sample `sample_toolboxes_with_search_preview.py` and `sample_toolboxes_with_search_preview_async.py`, demonstrating creating a Toolbox version with `ToolboxSearchPreviewTool` and invoking `MCPTool`. +* Added `.beta.models` samples under `samples/models/`: + * `sample_models_basic.py` — synchronous end-to-end registration via the `create` helper (uses `azcopy`), followed by `get`, `list_versions`, `list`, `get_credentials`, `update`, and `delete`. + * `sample_models_create_and_poll.py` — alternative synchronous registration that hand-rolls the spec's three-step flow (`pending_upload` → upload via `azure-storage-blob` → `pending_create_version` + poll), without taking a dependency on `azcopy`. + * `sample_models_basic_async.py` — asynchronous version of the same three-step flow using `azure.ai.projects.aio.AIProjectClient` and `azure.storage.blob.aio.ContainerClient`. +* Added new evaluation sample `sample_model_evaluation_instant_model.py` demonstrating model evaluation with an instant model. +* Refreshed evaluation samples under `samples/evaluations/` and `samples/evaluations/agentic_evaluators/` (including `sample_agent_evaluation`, `sample_agent_response_evaluation`, `sample_eval_catalog_prompt_based_evaluators`, `sample_evaluations_ai_assisted`, `sample_evaluations_builtin_with_csv`, `sample_evaluations_builtin_with_dataset_id`, `sample_evaluations_builtin_with_inline_data`, `sample_evaluations_builtin_with_inline_data_oai`, `sample_scheduled_evaluations`, `sample_coherence`, `sample_fluency`, `sample_intent_resolution`, `sample_relevance`, `sample_response_completeness`, `sample_tool_call_accuracy`, `sample_tool_call_success`, `sample_tool_input_accuracy`, `sample_tool_output_utilization`, `sample_tool_selection`, and `sample_generic_agentic_evaluator`). +* New sample `sample_dataset_generation_job_simpleqna_with_prompt_source.py` showing an end-to-end flow that generates a QnA dataset via `.beta.datasets.create_generation_job` and runs an OpenAI evaluation. + +``` diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index a805c9f54a7f..132628ac7fb7 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -2,11 +2,17 @@ ## 2.3.0 (Unreleased) +### Breaking Changes + +Breaking changes in beta methods: +* Method `.beta.agents.list_optimization_candidates` now returns `ItemPaged[OptimizationCandidate]` instead of `AgentsPagedResultOptimizationCandidate`. The `after` parameter has been removed (use continuation-token-based paging instead). + ### Sample updates * Added `sample_routines_crud.py` to demonstrate CRUD operations. * Added `sample_routines_with_timer_trigger.py` to demonstrate triggering a routine with a timer. * Added `sample_routines_with_schedule_trigger.py` to demonstrate triggering a routine on a recurring cron schedule via `ScheduleRoutineTrigger`. +* Added `sample_skill_in_toolbox.py` demonstrating how to expose a Skill to a Prompt Agent via a Toolbox using `MCPTool`. * Updated `sample_dataset_generation_job_traces_for_evaluation.py` and `sample_dataset_generation_job_traces_for_finetuning.py` to create a temporary agent, seed conversations, retry the data generation job over the trace window, and clean up all created resources. * Updated `sample_memory_crud.py` and `sample_memory_crud_async.py` to demonstrate memory item CRUD (`create_memory`, `get_memory`, `update_memory`, `list_memories`, `delete_memory`) in addition to memory store CRUD. From c37ce7927b4a790d800282f0cfd6915edb832813 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 5 Jun 2026 09:27:07 -0700 Subject: [PATCH 08/40] Update Python tsp-location.yaml to match recent TypeSpec client.tsp file move (#47361) --- sdk/ai/azure-ai-projects/tsp-location.yaml | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index b9bf529d1e4c..fba1c89d1f07 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,29 @@ -directory: specification/ai-foundry/data-plane/Foundry -commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects +commit: 1a46f23eb6ff991b777135f70d7d0782fc0fb324 repo: Azure/azure-rest-api-specs additionalDirectories: + - specification/ai-foundry/data-plane/Foundry/src/agents + - specification/ai-foundry/data-plane/Foundry/src/agents-optimization + - specification/ai-foundry/data-plane/Foundry/src/agents-session-files + - specification/ai-foundry/data-plane/Foundry/src/common + - specification/ai-foundry/data-plane/Foundry/src/connections + - specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs + - specification/ai-foundry/data-plane/Foundry/src/datasets + - specification/ai-foundry/data-plane/Foundry/src/deployments + - specification/ai-foundry/data-plane/Foundry/src/evaluation-rules + - specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies + - specification/ai-foundry/data-plane/Foundry/src/evaluators + - specification/ai-foundry/data-plane/Foundry/src/indexes + - specification/ai-foundry/data-plane/Foundry/src/insights + - specification/ai-foundry/data-plane/Foundry/src/memory-stores + - specification/ai-foundry/data-plane/Foundry/src/models + - specification/ai-foundry/data-plane/Foundry/src/openai-conversations + - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations + - specification/ai-foundry/data-plane/Foundry/src/openai-responses + - specification/ai-foundry/data-plane/Foundry/src/red-teams + - specification/ai-foundry/data-plane/Foundry/src/routines + - specification/ai-foundry/data-plane/Foundry/src/schedules + - specification/ai-foundry/data-plane/Foundry/src/servicepatterns.tsp + - specification/ai-foundry/data-plane/Foundry/src/skills + - specification/ai-foundry/data-plane/Foundry/src/toolboxes + - specification/ai-foundry/data-plane/Foundry/src/tools \ No newline at end of file From 9ad3073e74ad6523da909346e806949f19b25c41 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:23:50 -0700 Subject: [PATCH 09/40] Update subclient doc --- sdk/ai/azure-ai-projects/docs/subclients.md | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sdk/ai/azure-ai-projects/docs/subclients.md b/sdk/ai/azure-ai-projects/docs/subclients.md index e6b40e3e6e1b..538c79bea5e4 100644 --- a/sdk/ai/azure-ai-projects/docs/subclients.md +++ b/sdk/ai/azure-ai-projects/docs/subclients.md @@ -4,7 +4,7 @@ This document lists all sub-clients available on `AIProjectClient` and their pub ## Summary -There are a total of 139 unique public methods across all sub-clients. +There are a total of 140 unique public methods across all sub-clients. ### Top-level Sub-clients (stable operations) @@ -28,7 +28,7 @@ There are a total of 139 unique public methods across all sub-clients. | `beta.evaluators` | BetaEvaluatorsOperations | 13 | | `beta.insights` | BetaInsightsOperations | 3 | | `beta.memory_stores` | BetaMemoryStoresOperations | 13 | -| `beta.models` | BetaModelsOperations | 8 | +| `beta.models` | BetaModelsOperations | 9 | | `beta.red_teams` | BetaRedTeamsOperations | 3 | | `beta.routines` | BetaRoutinesOperations | 8 | | `beta.schedules` | BetaSchedulesOperations | 6 | @@ -38,7 +38,7 @@ There are a total of 139 unique public methods across all sub-clients. ## Method list table -Alphabetically sorted, with ".beta" sub-client at the end. +Alphabetically sorted, with ".beta" sub-client at the end. If the method is a new hand-written method, there will be an asterisk at the end. ``` .agents.create_version @@ -50,8 +50,8 @@ Alphabetically sorted, with ".beta" sub-client at the end. .agents.list .agents.list_versions -.connections.get -.connections.get_default +.connections.get* +.connections.get_default* .connections.list .datasets.create_or_update @@ -61,8 +61,8 @@ Alphabetically sorted, with ".beta" sub-client at the end. .datasets.list .datasets.list_versions .datasets.pending_upload -.datasets.upload_file -.datasets.upload_folder +.datasets.upload_file* +.datasets.upload_folder* .deployments.get .deployments.list @@ -78,7 +78,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .indexes.list .indexes.list_versions -.telemetry.get_application_insights_connection_string +.telemetry.get_application_insights_connection_string* .beta.agents.cancel_optimization_job .beta.agents.create_optimization_job @@ -103,7 +103,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.agents.patch_agent_details .beta.agents.promote_candidate .beta.agents.stop_session -.beta.agents.upload_session_file +.beta.agents.upload_session_file* .beta.datasets.cancel_generation_job .beta.datasets.create_generation_job @@ -135,7 +135,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.insights.get .beta.insights.list -.beta.memory_stores.begin_update_memories +.beta.memory_stores.begin_update_memories* .beta.memory_stores.create .beta.memory_stores.create_memory .beta.memory_stores.delete @@ -145,10 +145,11 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.memory_stores.get_memory .beta.memory_stores.list .beta.memory_stores.list_memories -.beta.memory_stores.search_memories +.beta.memory_stores.search_memories* .beta.memory_stores.update .beta.memory_stores.update_memory +.beta.models.create* .beta.models.pending_create_version .beta.models.delete .beta.models.get From 7503c2fba1897f3184688d90a87a157e42ac81ea Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 11:03:02 -0700 Subject: [PATCH 10/40] Add sample for dispatching routines with manual triggers (#47404) --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + .../sample_routines_with_dispatch.py | 130 ++++++++++++++++++ .../tests/samples/test_samples.py | 1 + 3 files changed, 132 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 132628ac7fb7..8de1c840dea5 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -12,6 +12,7 @@ Breaking changes in beta methods: * Added `sample_routines_crud.py` to demonstrate CRUD operations. * Added `sample_routines_with_timer_trigger.py` to demonstrate triggering a routine with a timer. * Added `sample_routines_with_schedule_trigger.py` to demonstrate triggering a routine on a recurring cron schedule via `ScheduleRoutineTrigger`. +* Added `sample_routines_with_dispatch.py` to demonstrate manually firing a routine on demand via `routines.dispatch(...)` using a `CustomRoutineTrigger`. * Added `sample_skill_in_toolbox.py` demonstrating how to expose a Skill to a Prompt Agent via a Toolbox using `MCPTool`. * Updated `sample_dataset_generation_job_traces_for_evaluation.py` and `sample_dataset_generation_job_traces_for_finetuning.py` to create a temporary agent, seed conversations, retry the data generation job over the trace window, and clean up all created resources. * Updated `sample_memory_crud.py` and `sample_memory_crud_async.py` to demonstrate memory item CRUD (`create_memory`, `get_memory`, `update_memory`, `list_memories`, `delete_memory`) in addition to memory store CRUD. diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py new file mode 100644 index 000000000000..4b7db7a01602 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py @@ -0,0 +1,130 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to create a Routine with a manual (custom) + trigger and fire it on demand via `dispatch(...)`, then record the + resulting run by polling `list_runs(...)` using the synchronous + AIProjectClient. + + The routine is bound to an existing hosted agent. Because the trigger is + a `CustomRoutineTrigger`, the routine never fires on its own; the sample + explicitly invokes it with `project_client.beta.routines.dispatch(...)` + passing an `InvokeAgentResponsesApiDispatchPayload` carrying the input + sent to the agent. The sample then polls the run history until a + terminal phase is reached (or a deadline elapses), printing each + observed transition. The routine is deleted at the end of the sample. + + Routines are currently a preview feature. In the Python SDK, you access + these operations via `project_client.beta.routines`. + +USAGE: + python sample_routines_with_dispatch.py + + Before running the sample: + + pip install "azure-ai-projects>=2.2.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) FOUNDRY_HOSTED_AGENT_NAME - The name of an existing Hosted Agent to invoke + when the routine is dispatched. +""" + +import json +import os +import time + +from dotenv import load_dotenv + +from azure.core.exceptions import ResourceNotFoundError +from azure.identity import DefaultAzureCredential + +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + CustomRoutineTrigger, + InvokeAgentResponsesApiDispatchPayload, + InvokeAgentResponsesApiRoutineAction, + RoutineRun, + RoutineRunPhase, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +agent_name = os.environ["FOUNDRY_HOSTED_AGENT_NAME"] + + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, +): + + routine_name = "sample-routine-dispatch" + + try: + project_client.beta.routines.delete(routine_name) + print(f"Routine `{routine_name}` deleted") + except ResourceNotFoundError: + pass + + created = project_client.beta.routines.create_or_update( + routine_name, + description="Routine used by the dispatch sample.", + enabled=True, + triggers={ + "manual": CustomRoutineTrigger( + provider="sample-provider", + event_name="sample-event", + parameters={}, + ), + }, + action=InvokeAgentResponsesApiRoutineAction(agent_name=agent_name), + ) + print(f"Created routine: {created.name} enabled={created.enabled}") + + dispatch_result = project_client.beta.routines.dispatch( + routine_name, + payload=InvokeAgentResponsesApiDispatchPayload( + input="Say hello from a manually dispatched routine.", + ), + ) + print(f"Dispatched routine: dispatch_id={dispatch_result.dispatch_id} task_id={dispatch_result.task_id}") + + seen_phases: dict[str, RoutineRunPhase] = {} + final_run: RoutineRun | None = None + + deadline = time.monotonic() + 180 + while time.monotonic() < deadline: + runs = list(project_client.beta.routines.list_runs(routine_name, limit=20, order="desc")) + for run in runs: + if seen_phases.get(run.id) == run.phase: + continue + seen_phases[run.id] = run.phase # type: ignore[assignment] + print( + f" - run_id={run.id} phase={run.phase} status={run.status} " + f"trigger_type={run.trigger_type} triggered_at={run.triggered_at} ended_at={run.ended_at}" + ) + if str(run.status).lower() == "finished": + final_run = run + + if final_run is not None: + break + time.sleep(5) + + if final_run: + print("Final run:") + print(json.dumps(final_run.as_dict(), indent=2, default=str)) + # Note: retrieving the response body produced by a routine-dispatched + # run via `openai_client.responses.retrieve(final_run.response_id)` is + # not yet supported by the service for this scenario. + else: + print("Dispatch did not produce a terminal run within the deadline.") + + project_client.beta.routines.delete(routine_name) + print("Routine deleted") diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index c3fa6905f7df..8e92f51580c4 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -257,6 +257,7 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: "sample_routines_with_schedule_trigger.py", # Specify through AdditionalSampleTestDetail "sample_routines_crud.py", # Skipped due to service serialization issues "sample_routines_with_timer_trigger.py", # Skipped due to service serialization issues + "sample_routines_with_dispatch.py", # 403: test identity lacks routines/dispatch data-action ], ), ) From 8c5e21f58fbfb79e738d6e16cd9d405974442c17 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 9 Jun 2026 13:49:42 -0700 Subject: [PATCH 11/40] restore packages --- eng/emitter-package-lock.json | 84 +++++++++++++++++++++++++++-------- eng/emitter-package.json | 7 +-- 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index e682063f596c..1787807b517f 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -6,19 +6,20 @@ "": { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.62.1" + "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.19.0", + "@azure-tools/openai-typespec": "1.20.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.0", + "@azure-tools/typespec-client-generator-core": "~0.68.4", "@azure-tools/typespec-liftr-base": "0.14.0", "@typespec/compiler": "^1.12.0", "@typespec/events": "~0.82.0", "@typespec/http": "^1.12.0", + "@typespec/http-client-python": "^0.31.0", "@typespec/openapi": "^1.12.0", "@typespec/openapi3": "1.12.0", "@typespec/rest": "~0.82.0", @@ -29,9 +30,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", - "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", + "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", "dev": true, "license": "MIT", "peerDependencies": { @@ -147,13 +148,13 @@ "dev": true }, "node_modules/@azure-tools/typespec-python": { - "version": "0.62.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.62.1.tgz", - "integrity": "sha512-U2w7mtTHpqwnqWuZK8TEBWM/9M8xwiZtSlARq7q+XMGddeQQulx54f32PYCaUzEP0yNT4VM/sBSVateI+TXIJg==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.63.0.tgz", + "integrity": "sha512-8CSHcHhI1egOE9BabVD3P8pjkYEt38vF85bA//ZEMOwgTVn0OCpOeuJN/uCy3uEYNSQUSOVKin35H2m04xupJQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@typespec/http-client-python": "^0.29.1", + "@typespec/http-client-python": "^0.30.0", "semver": "^7.7.4", "tsx": "^4.21.0" }, @@ -165,7 +166,7 @@ "@azure-tools/typespec-azure-core": "^0.68.0", "@azure-tools/typespec-azure-resource-manager": "^0.68.0", "@azure-tools/typespec-azure-rulesets": "^0.68.0", - "@azure-tools/typespec-client-generator-core": "^0.68.0", + "@azure-tools/typespec-client-generator-core": "^0.68.2", "@typespec/compiler": "^1.12.0", "@typespec/events": "^0.82.0", "@typespec/http": "^1.12.0", @@ -177,6 +178,51 @@ "@typespec/xml": "^0.82.0" } }, + "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.30.1.tgz", + "integrity": "sha512-fo78R2GhPjUntPwZGDHxZ/ddRQZgLRSCzO3F+u8hPrHPzmBXA0rMkeS2WKCWYmT/wcFDPAojjH9pMUl27dLQ0w==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "js-yaml": "~4.1.0", + "marked": "^15.0.6", + "pyodide": "0.26.2", + "semver": "~7.6.2", + "tsx": "^4.21.0" + }, + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-autorest": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.68.2 <1.0.0", + "@typespec/compiler": "^1.12.0", + "@typespec/events": ">=0.82.0 <1.0.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": ">=0.82.0 <1.0.0", + "@typespec/sse": ">=0.82.0 <1.0.0", + "@typespec/streams": ">=0.82.0 <1.0.0", + "@typespec/versioning": ">=0.82.0 <1.0.0", + "@typespec/xml": ">=0.82.0 <1.0.0" + } + }, + "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@babel/code-frame": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", @@ -1146,9 +1192,10 @@ } }, "node_modules/@typespec/http-client-python": { - "version": "0.29.2", - "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.29.2.tgz", - "integrity": "sha512-/rguS8z1Sjj0KJVQNuSF70Hvtq1kxDWlfJ7YFySBlfKAf364L0QkZK5J+GMPiw51k/scuxkhgGMelmB2rKmDRQ==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.31.0.tgz", + "integrity": "sha512-cG7ky7WMRfEeSp6YadVwHwgFSFLNFN82LTQziu6doNxQ0UipAIaobIELfVT5D/PDIz/Pa3w9mNG9CWF08uO7qA==", + "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1166,7 +1213,7 @@ "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.68.4 <1.0.0", "@typespec/compiler": "^1.12.0", "@typespec/events": ">=0.82.0 <1.0.0", "@typespec/http": "^1.12.0", @@ -1182,6 +1229,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1795,9 +1843,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.1.tgz", - "integrity": "sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", + "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 5818b7083707..b4ee98d3d708 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.62.1" + "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { "@typespec/compiler": "^1.12.0", @@ -14,12 +14,13 @@ "@typespec/streams": "~0.82.0", "@typespec/xml": "~0.82.0", "@typespec/openapi3": "1.12.0", - "@azure-tools/openai-typespec": "1.19.0", + "@typespec/http-client-python": "^0.31.0", + "@azure-tools/openai-typespec": "1.20.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.0", + "@azure-tools/typespec-client-generator-core": "~0.68.4", "@azure-tools/typespec-liftr-base": "0.14.0" } } From 29a4ea9550f07c1b0430e9dddcc76b4c2db2868c Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 19:58:39 -0700 Subject: [PATCH 12/40] sample update routines (#47423) * sample update routines * Add test for routines samples and update sample skipping logic --- .../sample_routines_crud.py | 2 +- .../sample_routines_with_dispatch.py | 2 +- .../sample_routines_with_schedule_trigger.py | 2 +- .../sample_routines_with_timer_trigger.py | 2 +- .../tests/samples/test_samples.py | 40 ++++++++++++++----- 5 files changed, 34 insertions(+), 14 deletions(-) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_crud.py (97%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_dispatch.py (97%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_schedule_trigger.py (99%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_timer_trigger.py (98%) diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py similarity index 97% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py index f71a74b33b48..45aadc1f8b26 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py @@ -58,7 +58,7 @@ def print_routine_state(routine: Routine) -> None: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py similarity index 97% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py index 4b7db7a01602..1c5164cf00c8 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py @@ -62,7 +62,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine-dispatch" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py similarity index 99% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py index 7bd7c0780661..7f3b6404d644 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py @@ -62,7 +62,7 @@ def main() -> None: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine-schedule" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py similarity index 98% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py index 96ed2f533e81..1ef31fb4a108 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py @@ -74,7 +74,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): # Azure Monitor exporter: same spans also sent to the Application Insights # resource attached to the Foundry project, viewable in the "Tracing" tab diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index 8e92f51580c4..d27d0e8b5975 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -240,19 +240,41 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: "FOUNDRY_HOSTED_AGENT_REMOTE_BUILD": "true", }, ), - AdditionalSampleTestDetail( - test_id="sample_routines_with_schedule_trigger", - sample_filename="sample_routines_with_schedule_trigger.py", - env_vars={ - "POLL_INTERVAL_SECONDS": "300", - }, - ), ] ) @pytest.mark.parametrize( "sample_path", get_sample_paths( "hosted_agents", + samples_to_skip=[], + ), + ) + @SamplePathPasser() + @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + def test_hosted_agents_samples(self, sample_path: str, **kwargs) -> None: + if os.path.basename(sample_path).startswith("sample_create_hosted_agent") and not self.is_live: + pytest.skip("sample_create_hosted_agent.py is skipped in replay mode due to RBAC complications.") + env_vars = get_sample_env_vars(kwargs) + executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) + executor.execute() + executor.validate_print_calls_by_llm() + + @servicePreparer() + # @additionalSampleTests( + # [ + # AdditionalSampleTestDetail( + # test_id="sample_routines_with_schedule_trigger", + # sample_filename="sample_routines_with_schedule_trigger.py", + # env_vars={ + # "POLL_INTERVAL_SECONDS": "300", + # }, + # ), + # ] + # ) + @pytest.mark.parametrize( + "sample_path", + get_sample_paths( + "routines", samples_to_skip=[ "sample_routines_with_schedule_trigger.py", # Specify through AdditionalSampleTestDetail "sample_routines_crud.py", # Skipped due to service serialization issues @@ -263,9 +285,7 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: ) @SamplePathPasser() @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) - def test_hosted_agents_samples(self, sample_path: str, **kwargs) -> None: - if os.path.basename(sample_path).startswith("sample_create_hosted_agent") and not self.is_live: - pytest.skip("sample_create_hosted_agent.py is skipped in replay mode due to RBAC complications.") + def test_routines_samples(self, sample_path: str, **kwargs) -> None: env_vars = get_sample_env_vars(kwargs) executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) executor.execute() From 5757d1c726a36581a912761b61911acefe87d116 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 12 Jun 2026 15:57:46 -0700 Subject: [PATCH 13/40] Emit from latest TypeSpec, including new Agent Optimization methods (#47482) --- .../azure-ai-projects/apiview-properties.json | 24 +- sdk/ai/azure-ai-projects/assets.json | 2 +- .../azure/ai/projects/_types.py | 1 + .../azure/ai/projects/_utils/utils.py | 50 +- .../ai/projects/aio/operations/_operations.py | 1547 +++++++-------- .../azure/ai/projects/models/__init__.py | 40 +- .../azure/ai/projects/models/_enums.py | 15 +- .../azure/ai/projects/models/_models.py | 946 ++++----- .../azure/ai/projects/models/_patch.py | 2 +- .../ai/projects/operations/_operations.py | 1720 +++++++---------- .../azure-ai-projects/post-emitter-fixes.cmd | 18 +- .../foundry_features_header_test_base.py | 4 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 13 files changed, 1851 insertions(+), 2520 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 2495388ba138..38cbceeeaadd 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -20,7 +20,6 @@ "azure.ai.projects.models.AgentEvaluatorGenerationJobSource": "Azure.AI.Projects.AgentEvaluatorGenerationJobSource", "azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials", "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", - "azure.ai.projects.models.AgentIdentifier": "Azure.AI.Projects.AgentIdentifier", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", @@ -62,10 +61,6 @@ "azure.ai.projects.models.BrowserAutomationPreviewTool": "Azure.AI.Projects.BrowserAutomationPreviewTool", "azure.ai.projects.models.BrowserAutomationToolConnectionParameters": "Azure.AI.Projects.BrowserAutomationToolConnectionParameters", "azure.ai.projects.models.BrowserAutomationToolParameters": "Azure.AI.Projects.BrowserAutomationToolParameters", - "azure.ai.projects.models.CandidateDeployConfig": "Azure.AI.Projects.CandidateDeployConfig", - "azure.ai.projects.models.CandidateFileInfo": "Azure.AI.Projects.CandidateFileInfo", - "azure.ai.projects.models.CandidateMetadata": "Azure.AI.Projects.CandidateMetadata", - "azure.ai.projects.models.CandidateResults": "Azure.AI.Projects.CandidateResults", "azure.ai.projects.models.CaptureStructuredOutputsTool": "Azure.AI.Projects.CaptureStructuredOutputsTool", "azure.ai.projects.models.ChartCoordinate": "Azure.AI.Projects.ChartCoordinate", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", @@ -118,8 +113,6 @@ "azure.ai.projects.models.DatasetCredential": "Azure.AI.Projects.AssetCredentialResponse", "azure.ai.projects.models.DatasetDataGenerationJobOutput": "Azure.AI.Projects.DatasetDataGenerationJobOutput", "azure.ai.projects.models.DatasetEvaluatorGenerationJobSource": "Azure.AI.Projects.DatasetEvaluatorGenerationJobSource", - "azure.ai.projects.models.DatasetInfo": "Azure.AI.Projects.DatasetInfo", - "azure.ai.projects.models.DatasetRef": "Azure.AI.Projects.DatasetRef", "azure.ai.projects.models.DatasetReference": "Azure.AI.Projects.DatasetReference", "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", @@ -243,21 +236,25 @@ "azure.ai.projects.models.OpenApiProjectConnectionAuthDetails": "Azure.AI.Projects.OpenApiProjectConnectionAuthDetails", "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", "azure.ai.projects.models.OpenApiTool": "Azure.AI.Projects.OpenApiTool", - "azure.ai.projects.models.OptimizationAgentDefinition": "Azure.AI.Projects.OptimizationAgentDefinition", + "azure.ai.projects.models.OptimizationAgentIdentifier": "Azure.AI.Projects.OptimizationAgentIdentifier", "azure.ai.projects.models.OptimizationCandidate": "Azure.AI.Projects.OptimizationCandidate", + "azure.ai.projects.models.OptimizationDatasetCriterion": "Azure.AI.Projects.OptimizationDatasetCriterion", + "azure.ai.projects.models.OptimizationDatasetInput": "Azure.AI.Projects.OptimizationDatasetInput", + "azure.ai.projects.models.OptimizationDatasetItem": "Azure.AI.Projects.OptimizationDatasetItem", + "azure.ai.projects.models.OptimizationEvaluatorRef": "Azure.AI.Projects.OptimizationEvaluatorRef", + "azure.ai.projects.models.OptimizationInlineDatasetInput": "Azure.AI.Projects.OptimizationInlineDatasetInput", "azure.ai.projects.models.OptimizationJob": "Azure.AI.Projects.OptimizationJob", "azure.ai.projects.models.OptimizationJobInputs": "Azure.AI.Projects.OptimizationJobInputs", + "azure.ai.projects.models.OptimizationJobListItem": "Azure.AI.Projects.OptimizationJobListItem", "azure.ai.projects.models.OptimizationJobProgress": "Azure.AI.Projects.OptimizationJobProgress", "azure.ai.projects.models.OptimizationJobResult": "Azure.AI.Projects.OptimizationJobResult", "azure.ai.projects.models.OptimizationOptions": "Azure.AI.Projects.OptimizationOptions", - "azure.ai.projects.models.OptimizationTaskResult": "Azure.AI.Projects.OptimizationTaskResult", + "azure.ai.projects.models.OptimizationReferenceDatasetInput": "Azure.AI.Projects.OptimizationReferenceDatasetInput", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", - "azure.ai.projects.models.PromoteCandidateRequest": "Azure.AI.Projects.PromoteCandidateRequest", - "azure.ai.projects.models.PromoteCandidateResponse": "Azure.AI.Projects.PromoteCandidateResponse", "azure.ai.projects.models.PromotionInfo": "Azure.AI.Projects.PromotionInfo", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", @@ -379,8 +376,9 @@ "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", - "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", + "azure.ai.projects.models.OptimizationDatasetInputType": "Azure.AI.Projects.OptimizationDatasetInputType", "azure.ai.projects.models.EvaluationLevel": "Azure.AI.Projects.EvaluationLevel", + "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", "azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory", "azure.ai.projects.models.EvaluatorType": "Azure.AI.Projects.EvaluatorType", @@ -483,5 +481,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "ca205130211f" + "CrossLanguageVersion": "9cf16cec0d0a" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index e52797a1c639..c546cf197dd0 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_059be0eaf8" + "Tag": "python/ai/azure-ai-projects_cc9f48b0e7" } diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py index 5e23b3911701..abad0c3afee4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py @@ -11,3 +11,4 @@ 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/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index dcc813297e02..c91d6470e2bf 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 @@ -31,25 +31,21 @@ def serialize_multipart_data_entry(data_entry: Any) -> Any: def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any: - """Ensure each multipart file entry carries a filename so that it is encoded - as a file part (with ``filename=``) rather than a plain form field. - - Servers commonly distinguish multipart file parts from form-data parts by - the presence of ``filename=`` in the part's ``Content-Disposition`` header. - When callers pass bare bytes / str / IO objects (e.g. - ``Path("x.zip").read_bytes()``), the underlying HTTP client emits the part - without a filename, which several Foundry endpoints reject with errors like - "At least one file must be uploaded". This helper synthesizes a filename - from the IO object's ``name`` attribute when available, otherwise falls - back to a stable default. - - :param field_name: The multipart form field name, used as a fallback filename. - :type field_name: str - :param entry: The file entry to normalize. May be a tuple, bytes, str, or IO object. + """Ensure a multipart file entry carries a filename for Content-Disposition. + + Servers distinguish file parts from plain form fields by the presence of + ``filename=`` in the ``Content-Disposition`` header. When callers pass + bare bytes/str/IO the HTTP client omits the filename and the server may + reject the upload. This helper wraps bare values into a (filename, content) + tuple, deriving the name from IO.name when available. + + :param str field_name: The multipart field name used as a filename fallback. + :param entry: The user-provided file entry (tuple, bytes, str, or IO). :type entry: any - :param index: Position of the entry within its field's list, used to disambiguate fallback filenames. - :type index: int - :return: A ``(filename, entry)`` tuple if ``entry`` was not already a tuple, otherwise ``entry`` unchanged. + :param int index: The positional index of the entry within the field, used + to disambiguate fallback filenames when multiple entries are provided. + :return: Either the original tuple entry, or a ``(filename, content)`` tuple + wrapping the bare value. :rtype: any """ if isinstance(entry, tuple): @@ -60,7 +56,14 @@ def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> filename = os.path.basename(name_attr) if not filename: filename = f"{field_name}_{index}" if index else field_name - return (filename, entry) + + # Return a 3-tuple with an explicit "application/octet-stream" content type. + # A 2-tuple (filename, content) would leave the part's Content-Type unset, and + # the sdk core library only defaults to "application/octet-stream" for bare + # (non-tuple) values - a tuple bypasses that default and falls back to the + # HTTP "text/plain" default instead. Setting it explicitly preserves the + # pre-existing behavior for bare bytes/IO across all transports. + return (filename, entry, "application/octet-stream") def prepare_multipart_form_data( @@ -68,11 +71,8 @@ def prepare_multipart_form_data( ) -> list[FileType]: files: list[FileType] = [] - # Append data fields first so they appear before file parts in the encoded - # multipart body. Some streaming server-side parsers (e.g. the Foundry - # hosted-agents `create_agent_version_from_code` endpoint) require small - # JSON metadata parts to precede large binary file parts; otherwise they - # report the metadata part as missing. + # Data fields first so streaming server-side parsers see metadata before + # binary file parts. for data_field in data_fields: data_entry = body.get(data_field) if data_entry: @@ -83,7 +83,7 @@ def prepare_multipart_form_data( if isinstance(multipart_entry, list): for idx, e in enumerate(multipart_entry): files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx))) - elif multipart_entry: + elif multipart_entry is not None: files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0))) return files 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 5104a3473fa8..e278f6761204 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 @@ -54,19 +54,13 @@ build_beta_agents_delete_session_request, build_beta_agents_download_code_request, build_beta_agents_download_session_file_request, - build_beta_agents_get_candidate_file_request, - build_beta_agents_get_optimization_candidate_config_request, - build_beta_agents_get_optimization_candidate_request, - build_beta_agents_get_optimization_candidate_results_request, build_beta_agents_get_optimization_job_request, build_beta_agents_get_session_log_stream_request, build_beta_agents_get_session_request, - build_beta_agents_list_optimization_candidates_request, build_beta_agents_list_optimization_jobs_request, build_beta_agents_list_session_files_request, build_beta_agents_list_sessions_request, build_beta_agents_patch_agent_details_request, - build_beta_agents_promote_candidate_request, build_beta_agents_stop_session_request, build_beta_agents_upload_session_file_request, build_beta_datasets_cancel_generation_job_request, @@ -235,7 +229,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Retrieves the agent. + """Get an agent. + + Retrieves an agent definition by its unique name. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -302,7 +298,9 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: async def delete( self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentResponse: - """Deletes an agent. For hosted agents, if any version has active sessions, the request is + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated sessions are cascade-deleted along with the agent and its versions. @@ -383,7 +381,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentDetails"]: - """Returns the list of all agents. + """List agents. + + Returns a paged collection of agent resources. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values are: "prompt", "hosted", "workflow", and "external". Default value is None. @@ -480,7 +480,9 @@ async def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -515,7 +517,9 @@ async def create_version( async def create_version( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -538,7 +542,9 @@ async def create_version( async def create_version( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -569,7 +575,9 @@ async def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -685,7 +693,9 @@ async def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -720,7 +730,9 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -743,7 +755,9 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -774,7 +788,9 @@ async def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -882,7 +898,9 @@ async def create_version_from_manifest( @distributed_trace_async async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Retrieves a specific version of an agent. + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -952,7 +970,9 @@ async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) async def delete_version( self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentVersionResponse: - """Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all sessions associated with this version are cascade-deleted. @@ -1037,7 +1057,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentVersionDetails"]: - """Returns the list of versions of an agent. + """List agent versions. + + Returns a paged collection of versions for the specified agent. :param agent_name: The name of the agent to retrieve versions for. Required. :type agent_name: str @@ -1143,6 +1165,8 @@ def __init__(self, *args, **kwargs) -> None: async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: """Get an evaluation rule. + Retrieves the specified evaluation rule and its configuration. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping @@ -1204,6 +1228,8 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: async def delete(self, id: str, **kwargs: Any) -> None: """Delete an evaluation rule. + Removes the specified evaluation rule from the project. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: None @@ -1254,6 +1280,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1272,6 +1300,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1290,6 +1320,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1308,6 +1340,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: @@ -1387,7 +1421,10 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. + """List evaluation rules. + + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. :keyword action_type: Filter by the type of evaluation rule. Known values are: "continuousEvaluation" and "humanEvaluationPreview". Default value is None. @@ -1503,7 +1540,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, without populating connection credentials. + """Get a connection. + + Retrieves the specified connection and its configuration details without including credential + values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -1569,7 +1609,9 @@ async def _get(self, name: str, **kwargs: Any) -> _models.Connection: @distributed_trace_async async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + """Get a connection with credentials. + + Retrieves the specified connection together with its credential values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -1641,13 +1683,16 @@ def list( default_connection: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Connection"]: - """List all connections in the project, without populating connection credentials. + """List connections. - :keyword connection_type: List connections of this specific type. Known values are: + Returns the connections available in the current project, optionally filtered by type or + default status. + + :keyword connection_type: Lists connections of this specific type. Known values are: "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List connections that are default connections. Default value is + :keyword default_connection: Lists connections that are default connections. Default value is None. :paramtype default_connection: bool :return: An iterator like instance of Connection @@ -1756,7 +1801,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List all versions of the given DatasetVersion. + """List versions. + + List all versions of the given DatasetVersion. :param name: The name of the resource. Required. :type name: str @@ -1847,7 +1894,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + """List latest versions. + + List the latest version of each DatasetVersion. :return: An iterator like instance of DatasetVersion :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] @@ -1935,7 +1984,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + """Get a version. + + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -2000,7 +2051,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + """Delete a version. + + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -2060,7 +2113,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2086,7 +2141,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2112,7 +2169,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2132,7 +2191,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2217,7 +2278,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2243,7 +2306,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2269,7 +2334,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2293,7 +2360,9 @@ async def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2371,7 +2440,9 @@ async def pending_upload( @distributed_trace_async async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + """Get dataset credentials. + + Gets the SAS credential to access the storage account associated with a Dataset version. :param name: The name of the resource. Required. :type name: str @@ -2453,7 +2524,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + """Get a deployment. + + Gets a deployed model. :param name: Name of the deployment. Required. :type name: str @@ -2526,7 +2599,10 @@ def list( deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Deployment"]: - """List all deployed models in the project. + """List deployments. + + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. :keyword model_publisher: Model publisher to filter models by. Default value is None. :paramtype model_publisher: str @@ -2643,7 +2719,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List all versions of the given Index. + """List versions. + + List all versions of the given Index. :param name: The name of the resource. Required. :type name: str @@ -2734,7 +2812,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List the latest version of each Index. + """List latest versions. + + List the latest version of each Index. :return: An iterator like instance of Index :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] @@ -2822,7 +2902,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get the specific version of the Index. The service returns 404 Not Found error if the Index + """Get a version. + + Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. :param name: The name of the resource. Required. @@ -2887,7 +2969,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the Index. The service returns 204 No Content if the Index was + """Delete a version. + + Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. :param name: The name of the resource. Required. @@ -2947,7 +3031,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2967,7 +3053,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2993,7 +3081,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -3013,7 +3103,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -3089,7 +3181,7 @@ async def create_or_update( return deserialized # type: ignore -class BetaAgentsOperations: # pylint: disable=too-many-public-methods +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -3116,7 +3208,9 @@ async def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3136,7 +3230,9 @@ async def patch_agent_details( async def patch_agent_details( self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3154,7 +3250,9 @@ async def patch_agent_details( async def patch_agent_details( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3178,7 +3276,9 @@ async def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3269,7 +3369,12 @@ async def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3292,7 +3397,12 @@ async def create_version_from_code( async def create_version_from_code( self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3320,7 +3430,12 @@ async def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3404,7 +3519,9 @@ async def create_version_from_code( async def download_code( self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Download the code zip for a code-based hosted agent. + """Download agent code. + + Downloads the code zip for a code-based hosted agent. Returns the previously-uploaded zip (``application/zip``). If ``agent_version`` is supplied, returns that version's code zip; otherwise @@ -3490,7 +3607,9 @@ async def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3522,7 +3641,9 @@ async def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3551,7 +3672,9 @@ async def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3581,7 +3704,9 @@ async def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3676,7 +3801,9 @@ async def create_session( async def get_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Retrieves a session by ID. + """Get a session. + + Retrieves the details of a hosted agent session by agent name and session identifier. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3750,7 +3877,9 @@ async def get_session( async def delete_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + """Delete a session. + + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist. :param agent_name: The name of the agent. Required. @@ -3810,7 +3939,10 @@ async def delete_session( @distributed_trace_async async def stop_session(self, agent_name: str, session_id: str, **kwargs: Any) -> None: - """Stops a session. Returns 204 No Content when the stop succeeds. + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3874,7 +4006,9 @@ def list_sessions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentSessionResource"]: - """Returns a list of sessions for the specified agent. + """List sessions for an agent. + + Returns a paged collection of sessions associated with the specified agent endpoint. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3966,7 +4100,9 @@ async def get_next(_continuation_token=None): async def get_session_log_stream( self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any ) -> _models.SessionLogEvent: - """Streams console logs (stdout / stderr) for a specific hosted agent session + """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: @@ -4074,8 +4210,10 @@ async def _upload_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.SessionFileWriteResult: - """Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads - exceeding this limit return 413 Payload Too Large. + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4166,7 +4304,10 @@ async def download_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Download a file from the session sandbox as a binary stream. + """Download a session file. + + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4250,9 +4391,11 @@ def list_session_files( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SessionDirectoryEntry"]: - """List files and directories at a given path in the session sandbox. Returns only the immediate - children of the specified directory (non-recursive). If path is not provided, lists the session - home directory. + """List session files. + + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4359,8 +4502,10 @@ async def delete_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Delete a file or directory from the session sandbox. If ``recursive`` is false (default) and - the target is a non-empty directory, the API returns 409 Conflict. + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4428,7 +4573,7 @@ async def delete_session_file( @overload async def create_optimization_job( self, - inputs: _models.OptimizationJobInputs, + job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -4439,8 +4584,8 @@ async def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.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 @@ -4454,15 +4599,15 @@ async def create_optimization_job( @overload async def create_optimization_job( - self, inputs: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: JSON + :param job: The job to create. Required. + :type job: JSON :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 @@ -4477,7 +4622,7 @@ async def create_optimization_job( @overload async def create_optimization_job( self, - inputs: IO[bytes], + job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -4488,8 +4633,8 @@ async def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: IO[bytes] + :param job: The job to create. Required. + :type job: 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 @@ -4503,20 +4648,16 @@ async def create_optimization_job( @distributed_trace_async async def create_optimization_job( - self, - inputs: Union[_models.OptimizationJobInputs, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any + self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Is one of the following types: - OptimizationJobInputs, JSON, IO[bytes] Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs or JSON or IO[bytes] + :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] :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 @@ -4540,10 +4681,10 @@ async def create_optimization_job( content_type = content_type or "application/json" _content = None - if isinstance(inputs, (IOBase, bytes)): - _content = inputs + if isinstance(job, (IOBase, bytes)): + _content = job else: - _content = json.dumps(inputs, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_agents_create_optimization_job_request( operation_id=operation_id, @@ -4597,7 +4738,7 @@ async def create_optimization_job( async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: """Get info about an agent optimization job. - Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + Get an optimization job by id. :param job_id: The ID of the job. Required. :type job_id: str @@ -4637,7 +4778,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -4673,7 +4814,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationJob"]: + ) -> AsyncItemPaged["_models.OptimizationJobListItem"]: """Returns a list of agent optimization jobs. List optimization jobs. Supports cursor pagination and optional status / agent_name filters. @@ -4697,14 +4838,15 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJob - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJob] + :return: An iterator like instance of OptimizationJobListItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4736,7 +4878,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJob], + List[_models.OptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -4760,465 +4902,21 @@ async def get_next(_continuation_token=None): ) raise HttpResponseError(response=response, model=error) - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: - """Cancels an agent optimization job. - - Request cancellation. Idempotent on terminal states. - - :param job_id: The ID of the job to cancel. Required. - :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - - _request = build_beta_agents_cancel_optimization_job_request( - job_id=job_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_optimization_job(self, job_id: str, *, force: Optional[bool] = None, **kwargs: Any) -> None: - """Deletes an agent optimization job. - - Delete the job and its candidate artifacts. Cancels first if non-terminal. - - :param job_id: The ID of the job to delete. Required. - :type job_id: str - :keyword force: When true, force-delete even if the job is in a non-terminal state. Default - value is None. - :paramtype force: bool - :return: None - :rtype: None - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_beta_agents_delete_optimization_job_request( - job_id=job_id, - force=force, - api_version=self._config.api_version, - 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) - - _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 [204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_optimization_candidate( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_candidate_file( - self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Get a candidate file. + async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + """Cancels an agent optimization job. - Stream a specific file from the candidate's blob directory. + Request cancellation of a running or queued job. Returns an error if the job is already in a + terminal state. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to cancel. Required. :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5232,12 +4930,10 @@ async def get_candidate_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - _request = build_beta_agents_get_candidate_file_request( + _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5248,7 +4944,7 @@ async def get_candidate_file( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -5268,122 +4964,26 @@ async def get_candidate_file( ) raise HttpResponseError(response=response, model=error) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. + async def delete_optimization_job(self, job_id: str, **kwargs: Any) -> None: + """Deletes an agent optimization job. - Promotes a candidate, recording the deployment timestamp and target agent version. + Delete the job and its candidate artifacts. Cancels first if non-terminal. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to delete. Required. :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5394,25 +4994,14 @@ async def promote_candidate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agents_promote_candidate_request( + _request = build_beta_agents_delete_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5421,20 +5010,14 @@ async def promote_candidate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -5442,15 +5025,8 @@ async def promote_candidate( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore class BetaEvaluationTaxonomiesOperations: @@ -5472,7 +5048,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: - """Get an evaluation run by name. + """Get an evaluation taxonomy. + + Retrieves the specified evaluation taxonomy. :param name: The name of the resource. Required. :type name: str @@ -5537,6 +5115,9 @@ def list( ) -> AsyncItemPaged["_models.EvaluationTaxonomy"]: """List evaluation taxonomies. + Returns the evaluation taxonomies available in the project, optionally filtered by input name + or input type. + :keyword input_name: Filter by the evaluation input name. Default value is None. :paramtype input_name: str :keyword input_type: Filter by taxonomy input type. Default value is None. @@ -5629,7 +5210,9 @@ async def get_next(next_link=None): @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> None: - """Delete an evaluation taxonomy by name. + """Delete an evaluation taxonomy. + + Removes the specified evaluation taxonomy from the project. :param name: The name of the resource. Required. :type name: str @@ -5681,6 +5264,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5699,6 +5284,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5717,6 +5304,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5735,6 +5324,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -5811,6 +5402,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5829,6 +5422,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5847,6 +5442,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5865,6 +5462,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -5962,7 +5561,9 @@ def list_versions( limit: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. + """List evaluator versions. + + Returns the available versions for the specified evaluator. :param name: The name of the resource. Required. :type name: str @@ -6068,7 +5669,9 @@ def list( limit: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + """List latest evaluator versions. + + Lists the latest version of each evaluator. :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default @@ -6165,8 +5768,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + """Get an evaluator version. + + Retrieves the specified evaluator version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -6230,8 +5834,9 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.E @distributed_trace_async async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. + """Delete an evaluator version. + + Removes the specified evaluator version. Returns 204 whether the version existed or not. :param name: The name of the resource. Required. :type name: str @@ -6289,7 +5894,9 @@ async def create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6307,7 +5914,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6325,7 +5934,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6343,7 +5954,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6425,7 +6038,9 @@ async def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6445,7 +6060,9 @@ async def update_version( async def update_version( self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6471,7 +6088,9 @@ async def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6495,7 +6114,9 @@ async def update_version( evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6580,7 +6201,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6606,7 +6230,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6632,7 +6259,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6656,7 +6286,10 @@ async def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6746,7 +6379,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6772,7 +6408,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6798,7 +6437,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6822,7 +6464,10 @@ async def get_credentials( credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6911,7 +6556,7 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6933,7 +6578,7 @@ async def create_generation_job( async def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6960,7 +6605,7 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6986,7 +6631,7 @@ async def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -7072,7 +6717,7 @@ async def create_generation_job( @distributed_trace_async async def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Get info about an evaluator generation job. + """Get an evaluator generation job. Gets the details of an evaluator generation job by its ID. @@ -7149,9 +6794,11 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorGenerationJob"]: - """Returns a list of evaluator generation jobs. + """List evaluator generation jobs. - Returns a list of evaluator generation jobs. + Returns a list of evaluator generation jobs. The List API has up to a few seconds of + propagation delay, so a recently created job may not appear immediately; use the Get evaluator + generation job API with the job ID to retrieve a specific job without delay. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -7235,7 +6882,7 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Cancels an evaluator generation job. + """Cancel an evaluator generation job. Cancels an evaluator generation job by its ID. @@ -7302,7 +6949,9 @@ async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Eva @distributed_trace_async async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: - """Deletes an evaluator generation job by its ID. Deletes the job record only; the generated + """Delete an evaluator generation job. + + Deletes an evaluator generation job by its ID. Deletes the job record only; the generated evaluator (if any) is preserved. :param job_id: The ID of the job to delete. Required. @@ -7375,7 +7024,9 @@ def __init__(self, *args, **kwargs) -> None: async def generate( self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7392,7 +7043,9 @@ async def generate( async def generate( self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7409,7 +7062,9 @@ async def generate( async def generate( self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7424,7 +7079,9 @@ async def generate( @distributed_trace_async async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: - """Generate Insights. + """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. @@ -7501,7 +7158,9 @@ async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwa async def get( self, insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any ) -> _models.Insight: - """Get a specific insight by Id. + """Get an insight. + + Retrieves the specified insight report and its results. :param insight_id: The unique identifier for the insights report. Required. :type insight_id: str @@ -7579,7 +7238,9 @@ def list( include_coordinates: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + """List insights. + + Returns insights in reverse chronological order, with the most recent entries first. :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". Default value is None. @@ -7717,6 +7378,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7740,6 +7403,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -7756,6 +7421,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -7779,6 +7446,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + 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] :keyword name: The name of the memory store. Required. @@ -7877,6 +7546,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -7898,6 +7569,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -7916,6 +7589,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -7940,6 +7615,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :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. @@ -8023,7 +7700,9 @@ async def update( @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + """Get a memory store. + + Retrieves the specified memory store and its current configuration. :param name: The name of the memory store to retrieve. Required. :type name: str @@ -8095,7 +7774,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + """List memory stores. + + Returns the memory stores available to the caller. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -8180,6 +7861,8 @@ async def get_next(_continuation_token=None): async def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: """Delete a memory store. + Deletes the specified memory store. + :param name: The name of the memory store to delete. Required. :type name: str :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping @@ -8274,7 +7957,9 @@ async def _search_memories( options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + """Search memories. + + Searches the specified memory store for memories relevant to the provided conversation context. :param name: The name of the memory store to search. Required. :type name: str @@ -8482,7 +8167,10 @@ async def _begin_update_memories( update_delay: Optional[int] = None, **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + """Update memories. + + Starts an update that writes conversation memories into the specified memory store. The + operation returns a long-running status location for polling the update result. :param name: The name of the memory store to update. Required. :type name: str @@ -8573,7 +8261,9 @@ def get_long_running_output(pipeline_response): async def delete_scope( self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8593,7 +8283,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8612,7 +8304,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8631,7 +8325,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8726,7 +8422,9 @@ async def create_memory( content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8750,7 +8448,9 @@ async def create_memory( async def create_memory( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8768,7 +8468,9 @@ async def create_memory( async def create_memory( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8793,7 +8495,9 @@ async def create_memory( kind: Union[str, _models.MemoryItemKind] = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8889,7 +8593,9 @@ async def create_memory( async def update_memory( self, name: str, memory_id: str, *, content: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8909,7 +8615,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8929,7 +8637,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8949,7 +8659,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9036,7 +8748,9 @@ async def update_memory( @distributed_trace_async async def get_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.MemoryItem: - """Retrieve a memory item from a memory store. + """Get a memory item. + + Retrieves the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9115,7 +8829,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9160,7 +8876,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9204,7 +8922,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9248,7 +8968,9 @@ def list_memories( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9365,7 +9087,9 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: - """Delete a memory item from a memory store. + """Delete a memory item. + + Deletes the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9451,7 +9175,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.ModelVersion"]: - """List all versions of the given ModelVersion. + """List versions. + + List all versions of the given ModelVersion. :param name: The name of the resource. Required. :type name: str @@ -9542,7 +9268,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelVersion"]: - """List the latest version of each ModelVersion. + """List latest versions. + + List the latest version of each ModelVersion. :return: An iterator like instance of ModelVersion :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ModelVersion] @@ -9630,8 +9358,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: - """Get the specific version of the ModelVersion. The service returns 404 Not Found error if the - ModelVersion does not exist. + """Get a model version. + + Retrieves the specified model version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -9695,7 +9424,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVers @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion + """Delete a model version. + + Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. :param name: The name of the resource. Required. @@ -9755,7 +9486,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9782,7 +9515,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9809,7 +9544,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9834,7 +9571,9 @@ async def update( model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9921,8 +9660,10 @@ async def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9942,8 +9683,10 @@ async def pending_create_version( async def pending_create_version( self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9969,8 +9712,10 @@ async def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9990,8 +9735,10 @@ async def pending_create_version( async def pending_create_version( self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -10079,7 +9826,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10106,7 +9855,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10133,7 +9884,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10158,7 +9911,9 @@ async def pending_upload( pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10245,7 +10000,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10271,7 +10028,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10297,7 +10056,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10321,7 +10082,9 @@ async def get_credentials( credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10416,7 +10179,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: - """Get a redteam by name. + """Get a redteam. + + Retrieves the specified redteam and its configuration. :param name: Identifier of the red team run. Required. :type name: str @@ -10477,7 +10242,9 @@ async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.RedTeam"]: - """List a redteam by name. + """List redteams. + + Returns the redteams available in the current project. :return: An iterator like instance of RedTeam :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RedTeam] @@ -10567,7 +10334,9 @@ async def get_next(next_link=None): async def create( self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: ~azure.ai.projects.models.RedTeam @@ -10581,7 +10350,9 @@ async def create( @overload async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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 @@ -10597,7 +10368,9 @@ async def create(self, red_team: JSON, *, content_type: str = "application/json" async def create( self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: IO[bytes] @@ -10611,7 +10384,9 @@ async def create( @distributed_trace_async async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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. @@ -10716,6 +10491,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -10741,6 +10518,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -10759,6 +10538,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -10785,6 +10566,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :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. @@ -10872,7 +10655,9 @@ async def create_or_update( @distributed_trace_async async def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: - """Retrieve a routine. + """Get a routine. + + Retrieves the specified routine and its current configuration. :param routine_name: The unique name of the routine. Required. :type routine_name: str @@ -10939,6 +10724,8 @@ async def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: async def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Enable a routine. + Enables the specified routine so it can be dispatched. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -11004,6 +10791,8 @@ async def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: async def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Disable a routine. + Disables the specified routine so it no longer runs. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -11071,6 +10860,8 @@ def list( ) -> AsyncItemPaged["_models.Routine"]: """List routines. + Returns the routines available in the current project. + :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int :keyword before: Unsupported. Reserved for future backward pagination support. Default value is @@ -11148,6 +10939,8 @@ async def get_next(_continuation_token=None): async def delete(self, routine_name: str, **kwargs: Any) -> None: """Delete a routine. + Deletes the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: None @@ -11209,6 +11002,8 @@ def list_runs( ) -> AsyncItemPaged["_models.RoutineRun"]: """List prior runs for a routine. + Returns prior runs recorded for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword filter: An optional MLflow search-runs filter expression applied within the routine's @@ -11300,6 +11095,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11319,6 +11116,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -11337,6 +11136,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -11360,6 +11161,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :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. @@ -11461,6 +11264,8 @@ def __init__(self, *args, **kwargs) -> None: async def delete(self, schedule_id: str, **kwargs: Any) -> None: """Delete a schedule. + Deletes the specified schedule resource. + :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :return: None @@ -11507,7 +11312,9 @@ async def delete(self, schedule_id: str, **kwargs: Any) -> None: @distributed_trace_async async def get(self, schedule_id: str, **kwargs: Any) -> _models.Schedule: - """Get a schedule by id. + """Get a schedule. + + Retrieves the specified schedule resource. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11574,7 +11381,9 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Schedule"]: - """List all schedules. + """List schedules. + + Returns schedules that match the supplied type and enabled filters. :keyword type: Filter by the type of schedule. Known values are: "Evaluation" and "Insight". Default value is None. @@ -11671,7 +11480,9 @@ async def get_next(next_link=None): async def create_or_update( self, schedule_id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11689,7 +11500,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11707,7 +11520,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11725,7 +11540,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11799,7 +11616,9 @@ async def create_or_update( @distributed_trace_async async def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: - """Get a schedule run by id. + """Get a schedule run. + + Retrieves the specified run for a schedule. :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str @@ -11874,7 +11693,9 @@ def list_runs( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ScheduleRun"]: - """List all schedule runs. + """List schedule runs. + + Returns schedule runs that match the supplied filters. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -12001,7 +11822,9 @@ async def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12031,7 +11854,9 @@ async def create_version( async def create_version( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12050,7 +11875,9 @@ async def create_version( async def create_version( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12078,7 +11905,9 @@ async def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12182,6 +12011,8 @@ async def create_version( async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: """Retrieve a toolbox. + Retrieves the specified toolbox and its current configuration. + :param name: The name of the toolbox to retrieve. Required. :type name: str :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping @@ -12252,7 +12083,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ToolboxObject"]: - """List all toolboxes. + """List toolboxes. + + Returns the toolboxes available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -12343,7 +12176,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: - """List all versions of a toolbox. + """List toolbox versions. + + Returns the available versions for the specified toolbox. :param name: The name of the toolbox to list versions for. Required. :type name: str @@ -12431,6 +12266,8 @@ async def get_next(_continuation_token=None): async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: """Retrieve a specific version of a toolbox. + Retrieves the specified version of a toolbox by name and version identifier. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -12501,6 +12338,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :keyword default_version: The version identifier that the toolbox should point to. When set, @@ -12520,6 +12359,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -12538,6 +12379,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -12556,6 +12399,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :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. @@ -12639,7 +12484,9 @@ async def update( @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> None: - """Delete a toolbox and all its versions. + """Delete a toolbox. + + Removes the specified toolbox along with all of its versions. :param name: The name of the toolbox to delete. Required. :type name: str @@ -12693,6 +12540,8 @@ async def delete(self, name: str, **kwargs: Any) -> None: async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: """Delete a specific version of a toolbox. + Removes the specified version of a toolbox. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to delete. Required. @@ -12764,7 +12613,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.SkillDetails: - """Retrieves a skill. + """Retrieve a skill. + + Retrieves the specified skill and its current configuration. :param name: The unique name of the skill. Required. :type name: str @@ -12836,7 +12687,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SkillDetails"]: - """Returns the list of all skills. + """List skills. + + Returns the skills available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -12923,6 +12776,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :keyword default_version: The version identifier that the skill should point to. When set, the @@ -12942,6 +12797,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -12960,6 +12817,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -12978,6 +12837,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :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. @@ -13061,7 +12922,9 @@ async def update( @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> _models.DeleteSkillResult: - """Deletes a skill. + """Delete a skill. + + Removes the specified skill and its associated versions. :param name: The unique name of the skill. Required. :type name: str @@ -13134,7 +12997,9 @@ async def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13155,7 +13020,9 @@ async def create( async def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13173,7 +13040,9 @@ async def create( async def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13197,7 +13066,9 @@ async def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13284,7 +13155,9 @@ async def create( async def create_from_files( self, name: str, content: _models.CreateSkillVersionFromFilesBody, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13297,7 +13170,9 @@ async def create_from_files( @overload async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13312,7 +13187,9 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m async def create_from_files( self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13393,7 +13270,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SkillVersion"]: - """List all versions of a skill. + """List skill versions. + + Returns the available versions for the specified skill. :param name: The name of the skill to list versions for. Required. :type name: str @@ -13481,6 +13360,8 @@ async def get_next(_continuation_token=None): async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVersion: """Retrieve a specific version of a skill. + Retrieves the specified version of a skill by name and version identifier. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -13549,6 +13430,8 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.S async def download(self, name: str, **kwargs: Any) -> AsyncIterator[bytes]: """Download the zip content for the default version of a skill. + Downloads the zip content for the default version of a skill. + :param name: The name of the skill. Required. :type name: str :return: AsyncIterator[bytes] @@ -13614,6 +13497,8 @@ async def download(self, name: str, **kwargs: Any) -> AsyncIterator[bytes]: async def download_version(self, name: str, version: str, **kwargs: Any) -> AsyncIterator[bytes]: """Download the zip content for a specific version of a skill. + Downloads the zip content for a specific version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version to download content for. Required. @@ -13682,6 +13567,8 @@ async def download_version(self, name: str, version: str, **kwargs: Any) -> Asyn async def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.DeleteSkillVersionResult: """Delete a specific version of a skill. + Removes the specified version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to delete. Required. @@ -13767,9 +13654,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Get info about a data generation job. + """Get a data generation job. - Gets the details of a data generation job by its ID. + Retrieves the specified data generation job and its current status. :param job_id: The ID of the job. Required. :type job_id: str @@ -13844,7 +13731,7 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.DataGenerationJob"]: - """Returns a list of data generation jobs. + """List data generation jobs. Returns a list of data generation jobs. @@ -13936,9 +13823,9 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: ~azure.ai.projects.models.DataGenerationJob @@ -13957,9 +13844,9 @@ async def create_generation_job( async def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: JSON @@ -13983,9 +13870,9 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: IO[bytes] @@ -14008,9 +13895,9 @@ async def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates 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. @@ -14093,9 +13980,9 @@ async def create_generation_job( @distributed_trace_async async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Cancels a data generation job. + """Cancel a data generation job. - Cancels a data generation job by its ID. + Cancels the specified data generation job if it is still in progress. :param job_id: The ID of the job to cancel. Required. :type job_id: str @@ -14160,9 +14047,9 @@ async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Dat @distributed_trace_async async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: - """Deletes a data generation job. + """Delete a data generation job. - Deletes a data generation job by its ID. + Removes the specified data generation job and its associated output. :param job_id: The ID of the job to delete. Required. :type job_id: str 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 0379362a10a5..692d897c2926 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 @@ -27,7 +27,6 @@ AgentEndpointAuthorizationScheme, AgentEndpointConfig, AgentEvaluatorGenerationJobSource, - AgentIdentifier, AgentIdentity, AgentObjectVersions, AgentSessionResource, @@ -66,10 +65,6 @@ BrowserAutomationPreviewTool, BrowserAutomationToolConnectionParameters, BrowserAutomationToolParameters, - CandidateDeployConfig, - CandidateFileInfo, - CandidateMetadata, - CandidateResults, CaptureStructuredOutputsTool, ChartCoordinate, ChatSummaryMemoryItem, @@ -116,8 +111,6 @@ DatasetCredential, DatasetDataGenerationJobOutput, DatasetEvaluatorGenerationJobSource, - DatasetInfo, - DatasetRef, DatasetReference, DatasetVersion, DeleteAgentResponse, @@ -246,20 +239,24 @@ OpenApiProjectConnectionAuthDetails, OpenApiProjectConnectionSecurityScheme, OpenApiTool, - OptimizationAgentDefinition, + OptimizationAgentIdentifier, OptimizationCandidate, + OptimizationDatasetCriterion, + OptimizationDatasetInput, + OptimizationDatasetItem, + OptimizationEvaluatorRef, + OptimizationInlineDatasetInput, OptimizationJob, OptimizationJobInputs, + OptimizationJobListItem, OptimizationJobProgress, OptimizationJobResult, OptimizationOptions, - OptimizationTaskResult, + OptimizationReferenceDatasetInput, OtlpTelemetryEndpoint, PendingUploadRequest, PendingUploadResponse, ProceduralMemoryItem, - PromoteCandidateRequest, - PromoteCandidateResponse, PromotionInfo, PromptAgentDefinition, PromptAgentDefinitionTextOptions, @@ -415,6 +412,7 @@ MemoryStoreUpdateStatus, OpenApiAuthType, OperationState, + OptimizationDatasetInputType, PageOrder, PendingUploadType, RankerVersionType, @@ -463,7 +461,6 @@ "AgentEndpointAuthorizationScheme", "AgentEndpointConfig", "AgentEvaluatorGenerationJobSource", - "AgentIdentifier", "AgentIdentity", "AgentObjectVersions", "AgentSessionResource", @@ -502,10 +499,6 @@ "BrowserAutomationPreviewTool", "BrowserAutomationToolConnectionParameters", "BrowserAutomationToolParameters", - "CandidateDeployConfig", - "CandidateFileInfo", - "CandidateMetadata", - "CandidateResults", "CaptureStructuredOutputsTool", "ChartCoordinate", "ChatSummaryMemoryItem", @@ -552,8 +545,6 @@ "DatasetCredential", "DatasetDataGenerationJobOutput", "DatasetEvaluatorGenerationJobSource", - "DatasetInfo", - "DatasetRef", "DatasetReference", "DatasetVersion", "DeleteAgentResponse", @@ -682,20 +673,24 @@ "OpenApiProjectConnectionAuthDetails", "OpenApiProjectConnectionSecurityScheme", "OpenApiTool", - "OptimizationAgentDefinition", + "OptimizationAgentIdentifier", "OptimizationCandidate", + "OptimizationDatasetCriterion", + "OptimizationDatasetInput", + "OptimizationDatasetItem", + "OptimizationEvaluatorRef", + "OptimizationInlineDatasetInput", "OptimizationJob", "OptimizationJobInputs", + "OptimizationJobListItem", "OptimizationJobProgress", "OptimizationJobResult", "OptimizationOptions", - "OptimizationTaskResult", + "OptimizationReferenceDatasetInput", "OtlpTelemetryEndpoint", "PendingUploadRequest", "PendingUploadResponse", "ProceduralMemoryItem", - "PromoteCandidateRequest", - "PromoteCandidateResponse", "PromotionInfo", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", @@ -848,6 +843,7 @@ "MemoryStoreUpdateStatus", "OpenApiAuthType", "OperationState", + "OptimizationDatasetInputType", "PageOrder", "PendingUploadType", "RankerVersionType", 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 bc29c0a8b58d..53716def91a6 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 @@ -49,8 +49,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DATA_GENERATION_JOBS_V1_PREVIEW.""" MODELS_V1_PREVIEW = "Models=V1Preview" """MODELS_V1_PREVIEW.""" - AGENTS_OPTIMIZATION_V1_PREVIEW = "AgentsOptimization=V1Preview" - """AGENTS_OPTIMIZATION_V1_PREVIEW.""" + AGENTS_OPTIMIZATION_V2_PREVIEW = "AgentsOptimization=V2Preview" + """AGENTS_OPTIMIZATION_V2_PREVIEW.""" class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -123,6 +123,8 @@ class AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ACTIVITY_PROTOCOL.""" RESPONSES = "responses" """RESPONSES.""" + A2A = "a2a" + """A2A.""" MCP = "mcp" """MCP.""" INVOCATIONS = "invocations" @@ -792,6 +794,15 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been canceled by the user.""" +class OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Discriminator values for the dataset input union.""" + + INLINE = "inline" + """Inline dataset — items are provided directly in the request body.""" + REFERENCE = "reference" + """Reference to a registered Foundry dataset by name and version.""" + + class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of PageOrder.""" 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 368fad6a64fd..8c31b279e262 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 @@ -39,6 +39,7 @@ MemoryStoreKind, MemoryStoreObjectType, OpenApiAuthType, + OptimizationDatasetInputType, PendingUploadType, RecurrenceType, RoutineActionType, @@ -858,40 +859,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore -class AgentIdentifier(_Model): - """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered Foundry agent name (required). Required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pinned agent version. Defaults to latest if omitted.""" - - @overload - def __init__( - self, - *, - agent_name: str, - agent_version: 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 AgentIdentity(_Model): """AgentIdentity. @@ -2648,208 +2615,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CandidateDeployConfig(_Model): - """Deploy-config blob for a candidate. Suitable for setting OPTIMIZATION_CONFIG on a hosted-agent - version. - - :ivar instructions: System prompt / instructions. - :vartype instructions: str - :ivar model: Foundry deployment name. - :vartype model: str - :ivar temperature: Optional sampling temperature. - :vartype temperature: float - :ivar skills: Optional skill overrides. - :vartype skills: list[dict[str, any]] - :ivar tools: Optional tool overrides. - :vartype tools: list[dict[str, any]] - """ - - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """System prompt / instructions.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry deployment name.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional sampling temperature.""" - skills: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional skill overrides.""" - tools: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional tool overrides.""" - - @overload - def __init__( - self, - *, - instructions: Optional[str] = None, - model: Optional[str] = None, - temperature: Optional[float] = None, - skills: Optional[list[dict[str, Any]]] = None, - tools: Optional[list[dict[str, Any]]] = 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 CandidateFileInfo(_Model): - """File entry in a candidate's blob directory. - - :ivar path: Relative path of the file. Required. - :vartype path: str - :ivar type: File type category (e.g. 'config', 'results'). Required. - :vartype type: str - :ivar size_bytes: File size in bytes. Required. - :vartype size_bytes: int - """ - - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative path of the file. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File type category (e.g. 'config', 'results'). Required.""" - size_bytes: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File size in bytes. Required.""" - - @overload - def __init__( - self, - *, - path: str, - type: str, - size_bytes: int, - ) -> 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 CandidateMetadata(_Model): - """Candidate metadata returned by GET /candidates/{id}. - - :ivar candidate_id: Server-assigned candidate identifier. Required. - :vartype candidate_id: str - :ivar job_id: Owning optimization job id. Required. - :vartype job_id: str - :ivar candidate_name: Display name of the candidate. Required. - :vartype candidate_name: str - :ivar status: Candidate lifecycle status. Required. - :vartype status: str - :ivar score: Candidate's aggregate score. - :vartype score: float - :ivar has_results: Whether detailed results are available for this candidate. Required. - :vartype has_results: bool - :ivar created_at: Timestamp when the candidate was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: Timestamp when the candidate was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar promotion: Promotion metadata. Null if not promoted. - :vartype promotion: ~azure.ai.projects.models.PromotionInfo - :ivar files: Files in the candidate's blob directory. Required. - :vartype files: list[~azure.ai.projects.models.CandidateFileInfo] - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server-assigned candidate identifier. Required.""" - job_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Owning optimization job id. Required.""" - candidate_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of the candidate. Required.""" - status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate lifecycle status. Required.""" - score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate's aggregate score.""" - has_results: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether detailed results are available for this candidate. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when the candidate was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when the candidate was last updated, represented in Unix time. Required.""" - promotion: Optional["_models.PromotionInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Promotion metadata. Null if not promoted.""" - files: list["_models.CandidateFileInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Files in the candidate's blob directory. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - job_id: str, - candidate_name: str, - status: str, - has_results: bool, - created_at: datetime.datetime, - updated_at: datetime.datetime, - files: list["_models.CandidateFileInfo"], - score: Optional[float] = None, - promotion: Optional["_models.PromotionInfo"] = 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 CandidateResults(_Model): - """Full per-task evaluation results for a candidate, returned by GET /candidates/{id}/results. - - :ivar candidate_id: Owning candidate id. Required. - :vartype candidate_id: str - :ivar results: Per-task evaluation rows. Required. - :vartype results: list[~azure.ai.projects.models.OptimizationTaskResult] - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Owning candidate id. Required.""" - results: list["_models.OptimizationTaskResult"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-task evaluation rows. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - results: list["_models.OptimizationTaskResult"], - ) -> 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 CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): """A tool for capturing structured outputs. @@ -5099,83 +4864,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class DatasetInfo(_Model): - """Metadata about the dataset used for optimization, surfaced in the response. - - :ivar name: Dataset name when using a registered dataset reference. Null for inline datasets. - :vartype name: str - :ivar version: Dataset version when using a registered dataset reference. Null for inline - datasets. - :vartype version: str - :ivar task_count: Number of tasks/rows in the dataset. Required. - :vartype task_count: int - :ivar is_inline: True when the dataset was provided inline in the request body. Required. - :vartype is_inline: bool - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name when using a registered dataset reference. Null for inline datasets.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version when using a registered dataset reference. Null for inline datasets.""" - task_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of tasks/rows in the dataset. Required.""" - is_inline: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """True when the dataset was provided inline in the request body. Required.""" - - @overload - def __init__( - self, - *, - task_count: int, - is_inline: bool, - name: Optional[str] = None, - version: 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 DatasetRef(_Model): - """Reference to a registered dataset in the Foundry Dataset Service. - - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :vartype version: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. If not specified, the latest version is used.""" - - @overload - def __init__( - self, - *, - name: str, - version: 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 DatasetReference(_Model): """Reference to a versioned Foundry Dataset. @@ -6858,6 +6546,12 @@ class EvaluatorVersion(_Model): :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType :ivar categories: The categories of the evaluator. Required. :vartype categories: list[str or ~azure.ai.projects.models.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[str or ~azure.ai.projects.models.EvaluationLevel] :ivar definition: Definition of the evaluator. Required. :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; @@ -6893,6 +6587,13 @@ class EvaluatorVersion(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The categories of the evaluator. Required.""" + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) """Definition of the evaluator. Required.""" generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) @@ -6925,6 +6626,7 @@ def __init__( definition: "_models.EvaluatorDefinition", display_name: Optional[str] = None, metadata: Optional[dict[str, str]] = None, + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, description: Optional[str] = None, tags: Optional[dict[str, str]] = None, ) -> None: ... @@ -10872,46 +10574,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.OPENAPI # type: ignore -class OptimizationAgentDefinition(_Model): - """Agent definition returned in response payloads (includes resolved config). +class OptimizationAgentIdentifier(_Model): + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. - :ivar agent_name: Agent name. + :ivar agent_name: Registered Foundry agent name (required). Required. :vartype agent_name: str - :ivar agent_version: Agent version. + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. :vartype agent_version: str - :ivar model: Model deployment name. - :vartype model: str - :ivar system_prompt: System prompt / instructions. - :vartype system_prompt: str - :ivar skills: Agent skills. - :vartype skills: list[dict[str, any]] - :ivar tools: Agent tools. - :vartype tools: list[dict[str, any]] """ - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent name.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered Foundry agent name (required). Required.""" agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent version.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment name.""" - system_prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """System prompt / instructions.""" - skills: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent skills.""" - tools: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent tools.""" + """Pinned agent version. Defaults to latest if omitted.""" @overload def __init__( self, *, - agent_name: Optional[str] = None, + agent_name: str, agent_version: Optional[str] = None, - model: Optional[str] = None, - system_prompt: Optional[str] = None, - skills: Optional[list[dict[str, Any]]] = None, - tools: Optional[list[dict[str, Any]]] = None, ) -> None: ... @overload @@ -10933,22 +10616,12 @@ class OptimizationCandidate(_Model): :vartype candidate_id: str :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. :vartype name: str - :ivar config: The agent configuration that produced this candidate. Required. - :vartype config: ~azure.ai.projects.models.OptimizationAgentDefinition :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - Required. :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 pass_rate: Fraction of tasks that met the pass threshold. Required. - :vartype pass_rate: float - :ivar task_scores: Individual task-level scores. Required. - :vartype task_scores: list[~azure.ai.projects.models.OptimizationTaskResult] - :ivar is_pareto_optimal: Whether this candidate is on the Pareto frontier (score vs cost). - Required. - :vartype is_pareto_optimal: bool :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. @@ -10961,24 +10634,12 @@ class OptimizationCandidate(_Model): """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - config: "_models.OptimizationAgentDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The agent configuration that produced this candidate. Required.""" - mutations: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). Required.""" + mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Average composite score across all tasks. Required.""" avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Average token usage across all tasks. Required.""" - pass_rate: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Fraction of tasks that met the pass threshold. Required.""" - task_scores: list["_models.OptimizationTaskResult"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Individual task-level scores. Required.""" - is_pareto_optimal: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this candidate is on the Pareto frontier (score vs cost). Required.""" eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Foundry evaluation identifier used to score this candidate.""" eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -10993,14 +10654,10 @@ def __init__( self, *, name: str, - config: "_models.OptimizationAgentDefinition", - mutations: dict[str, Any], avg_score: float, avg_tokens: float, - pass_rate: float, - task_scores: list["_models.OptimizationTaskResult"], - is_pareto_optimal: bool, candidate_id: Optional[str] = None, + mutations: Optional[dict[str, Any]] = None, eval_id: Optional[str] = None, eval_run_id: Optional[str] = None, promotion: Optional["_models.PromotionInfo"] = None, @@ -11017,6 +10674,187 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class OptimizationDatasetCriterion(_Model): + """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion name. Required.""" + instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion instruction / description. Required.""" + + @overload + def __init__( + self, + *, + name: str, + instruction: 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 OptimizationDatasetInput(_Model): + """Base discriminated model for dataset input. Either inline items or a registered reference. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OptimizationInlineDatasetInput, OptimizationReferenceDatasetInput + + :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and + "reference". + :vartype type: str or ~azure.ai.projects.models.OptimizationDatasetInputType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" + + @overload + def __init__( + self, + *, + type: 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 OptimizationDatasetItem(_Model): + """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[~azure.ai.projects.models.OptimizationDatasetCriterion] + """ + + query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user query / prompt.""" + ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expected ground truth answer.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-item evaluation criteria.""" + + @overload + def __init__( + self, + *, + query: Optional[str] = None, + ground_truth: Optional[str] = None, + desired_num_turns: Optional[int] = None, + criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = 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 OptimizationEvaluatorRef(_Model): + """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator version. If not specified, the latest version is used.""" + + @overload + def __init__( + self, + *, + name: str, + version: 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 OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator="inline"): + """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: str or ~azure.ai.projects.models.INLINE + :ivar items_property: Dataset items. Required. + :vartype items_property: list[~azure.ai.projects.models.OptimizationDatasetItem] + """ + + type: Literal[OptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + items_property: list["_models.OptimizationDatasetItem"] = rest_field( + name="items", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="items" + ) + """Dataset items. Required.""" + + @overload + def __init__( + self, + *, + items_property: list["_models.OptimizationDatasetItem"], + ) -> 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) + self.type = OptimizationDatasetInputType.INLINE # type: ignore + + class OptimizationJob(_Model): """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 @@ -11024,48 +10862,48 @@ class OptimizationJob(_Model): :ivar id: Server-assigned unique identifier. Required. :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.OptimizationJobResult :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", "succeeded", "failed", and "cancelled". :vartype status: str or ~azure.ai.projects.models.JobStatus :ivar error: Error details — populated only on failure. :vartype error: ~azure.ai.projects.models.ApiError - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.OptimizationJobResult - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated (status, progress, or result - change), represented in Unix time. + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. :vartype updated_at: ~datetime.datetime - :ivar progress: Progress while in flight. Absent in terminal states. + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar dataset: Metadata about the dataset used for this optimization job. - :vartype dataset: ~azure.ai.projects.models.DatasetInfo + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] """ id: str = rest_field(visibility=["read"]) """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.OptimizationJobInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Caller-supplied inputs.""" + result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", \"succeeded\", \"failed\", and \"cancelled\".""" error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) """Error details — populated only on failure.""" - result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - inputs: Optional["_models.OptimizationJobInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Caller-supplied inputs.""" created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated (status, progress, or result change), represented - in Unix time.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress while in flight. Absent in terminal states.""" - dataset: Optional["_models.DatasetInfo"] = rest_field(visibility=["read"]) - """Metadata about the dataset used for this optimization job.""" + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: Optional[list[str]] = rest_field(visibility=["read"]) + """Non-fatal warnings emitted at any point during optimization.""" @overload def __init__( @@ -11089,32 +10927,38 @@ class OptimizationJobInputs(_Model): """Caller-supplied inputs for an optimization job. :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: ~azure.ai.projects.models.AgentIdentifier - :ivar train_dataset_reference: Reference to a registered training dataset (required). Required. - :vartype train_dataset_reference: ~azure.ai.projects.models.DatasetRef - :ivar validation_dataset_reference: Optional held-out validation dataset for measuring - generalization of the final candidate. - :vartype validation_dataset_reference: ~azure.ai.projects.models.DatasetRef - :ivar evaluators: Job-level evaluators (referenced by name). Per-task criteria may override. - Default: ['task_adherence']. - :vartype evaluators: list[str] + :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: ~azure.ai.projects.models.OptimizationDatasetInput + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: ~azure.ai.projects.models.OptimizationDatasetInput + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list[~azure.ai.projects.models.OptimizationEvaluatorRef] :ivar options: Tuning knobs and run-mode. :vartype options: ~azure.ai.projects.models.OptimizationOptions """ - agent: "_models.AgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + agent: "_models.OptimizationAgentIdentifier" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The agent (and pinned version) being optimized. Required.""" - train_dataset_reference: "_models.DatasetRef" = rest_field( + train_dataset: "_models.OptimizationDatasetInput" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Reference to a registered training dataset (required). Required.""" - validation_dataset_reference: Optional["_models.DatasetRef"] = rest_field( + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: Optional["_models.OptimizationDatasetInput"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Job-level evaluators (referenced by name). Per-task criteria may override. Default: - ['task_adherence'].""" + evaluators: list["_models.OptimizationEvaluatorRef"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" options: Optional["_models.OptimizationOptions"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11124,10 +10968,10 @@ class OptimizationJobInputs(_Model): def __init__( self, *, - agent: "_models.AgentIdentifier", - train_dataset_reference: "_models.DatasetRef", - validation_dataset_reference: Optional["_models.DatasetRef"] = None, - evaluators: Optional[list[str]] = None, + agent: "_models.OptimizationAgentIdentifier", + train_dataset: "_models.OptimizationDatasetInput", + evaluators: list["_models.OptimizationEvaluatorRef"], + validation_dataset: Optional["_models.OptimizationDatasetInput"] = None, options: Optional["_models.OptimizationOptions"] = None, ) -> None: ... @@ -11142,11 +10986,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class OptimizationJobListItem(_Model): + """Slim job representation returned by the LIST endpoint. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress + :ivar agent: The agent targeted by this optimization job. + :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier + """ + + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + agent: Optional["_models.OptimizationAgentIdentifier"] = rest_field(visibility=["read"]) + """The agent targeted by this optimization job.""" + + class OptimizationJobProgress(_Model): """In-flight progress; only populated while status is queued or in_progress. - :ivar current_iteration: 1-based current iteration index. Required. - :vartype current_iteration: int + :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. @@ -11154,8 +11038,8 @@ class OptimizationJobProgress(_Model): :vartype elapsed_seconds: float """ - current_iteration: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """1-based current iteration index. Required.""" + candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of candidates whose evaluation has completed so far. Required.""" best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Best score observed so far across all candidates. Required.""" elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -11165,7 +11049,7 @@ class OptimizationJobProgress(_Model): def __init__( self, *, - current_iteration: int, + candidates_completed: int, best_score: float, elapsed_seconds: float, ) -> None: ... @@ -11184,56 +11068,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OptimizationJobResult(_Model): """Terminal-state result body. Populated when status is succeeded or failed. - :ivar baseline: Evaluation scores for the original (un-optimized) agent configuration. - :vartype baseline: ~azure.ai.projects.models.OptimizationCandidate - :ivar best: The highest-scoring candidate found during optimization. - :vartype best: ~azure.ai.projects.models.OptimizationCandidate + :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[~azure.ai.projects.models.OptimizationCandidate] - :ivar options: The options used for this optimization run. - :vartype options: ~azure.ai.projects.models.OptimizationOptions - :ivar warnings: Non-fatal warnings from the optimization run (e.g., target attribute failures - that were skipped). - :vartype warnings: list[str] - :ivar all_target_attributes_failed: True when all target attributes failed — only the baseline - was evaluated. - :vartype all_target_attributes_failed: bool """ - baseline: Optional["_models.OptimizationCandidate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Evaluation scores for the original (un-optimized) agent configuration.""" - best: Optional["_models.OptimizationCandidate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The highest-scoring candidate found during optimization.""" + baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the highest-scoring candidate found during optimization.""" candidates: Optional[list["_models.OptimizationCandidate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """All evaluated candidates including baseline.""" - options: Optional["_models.OptimizationOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The options used for this optimization run.""" - warnings: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Non-fatal warnings from the optimization run (e.g., target attribute failures that were - skipped).""" - all_target_attributes_failed: Optional[bool] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """True when all target attributes failed — only the baseline was evaluated.""" @overload def __init__( self, *, - baseline: Optional["_models.OptimizationCandidate"] = None, - best: Optional["_models.OptimizationCandidate"] = None, + baseline: Optional[str] = None, + best: Optional[str] = None, candidates: Optional[list["_models.OptimizationCandidate"]] = None, - options: Optional["_models.OptimizationOptions"] = None, - warnings: Optional[list[str]] = None, - all_target_attributes_failed: Optional[bool] = None, ) -> None: ... @overload @@ -11250,8 +11108,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OptimizationOptions(_Model): """Tuning knobs and run-mode for an optimization job. - :ivar max_iterations: Maximum optimization iterations per strategy. Must be >= 1. Default: 5. - :vartype max_iterations: int + :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] @@ -11267,8 +11126,8 @@ class OptimizationOptions(_Model): :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel """ - max_iterations: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum optimization iterations per strategy. Must be >= 1. Default: 5.""" + max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" optimization_config: Optional[dict[str, Any]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11290,7 +11149,7 @@ class OptimizationOptions(_Model): def __init__( self, *, - max_iterations: Optional[int] = None, + max_candidates: Optional[int] = None, optimization_config: Optional[dict[str, Any]] = None, eval_model: Optional[str] = None, optimization_model: Optional[str] = None, @@ -11308,71 +11167,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationTaskResult(_Model): - """Per-task evaluation result for a single candidate. +class OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator="reference"): + """Reference to a registered Foundry dataset. - :ivar task_name: Task name (from the dataset). Required. - :vartype task_name: str - :ivar query: The user query / input for the task. - :vartype query: str - :ivar scores: Per-evaluator scores keyed by evaluator name. Required. - :vartype scores: dict[str, float] - :ivar composite_score: Composite score combining all evaluator scores. Required. - :vartype composite_score: float - :ivar tokens: Total tokens consumed during the agent run for this task. Required. - :vartype tokens: int - :ivar duration_seconds: Wall-clock seconds for this task's agent execution. Required. - :vartype duration_seconds: float - :ivar passed: Whether the task met the pass threshold. Required. - :vartype passed: bool - :ivar error_message: Error message if the task failed during execution. - :vartype error_message: str - :ivar rationales: Per-evaluator reasoning keyed by evaluator name. - :vartype rationales: dict[str, str] - :ivar response: Raw agent response text. - :vartype response: str - :ivar run_id: Identifier of the agent run that produced this result. - :vartype run_id: str + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: str or ~azure.ai.projects.models.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 """ - task_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Task name (from the dataset). Required.""" - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user query / input for the task.""" - scores: dict[str, float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Per-evaluator scores keyed by evaluator name. Required.""" - composite_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Composite score combining all evaluator scores. Required.""" - tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total tokens consumed during the agent run for this task. Required.""" - duration_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Wall-clock seconds for this task's agent execution. Required.""" - passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the task met the pass threshold. Required.""" - error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error message if the task failed during execution.""" - rationales: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Per-evaluator reasoning keyed by evaluator name.""" - response: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Raw agent response text.""" - run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the agent run that produced this result.""" + type: Literal[OptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered dataset name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. If not specified, the latest version is used.""" @overload def __init__( self, *, - task_name: str, - scores: dict[str, float], - composite_score: float, - tokens: int, - duration_seconds: float, - passed: bool, - query: Optional[str] = None, - error_message: Optional[str] = None, - rationales: Optional[dict[str, str]] = None, - response: Optional[str] = None, - run_id: Optional[str] = None, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -11384,6 +11204,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OptimizationDatasetInputType.REFERENCE # type: ignore class TelemetryEndpoint(_Model): @@ -11625,89 +11446,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.PROCEDURAL # type: ignore -class PromoteCandidateRequest(_Model): - """Request body for promoting a candidate to a Foundry agent version. - - :ivar agent_name: Name of the Foundry agent to promote to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent to promote to. Required. - :vartype agent_version: str - """ - - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent to promote to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent to promote to. Required.""" - - @overload - def __init__( - self, - *, - agent_name: str, - agent_version: 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 PromoteCandidateResponse(_Model): - """Response after successfully promoting a candidate. - - :ivar candidate_id: The promoted candidate id. Required. - :vartype candidate_id: str - :ivar status: Status after promotion. Required. - :vartype status: str - :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. - :vartype promoted_at: ~datetime.datetime - :ivar agent_name: Name of the Foundry agent promoted to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent promoted to. Required. - :vartype agent_version: str - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The promoted candidate id. Required.""" - status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Status after promotion. Required.""" - promoted_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when promotion occurred, represented in Unix time. Required.""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent promoted to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent promoted to. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - status: str, - promoted_at: datetime.datetime, - agent_name: str, - agent_version: 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 PromotionInfo(_Model): """Promotion metadata recorded when a candidate is deployed to a Foundry agent. @@ -12013,7 +11751,7 @@ class ProtocolVersionRecord(_Model): """A record mapping for a single protocol and its version. :ivar protocol: The protocol type. Required. Known values are: "activity_protocol", - "responses", "mcp", "invocations", and "invocations_ws". + "responses", "a2a", "mcp", "invocations", and "invocations_ws". :vartype protocol: str or ~azure.ai.projects.models.AgentProtocol :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. :vartype version: str @@ -12022,8 +11760,8 @@ class ProtocolVersionRecord(_Model): protocol: Union[str, "_models.AgentProtocol"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The protocol type. Required. Known values are: \"activity_protocol\", \"responses\", \"mcp\", - \"invocations\", and \"invocations_ws\".""" + """The protocol type. Required. Known values are: \"activity_protocol\", \"responses\", \"a2a\", + \"mcp\", \"invocations\", and \"invocations_ws\".""" version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The version string for the protocol, e.g. 'v0.1.1'. Required.""" @@ -12444,7 +12182,7 @@ class RoutineRun(_Model): :ivar id: The unique run identifier for the routine attempt. Required. :vartype id: str - :ivar status: The run status. + :ivar status: The run status. Is one of the following types: str :vartype status: str :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: "queued", "dispatching", "completed", and "failed". @@ -12497,8 +12235,8 @@ class RoutineRun(_Model): id: str = rest_field(visibility=["read"]) """The unique run identifier for the routine attempt. Required.""" - status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The run status.""" + status: Optional["_types.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"] ) @@ -12564,7 +12302,7 @@ class RoutineRun(_Model): def __init__( self, *, - status: Optional[str] = None, + status: Optional["_types.RoutineRunStatus"] = None, phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, trigger_name: Optional[str] = None, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index a907ab276781..532e98b62daf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -52,7 +52,7 @@ _AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW.value, _AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW.value, - _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V1_PREVIEW.value, + _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V2_PREVIEW.value, ] ) 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 e75ce4c9d73f..09319efc0d67 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 @@ -1328,7 +1328,7 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long - job_id: str, *, force: Optional[bool] = None, **kwargs: Any + job_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1342,192 +1342,11 @@ def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-t _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if force is not None: - _params["force"] = _SERIALIZER.query("force", force, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agents_list_optimization_candidates_request( # pylint: disable=name-too-long - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - if order is not None: - _params["order"] = _SERIALIZER.query("order", order, "str") - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_config_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/config" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_results_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/results" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_candidate_file_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, *, path: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/octet-stream") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/files" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_promote_candidate_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}:promote" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long name: str, **kwargs: Any ) -> HttpRequest: @@ -3839,7 +3658,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Retrieves the agent. + """Get an agent. + + Retrieves an agent definition by its unique name. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3904,7 +3725,9 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: @distributed_trace def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: - """Deletes an agent. For hosted agents, if any version has active sessions, the request is + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated sessions are cascade-deleted along with the agent and its versions. @@ -3985,7 +3808,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentDetails"]: - """Returns the list of all agents. + """List agents. + + Returns a paged collection of agent resources. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values are: "prompt", "hosted", "workflow", and "external". Default value is None. @@ -4082,7 +3907,9 @@ def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4117,7 +3944,9 @@ def create_version( def create_version( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4140,7 +3969,9 @@ def create_version( def create_version( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4171,7 +4002,9 @@ def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4287,7 +4120,9 @@ def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4322,7 +4157,9 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4345,7 +4182,9 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4376,7 +4215,9 @@ def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4484,7 +4325,9 @@ def create_version_from_manifest( @distributed_trace def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Retrieves a specific version of an agent. + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -4554,7 +4397,9 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo def delete_version( self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentVersionResponse: - """Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all sessions associated with this version are cascade-deleted. @@ -4639,7 +4484,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentVersionDetails"]: - """Returns the list of versions of an agent. + """List agent versions. + + Returns a paged collection of versions for the specified agent. :param agent_name: The name of the agent to retrieve versions for. Required. :type agent_name: str @@ -4745,6 +4592,8 @@ def __init__(self, *args, **kwargs) -> None: def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: """Get an evaluation rule. + Retrieves the specified evaluation rule and its configuration. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping @@ -4806,6 +4655,8 @@ def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete an evaluation rule. + Removes the specified evaluation rule from the project. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: None @@ -4856,6 +4707,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4874,6 +4727,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4892,6 +4747,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4910,6 +4767,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: @@ -4989,7 +4848,10 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. + """List evaluation rules. + + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. :keyword action_type: Filter by the type of evaluation rule. Known values are: "continuousEvaluation" and "humanEvaluationPreview". Default value is None. @@ -5105,7 +4967,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, without populating connection credentials. + """Get a connection. + + Retrieves the specified connection and its configuration details without including credential + values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -5171,7 +5036,9 @@ def _get(self, name: str, **kwargs: Any) -> _models.Connection: @distributed_trace def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + """Get a connection with credentials. + + Retrieves the specified connection together with its credential values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -5243,13 +5110,16 @@ def list( default_connection: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Connection"]: - """List all connections in the project, without populating connection credentials. + """List connections. - :keyword connection_type: List connections of this specific type. Known values are: + Returns the connections available in the current project, optionally filtered by type or + default status. + + :keyword connection_type: Lists connections of this specific type. Known values are: "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List connections that are default connections. Default value is + :keyword default_connection: Lists connections that are default connections. Default value is None. :paramtype default_connection: bool :return: An iterator like instance of Connection @@ -5358,7 +5228,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List all versions of the given DatasetVersion. + """List versions. + + List all versions of the given DatasetVersion. :param name: The name of the resource. Required. :type name: str @@ -5449,7 +5321,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + """List latest versions. + + List the latest version of each DatasetVersion. :return: An iterator like instance of DatasetVersion :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] @@ -5537,7 +5411,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + """Get a version. + + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -5602,7 +5478,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + """Delete a version. + + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -5662,7 +5540,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5688,7 +5568,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5714,7 +5596,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5734,7 +5618,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5819,7 +5705,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5845,7 +5733,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5871,7 +5761,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5895,7 +5787,9 @@ def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5973,7 +5867,9 @@ def pending_upload( @distributed_trace def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + """Get dataset credentials. + + Gets the SAS credential to access the storage account associated with a Dataset version. :param name: The name of the resource. Required. :type name: str @@ -6055,7 +5951,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + """Get a deployment. + + Gets a deployed model. :param name: Name of the deployment. Required. :type name: str @@ -6128,7 +6026,10 @@ def list( deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> ItemPaged["_models.Deployment"]: - """List all deployed models in the project. + """List deployments. + + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. :keyword model_publisher: Model publisher to filter models by. Default value is None. :paramtype model_publisher: str @@ -6245,7 +6146,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List all versions of the given Index. + """List versions. + + List all versions of the given Index. :param name: The name of the resource. Required. :type name: str @@ -6336,7 +6239,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List the latest version of each Index. + """List latest versions. + + List the latest version of each Index. :return: An iterator like instance of Index :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] @@ -6424,7 +6329,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get the specific version of the Index. The service returns 404 Not Found error if the Index + """Get a version. + + Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. :param name: The name of the resource. Required. @@ -6489,7 +6396,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the Index. The service returns 204 No Content if the Index was + """Delete a version. + + Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. :param name: The name of the resource. Required. @@ -6549,7 +6458,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6569,7 +6480,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6595,7 +6508,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6615,7 +6530,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6691,7 +6608,7 @@ def create_or_update( return deserialized # type: ignore -class BetaAgentsOperations: # pylint: disable=too-many-public-methods +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -6718,7 +6635,9 @@ def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6738,7 +6657,9 @@ def patch_agent_details( def patch_agent_details( self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6756,7 +6677,9 @@ def patch_agent_details( def patch_agent_details( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6780,7 +6703,9 @@ def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6871,7 +6796,12 @@ def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -6894,7 +6824,12 @@ def create_version_from_code( def create_version_from_code( self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -6922,7 +6857,12 @@ def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -7004,7 +6944,9 @@ def create_version_from_code( @distributed_trace def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: - """Download the code zip for a code-based hosted agent. + """Download agent code. + + Downloads the code zip for a code-based hosted agent. Returns the previously-uploaded zip (``application/zip``). If ``agent_version`` is supplied, returns that version's code zip; otherwise @@ -7090,7 +7032,9 @@ def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7122,7 +7066,9 @@ def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7151,7 +7097,9 @@ def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7181,7 +7129,9 @@ def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7276,7 +7226,9 @@ def create_session( def get_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Retrieves a session by ID. + """Get a session. + + Retrieves the details of a hosted agent session by agent name and session identifier. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7350,7 +7302,9 @@ def get_session( def delete_session( # pylint: disable=inconsistent-return-statements self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + """Delete a session. + + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist. :param agent_name: The name of the agent. Required. @@ -7412,7 +7366,10 @@ def delete_session( # pylint: disable=inconsistent-return-statements def stop_session( # pylint: disable=inconsistent-return-statements self, agent_name: str, session_id: str, **kwargs: Any ) -> None: - """Stops a session. Returns 204 No Content when the stop succeeds. + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7476,7 +7433,9 @@ def list_sessions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentSessionResource"]: - """Returns a list of sessions for the specified agent. + """List sessions for an agent. + + Returns a paged collection of sessions associated with the specified agent endpoint. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7568,7 +7527,9 @@ def get_next(_continuation_token=None): def get_session_log_stream( self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any ) -> _models.SessionLogEvent: - """Streams console logs (stdout / stderr) for a specific hosted agent session + """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: @@ -7676,8 +7637,10 @@ def _upload_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.SessionFileWriteResult: - """Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads - exceeding this limit return 413 Payload Too Large. + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7768,7 +7731,10 @@ def download_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: - """Download a file from the session sandbox as a binary stream. + """Download a session file. + + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7852,9 +7818,11 @@ def list_session_files( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SessionDirectoryEntry"]: - """List files and directories at a given path in the session sandbox. Returns only the immediate - children of the specified directory (non-recursive). If path is not provided, lists the session - home directory. + """List session files. + + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7960,8 +7928,10 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Delete a file or directory from the session sandbox. If ``recursive`` is false (default) and - the target is a non-empty directory, the API returns 409 Conflict. + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -8029,7 +7999,7 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements @overload def create_optimization_job( self, - inputs: _models.OptimizationJobInputs, + job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -8040,8 +8010,8 @@ def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.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 @@ -8055,15 +8025,15 @@ def create_optimization_job( @overload def create_optimization_job( - self, inputs: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: JSON + :param job: The job to create. Required. + :type job: JSON :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 @@ -8078,7 +8048,7 @@ def create_optimization_job( @overload def create_optimization_job( self, - inputs: IO[bytes], + job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -8089,8 +8059,8 @@ def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: IO[bytes] + :param job: The job to create. Required. + :type job: 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 @@ -8104,20 +8074,16 @@ def create_optimization_job( @distributed_trace def create_optimization_job( - self, - inputs: Union[_models.OptimizationJobInputs, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any + self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Is one of the following types: - OptimizationJobInputs, JSON, IO[bytes] Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs or JSON or IO[bytes] + :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] :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 @@ -8141,10 +8107,10 @@ def create_optimization_job( content_type = content_type or "application/json" _content = None - if isinstance(inputs, (IOBase, bytes)): - _content = inputs + if isinstance(job, (IOBase, bytes)): + _content = job else: - _content = json.dumps(inputs, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_agents_create_optimization_job_request( operation_id=operation_id, @@ -8198,7 +8164,7 @@ def create_optimization_job( def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: """Get info about an agent optimization job. - Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + Get an optimization job by id. :param job_id: The ID of the job. Required. :type job_id: str @@ -8238,7 +8204,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -8274,7 +8240,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.OptimizationJob"]: + ) -> ItemPaged["_models.OptimizationJobListItem"]: """Returns a list of agent optimization jobs. List optimization jobs. Supports cursor pagination and optional status / agent_name filters. @@ -8298,14 +8264,14 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJob - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJob] + :return: An iterator like instance of OptimizationJobListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8337,7 +8303,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJob], + List[_models.OptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -8363,460 +8329,19 @@ def get_next(_continuation_token=None): return pipeline_response - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: - """Cancels an agent optimization job. - - Request cancellation. Idempotent on terminal states. - - :param job_id: The ID of the job to cancel. Required. - :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - - _request = build_beta_agents_cancel_optimization_job_request( - job_id=job_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_optimization_job( # pylint: disable=inconsistent-return-statements - self, job_id: str, *, force: Optional[bool] = None, **kwargs: Any - ) -> None: - """Deletes an agent optimization job. - - Delete the job and its candidate artifacts. Cancels first if non-terminal. - - :param job_id: The ID of the job to delete. Required. - :type job_id: str - :keyword force: When true, force-delete even if the job is in a non-terminal state. Default - value is None. - :paramtype force: bool - :return: None - :rtype: None - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_beta_agents_delete_optimization_job_request( - job_id=job_id, - force=force, - api_version=self._config.api_version, - 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) - - _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 [204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) - - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: - """Get a candidate file. + def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + """Cancels an agent optimization job. - Stream a specific file from the candidate's blob directory. + Request cancellation of a running or queued job. Returns an error if the job is already in a + terminal state. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to cancel. Required. :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8830,12 +8355,10 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - _request = build_beta_agents_get_candidate_file_request( + _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8846,7 +8369,7 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -8866,122 +8389,28 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa ) raise HttpResponseError(response=response, model=error) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. + def delete_optimization_job( # pylint: disable=inconsistent-return-statements + self, job_id: str, **kwargs: Any + ) -> None: + """Deletes an agent optimization job. - Promotes a candidate, recording the deployment timestamp and target agent version. + Delete the job and its candidate artifacts. Cancels first if non-terminal. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to delete. Required. :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8992,25 +8421,14 @@ def promote_candidate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agents_promote_candidate_request( + _request = build_beta_agents_delete_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9019,20 +8437,14 @@ def promote_candidate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -9040,15 +8452,8 @@ def promote_candidate( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore class BetaEvaluationTaxonomiesOperations: @@ -9070,7 +8475,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: - """Get an evaluation run by name. + """Get an evaluation taxonomy. + + Retrieves the specified evaluation taxonomy. :param name: The name of the resource. Required. :type name: str @@ -9135,6 +8542,9 @@ def list( ) -> ItemPaged["_models.EvaluationTaxonomy"]: """List evaluation taxonomies. + Returns the evaluation taxonomies available in the project, optionally filtered by input name + or input type. + :keyword input_name: Filter by the evaluation input name. Default value is None. :paramtype input_name: str :keyword input_type: Filter by taxonomy input type. Default value is None. @@ -9227,7 +8637,9 @@ def get_next(next_link=None): @distributed_trace def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an evaluation taxonomy by name. + """Delete an evaluation taxonomy. + + Removes the specified evaluation taxonomy from the project. :param name: The name of the resource. Required. :type name: str @@ -9279,6 +8691,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9297,6 +8711,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9315,6 +8731,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9333,6 +8751,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -9409,6 +8829,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9427,6 +8849,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9445,6 +8869,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9463,6 +8889,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -9560,7 +8988,9 @@ def list_versions( limit: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. + """List evaluator versions. + + Returns the available versions for the specified evaluator. :param name: The name of the resource. Required. :type name: str @@ -9666,7 +9096,9 @@ def list( limit: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + """List latest evaluator versions. + + Lists the latest version of each evaluator. :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default @@ -9763,8 +9195,9 @@ def get_next(next_link=None): @distributed_trace def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + """Get an evaluator version. + + Retrieves the specified evaluator version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -9830,8 +9263,9 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Evaluat def delete_version( # pylint: disable=inconsistent-return-statements self, name: str, version: str, **kwargs: Any ) -> None: - """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. + """Delete an evaluator version. + + Removes the specified evaluator version. Returns 204 whether the version existed or not. :param name: The name of the resource. Required. :type name: str @@ -9889,7 +9323,9 @@ def create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9907,7 +9343,9 @@ def create_version( def create_version( self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9925,7 +9363,9 @@ def create_version( def create_version( self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9943,7 +9383,9 @@ def create_version( def create_version( self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -10025,7 +9467,9 @@ def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10045,7 +9489,9 @@ def update_version( def update_version( self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10071,7 +9517,9 @@ def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10095,7 +9543,9 @@ def update_version( evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10180,7 +9630,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10206,7 +9659,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10232,7 +9688,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10256,7 +9715,10 @@ def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10346,7 +9808,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10372,7 +9837,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10398,7 +9866,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10422,7 +9893,10 @@ def get_credentials( credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10511,7 +9985,7 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10533,7 +10007,7 @@ def create_generation_job( def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10560,7 +10034,7 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10586,7 +10060,7 @@ def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10672,7 +10146,7 @@ def create_generation_job( @distributed_trace def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Get info about an evaluator generation job. + """Get an evaluator generation job. Gets the details of an evaluator generation job by its ID. @@ -10749,9 +10223,11 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorGenerationJob"]: - """Returns a list of evaluator generation jobs. + """List evaluator generation jobs. - Returns a list of evaluator generation jobs. + Returns a list of evaluator generation jobs. The List API has up to a few seconds of + propagation delay, so a recently created job may not appear immediately; use the Get evaluator + generation job API with the job ID to retrieve a specific job without delay. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -10834,7 +10310,7 @@ def get_next(_continuation_token=None): @distributed_trace def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Cancels an evaluator generation job. + """Cancel an evaluator generation job. Cancels an evaluator generation job by its ID. @@ -10903,7 +10379,9 @@ def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Evaluator def delete_generation_job( # pylint: disable=inconsistent-return-statements self, job_id: str, **kwargs: Any ) -> None: - """Deletes an evaluator generation job by its ID. Deletes the job record only; the generated + """Delete an evaluator generation job. + + Deletes an evaluator generation job by its ID. Deletes the job record only; the generated evaluator (if any) is preserved. :param job_id: The ID of the job to delete. Required. @@ -10976,7 +10454,9 @@ def __init__(self, *args, **kwargs) -> None: def generate( self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -10991,7 +10471,9 @@ def generate( @overload def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -11006,7 +10488,9 @@ def generate(self, insight: JSON, *, content_type: str = "application/json", **k @overload def generate(self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -11021,7 +10505,9 @@ 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: - """Generate Insights. + """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. @@ -11096,7 +10582,9 @@ def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: A @distributed_trace def get(self, insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: - """Get a specific insight by Id. + """Get an insight. + + Retrieves the specified insight report and its results. :param insight_id: The unique identifier for the insights report. Required. :type insight_id: str @@ -11174,7 +10662,9 @@ def list( include_coordinates: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + """List insights. + + Returns insights in reverse chronological order, with the most recent entries first. :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". Default value is None. @@ -11312,6 +10802,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -11335,6 +10827,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11351,6 +10845,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -11374,6 +10870,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + 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] :keyword name: The name of the memory store. Required. @@ -11472,6 +10970,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11493,6 +10993,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -11511,6 +11013,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -11535,6 +11039,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :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. @@ -11618,7 +11124,9 @@ def update( @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + """Get a memory store. + + Retrieves the specified memory store and its current configuration. :param name: The name of the memory store to retrieve. Required. :type name: str @@ -11690,7 +11198,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + """List memory stores. + + Returns the memory stores available to the caller. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -11775,6 +11285,8 @@ def get_next(_continuation_token=None): def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: """Delete a memory store. + Deletes the specified memory store. + :param name: The name of the memory store to delete. Required. :type name: str :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping @@ -11869,7 +11381,9 @@ def _search_memories( options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + """Search memories. + + Searches the specified memory store for memories relevant to the provided conversation context. :param name: The name of the memory store to search. Required. :type name: str @@ -12077,7 +11591,10 @@ def _begin_update_memories( update_delay: Optional[int] = None, **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + """Update memories. + + Starts an update that writes conversation memories into the specified memory store. The + operation returns a long-running status location for polling the update result. :param name: The name of the memory store to update. Required. :type name: str @@ -12167,7 +11684,9 @@ def get_long_running_output(pipeline_response): def delete_scope( self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12187,7 +11706,9 @@ def delete_scope( def delete_scope( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12206,7 +11727,9 @@ def delete_scope( def delete_scope( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12225,7 +11748,9 @@ def delete_scope( def delete_scope( self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12320,7 +11845,9 @@ def create_memory( content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12344,7 +11871,9 @@ def create_memory( def create_memory( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12362,7 +11891,9 @@ def create_memory( def create_memory( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12387,7 +11918,9 @@ def create_memory( kind: Union[str, _models.MemoryItemKind] = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12483,7 +12016,9 @@ def create_memory( def update_memory( self, name: str, memory_id: str, *, content: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12503,7 +12038,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12523,7 +12060,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12543,7 +12082,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12630,7 +12171,9 @@ def update_memory( @distributed_trace def get_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.MemoryItem: - """Retrieve a memory item from a memory store. + """Get a memory item. + + Retrieves the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12709,7 +12252,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12754,7 +12299,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12798,7 +12345,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12842,7 +12391,9 @@ def list_memories( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12959,7 +12510,9 @@ def get_next(_continuation_token=None): @distributed_trace def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: - """Delete a memory item from a memory store. + """Delete a memory item. + + Deletes the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -13045,7 +12598,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.ModelVersion"]: - """List all versions of the given ModelVersion. + """List versions. + + List all versions of the given ModelVersion. :param name: The name of the resource. Required. :type name: str @@ -13136,7 +12691,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.ModelVersion"]: - """List the latest version of each ModelVersion. + """List latest versions. + + List the latest version of each ModelVersion. :return: An iterator like instance of ModelVersion :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ModelVersion] @@ -13224,8 +12781,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: - """Get the specific version of the ModelVersion. The service returns 404 Not Found error if the - ModelVersion does not exist. + """Get a model version. + + Retrieves the specified model version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -13289,7 +12847,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion + """Delete a model version. + + Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. :param name: The name of the resource. Required. @@ -13349,7 +12909,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13376,7 +12938,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13403,7 +12967,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13428,7 +12994,9 @@ def update( model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13515,8 +13083,10 @@ def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13536,8 +13106,10 @@ def pending_create_version( def pending_create_version( self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13563,8 +13135,10 @@ def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13584,8 +13158,10 @@ def pending_create_version( def pending_create_version( self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13673,7 +13249,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13700,7 +13278,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13727,7 +13307,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13752,7 +13334,9 @@ def pending_upload( pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13839,7 +13423,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13865,7 +13451,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13891,7 +13479,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13915,7 +13505,9 @@ def get_credentials( credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -14010,7 +13602,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.RedTeam: - """Get a redteam by name. + """Get a redteam. + + Retrieves the specified redteam and its configuration. :param name: Identifier of the red team run. Required. :type name: str @@ -14071,7 +13665,9 @@ def get(self, name: str, **kwargs: Any) -> _models.RedTeam: @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.RedTeam"]: - """List a redteam by name. + """List redteams. + + Returns the redteams available in the current project. :return: An iterator like instance of RedTeam :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RedTeam] @@ -14161,7 +13757,9 @@ def get_next(next_link=None): def create( self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: ~azure.ai.projects.models.RedTeam @@ -14175,7 +13773,9 @@ def create( @overload def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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 @@ -14189,7 +13789,9 @@ def create(self, red_team: JSON, *, content_type: str = "application/json", **kw @overload def create(self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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: IO[bytes] @@ -14203,7 +13805,9 @@ 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: - """Creates a redteam run. + """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. @@ -14308,6 +13912,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -14333,6 +13939,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14351,6 +13959,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14377,6 +13987,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :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. @@ -14464,7 +14076,9 @@ def create_or_update( @distributed_trace def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: - """Retrieve a routine. + """Get a routine. + + Retrieves the specified routine and its current configuration. :param routine_name: The unique name of the routine. Required. :type routine_name: str @@ -14531,6 +14145,8 @@ def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Enable a routine. + Enables the specified routine so it can be dispatched. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -14596,6 +14212,8 @@ def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Disable a routine. + Disables the specified routine so it no longer runs. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -14663,6 +14281,8 @@ def list( ) -> ItemPaged["_models.Routine"]: """List routines. + Returns the routines available in the current project. + :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int :keyword before: Unsupported. Reserved for future backward pagination support. Default value is @@ -14740,6 +14360,8 @@ def get_next(_continuation_token=None): def delete(self, routine_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a routine. + Deletes the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: None @@ -14801,6 +14423,8 @@ def list_runs( ) -> ItemPaged["_models.RoutineRun"]: """List prior runs for a routine. + Returns prior runs recorded for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword filter: An optional MLflow search-runs filter expression applied within the routine's @@ -14892,6 +14516,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -14911,6 +14537,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14929,6 +14557,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14952,6 +14582,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :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. @@ -15053,6 +14685,8 @@ def __init__(self, *args, **kwargs) -> None: def delete(self, schedule_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a schedule. + Deletes the specified schedule resource. + :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :return: None @@ -15099,7 +14733,9 @@ def delete(self, schedule_id: str, **kwargs: Any) -> None: # pylint: disable=in @distributed_trace def get(self, schedule_id: str, **kwargs: Any) -> _models.Schedule: - """Get a schedule by id. + """Get a schedule. + + Retrieves the specified schedule resource. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15166,7 +14802,9 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Schedule"]: - """List all schedules. + """List schedules. + + Returns schedules that match the supplied type and enabled filters. :keyword type: Filter by the type of schedule. Known values are: "Evaluation" and "Insight". Default value is None. @@ -15263,7 +14901,9 @@ def get_next(next_link=None): def create_or_update( self, schedule_id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15281,7 +14921,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15299,7 +14941,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15317,7 +14961,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15391,7 +15037,9 @@ def create_or_update( @distributed_trace def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: - """Get a schedule run by id. + """Get a schedule run. + + Retrieves the specified run for a schedule. :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str @@ -15466,7 +15114,9 @@ def list_runs( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.ScheduleRun"]: - """List all schedule runs. + """List schedule runs. + + Returns schedule runs that match the supplied filters. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15593,7 +15243,9 @@ def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15623,7 +15275,9 @@ def create_version( def create_version( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15642,7 +15296,9 @@ def create_version( def create_version( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15670,7 +15326,9 @@ def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15774,6 +15432,8 @@ def create_version( def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: """Retrieve a toolbox. + Retrieves the specified toolbox and its current configuration. + :param name: The name of the toolbox to retrieve. Required. :type name: str :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping @@ -15844,7 +15504,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.ToolboxObject"]: - """List all toolboxes. + """List toolboxes. + + Returns the toolboxes available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -15935,7 +15597,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.ToolboxVersionObject"]: - """List all versions of a toolbox. + """List toolbox versions. + + Returns the available versions for the specified toolbox. :param name: The name of the toolbox to list versions for. Required. :type name: str @@ -16023,6 +15687,8 @@ def get_next(_continuation_token=None): def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: """Retrieve a specific version of a toolbox. + Retrieves the specified version of a toolbox by name and version identifier. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -16093,6 +15759,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :keyword default_version: The version identifier that the toolbox should point to. When set, @@ -16112,6 +15780,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -16130,6 +15800,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -16148,6 +15820,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :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. @@ -16231,7 +15905,9 @@ def update( @distributed_trace def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a toolbox and all its versions. + """Delete a toolbox. + + Removes the specified toolbox along with all of its versions. :param name: The name of the toolbox to delete. Required. :type name: str @@ -16287,6 +15963,8 @@ def delete_version( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a specific version of a toolbox. + Removes the specified version of a toolbox. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to delete. Required. @@ -16358,7 +16036,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.SkillDetails: - """Retrieves a skill. + """Retrieve a skill. + + Retrieves the specified skill and its current configuration. :param name: The unique name of the skill. Required. :type name: str @@ -16430,7 +16110,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SkillDetails"]: - """Returns the list of all skills. + """List skills. + + Returns the skills available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -16517,6 +16199,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :keyword default_version: The version identifier that the skill should point to. When set, the @@ -16536,6 +16220,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -16554,6 +16240,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -16572,6 +16260,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :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. @@ -16655,7 +16345,9 @@ def update( @distributed_trace def delete(self, name: str, **kwargs: Any) -> _models.DeleteSkillResult: - """Deletes a skill. + """Delete a skill. + + Removes the specified skill and its associated versions. :param name: The unique name of the skill. Required. :type name: str @@ -16728,7 +16420,9 @@ def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16749,7 +16443,9 @@ def create( def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16767,7 +16463,9 @@ def create( def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16791,7 +16489,9 @@ def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16878,7 +16578,9 @@ def create( def create_from_files( self, name: str, content: _models.CreateSkillVersionFromFilesBody, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16891,7 +16593,9 @@ def create_from_files( @overload def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16906,7 +16610,9 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. def create_from_files( self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16987,7 +16693,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SkillVersion"]: - """List all versions of a skill. + """List skill versions. + + Returns the available versions for the specified skill. :param name: The name of the skill to list versions for. Required. :type name: str @@ -17075,6 +16783,8 @@ def get_next(_continuation_token=None): def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVersion: """Retrieve a specific version of a skill. + Retrieves the specified version of a skill by name and version identifier. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -17143,6 +16853,8 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVe def download(self, name: str, **kwargs: Any) -> Iterator[bytes]: """Download the zip content for the default version of a skill. + Downloads the zip content for the default version of a skill. + :param name: The name of the skill. Required. :type name: str :return: Iterator[bytes] @@ -17208,6 +16920,8 @@ def download(self, name: str, **kwargs: Any) -> Iterator[bytes]: def download_version(self, name: str, version: str, **kwargs: Any) -> Iterator[bytes]: """Download the zip content for a specific version of a skill. + Downloads the zip content for a specific version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version to download content for. Required. @@ -17276,6 +16990,8 @@ def download_version(self, name: str, version: str, **kwargs: Any) -> Iterator[b def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.DeleteSkillVersionResult: """Delete a specific version of a skill. + Removes the specified version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to delete. Required. @@ -17361,9 +17077,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Get info about a data generation job. + """Get a data generation job. - Gets the details of a data generation job by its ID. + Retrieves the specified data generation job and its current status. :param job_id: The ID of the job. Required. :type job_id: str @@ -17438,7 +17154,7 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.DataGenerationJob"]: - """Returns a list of data generation jobs. + """List data generation jobs. Returns a list of data generation jobs. @@ -17530,9 +17246,9 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: ~azure.ai.projects.models.DataGenerationJob @@ -17551,9 +17267,9 @@ def create_generation_job( def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: JSON @@ -17577,9 +17293,9 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: IO[bytes] @@ -17602,9 +17318,9 @@ def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates 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. @@ -17687,9 +17403,9 @@ def create_generation_job( @distributed_trace def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Cancels a data generation job. + """Cancel a data generation job. - Cancels a data generation job by its ID. + Cancels the specified data generation job if it is still in progress. :param job_id: The ID of the job to cancel. Required. :type job_id: str @@ -17756,9 +17472,9 @@ def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGener def delete_generation_job( # pylint: disable=inconsistent-return-statements self, job_id: str, **kwargs: Any ) -> None: - """Deletes a data generation job. + """Delete a data generation job. - Deletes a data generation job by its ID. + Removes the specified data generation job and its associated output. :param job_id: The ID of the job to delete. Required. :type job_id: str diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 029f54360f28..1001de9c2f8e 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -70,24 +70,8 @@ REM Fix Sphinx docutils warnings in get_session_log_stream docstrings (sync + as REM The emitter wraps bullet/code-block lines with insufficient indentation. powershell -Command "$files='azure\ai\projects\operations\_operations.py','azure\ai\projects\aio\operations\_operations.py'; foreach ($f in $files) { $c=Get-Content $f -Raw; $c=$c -replace 'schema\r?\n\s+is not contractual and may include additional keys or change format\r?\n\s+over time [^\r\n]*clients should treat it as an opaque string\)', 'schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string)'; $c=$c -replace '(message\":\"Starting)\r?\n\s+(FoundryCBAgent server on port 8088\"})', '$1 $2'; $c=$c -replace '(message\":\"INFO: Application)\r?\n\s+(startup complete\.\"})', '$1 $2'; $c=$c -replace '(message\":\"Successfully)\r?\n\s+(connected to container\"})', '$1 $2'; $c=$c -replace '(message\":\"No logs since)\r?\n\s+(last 60 seconds\"})', '$1 $2'; Set-Content $f $c -NoNewline }" -REM Reorder loops in `prepare_multipart_form_data` and synthesize filenames for -REM bare bytes/str/IO file entries (azure\ai\projects\_utils\utils.py). -REM 1) The emitter generates the multipart-file loop before the data-field loop, -REM so JSON metadata parts end up after large binary file parts in the encoded -REM body. Some streaming server-side parsers (e.g. the Foundry hosted-agents -REM `create_agent_version_from_code` endpoint) require the small JSON metadata -REM parts to precede the binary file parts; otherwise they report the metadata -REM part as missing. -REM 2) When callers pass bare bytes (e.g. `Path("x.zip").read_bytes()`) for a -REM multipart file field, the part is emitted without a `filename=` in its -REM Content-Disposition, and servers (e.g. Foundry `create_from_files` for -REM skills) reject it with "At least one file must be uploaded". This rewrite -REM synthesizes a filename for bare bytes/str/IO entries (from `.name` when -REM available, otherwise a stable default) so the part is encoded as a file. -powershell -Command "$f='azure\ai\projects\_utils\utils.py'; $c=Get-Content $f -Raw; if ($c -notmatch '(?m)^import os\r?$') { $c=$c -replace '(?m)^import json\r?$', \"import json`r`nimport os\" }; if ($c -notmatch ':param field_name: The multipart form field name') { $c=$c -replace '(?s)def _normalize_multipart_file_entry\(.*?return \(filename, entry\)\r?\n\r?\n\r?\n', ''; $helper=(@('def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any:',' \"\"\"Ensure each multipart file entry carries a filename so that it is encoded',' as a file part (with ``filename=``) rather than a plain form field.','',' Servers commonly distinguish multipart file parts from form-data parts by',' the presence of ``filename=`` in the part''s ``Content-Disposition`` header.',' When callers pass bare bytes / str / IO objects (e.g.',' ``Path(\"x.zip\").read_bytes()``), the underlying HTTP client emits the part',' without a filename, which several Foundry endpoints reject with errors like',' \"At least one file must be uploaded\". This helper synthesizes a filename',' from the IO object''s ``name`` attribute when available, otherwise falls',' back to a stable default.','',' :param field_name: The multipart form field name, used as a fallback filename.',' :type field_name: str',' :param entry: The file entry to normalize. May be a tuple, bytes, str, or IO object.',' :type entry: any',' :param index: Position of the entry within its field''s list, used to disambiguate fallback filenames.',' :type index: int',' :return: A ``(filename, entry)`` tuple if ``entry`` was not already a tuple, otherwise ``entry`` unchanged.',' :rtype: any',' \"\"\"',' if isinstance(entry, tuple):',' return entry',' filename: Optional[str] = None',' name_attr = getattr(entry, \"name\", None)',' if isinstance(name_attr, str) and name_attr:',' filename = os.path.basename(name_attr)',' if not filename:',' filename = f\"{field_name}_{index}\" if index else field_name',' return (filename, entry)','','') -join [Environment]::NewLine); $c=$c -replace '(?m)^def prepare_multipart_form_data\(', ($helper + 'def prepare_multipart_form_data('); $pattern='(?s) files: list\[FileType\] = \[\]\r?\n.*? return files'; $new=(@(' files: list[FileType] = []','',' # Append data fields first so they appear before file parts in the encoded',' # multipart body. Some streaming server-side parsers (e.g. the Foundry',' # hosted-agents `create_agent_version_from_code` endpoint) require small',' # JSON metadata parts to precede large binary file parts; otherwise they',' # report the metadata part as missing.',' for data_field in data_fields:',' data_entry = body.get(data_field)',' if data_entry:',' files.append((data_field, str(serialize_multipart_data_entry(data_entry))))','',' for multipart_field in multipart_fields:',' multipart_entry = body.get(multipart_field)',' if isinstance(multipart_entry, list):',' for idx, e in enumerate(multipart_entry):',' files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx)))',' elif multipart_entry:',' files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0)))','',' return files') -join [Environment]::NewLine); $c=[regex]::Replace($c, $pattern, $new) }; Set-Content $f $c -NoNewline" - REM Finishing by running 'black' tool to format code. pip install black -black --config ../../../eng/black-pyproject.toml . || echo black not found, skipping formatting. +black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 70c218bc1e47..8aaa0adc7fcc 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -46,7 +46,7 @@ "toolboxes": "Toolboxes=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", - "agents": "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V1Preview", + "agents": "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V2Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -84,7 +84,7 @@ # The test id is derived automatically from method_name. pytest.param( "agents.create_version", - "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V1Preview", + "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V2Preview", ), pytest.param( "evaluation_rules.create_or_update", diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index fba1c89d1f07..85be5b4de248 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -23,7 +23,7 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/red-teams - specification/ai-foundry/data-plane/Foundry/src/routines - specification/ai-foundry/data-plane/Foundry/src/schedules - - specification/ai-foundry/data-plane/Foundry/src/servicepatterns.tsp + - specification/ai-foundry/data-plane/Foundry/src/sdk-common - specification/ai-foundry/data-plane/Foundry/src/skills - specification/ai-foundry/data-plane/Foundry/src/toolboxes - specification/ai-foundry/data-plane/Foundry/src/tools \ No newline at end of file From c7a9cd713ee8ae84f2e606cb19b373373a5ff957 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:58:39 -0700 Subject: [PATCH 14/40] Update change log and subclient report --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + sdk/ai/azure-ai-projects/docs/subclients.md | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index b5d5a54cfaaa..f2f0df63cdd1 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -5,6 +5,7 @@ ### Breaking Changes Breaking changes in beta methods: +* Agent Optimization methods `.beta.agents.*optimization*` were re-written. Updated from v1 to v2 preview, focusing on cleanup to better align with Foundry job guidelines and platform standards. The v1 surface accumulated unused candidate sub-resources, internal-detail properties, and custom operation patterns inconsistent with the Foundry platform. The v2 API removes redundant models and operations, adopts shared Foundry job patterns (`JobLike<>`, standard job verbs), and introduces typed discriminated unions for dataset inputs and evaluator references. * Method `.beta.agents.list_optimization_candidates` now returns `ItemPaged[OptimizationCandidate]` instead of `AgentsPagedResultOptimizationCandidate`. The `after` parameter has been removed (use continuation-token-based paging instead). ### Sample updates diff --git a/sdk/ai/azure-ai-projects/docs/subclients.md b/sdk/ai/azure-ai-projects/docs/subclients.md index 538c79bea5e4..e6e1523ad1e2 100644 --- a/sdk/ai/azure-ai-projects/docs/subclients.md +++ b/sdk/ai/azure-ai-projects/docs/subclients.md @@ -4,7 +4,7 @@ This document lists all sub-clients available on `AIProjectClient` and their pub ## Summary -There are a total of 140 unique public methods across all sub-clients. +There are a total of 134 unique public methods across all sub-clients. ### Top-level Sub-clients (stable operations) @@ -22,7 +22,7 @@ There are a total of 140 unique public methods across all sub-clients. | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `beta.agents` | BetaAgentsOperations | 24 | +| `beta.agents` | BetaAgentsOperations | 18 | | `beta.datasets` | BetaDatasetsOperations | 5 | | `beta.evaluation_taxonomies` | BetaEvaluationTaxonomiesOperations | 5 | | `beta.evaluators` | BetaEvaluatorsOperations | 13 | @@ -89,19 +89,13 @@ Alphabetically sorted, with ".beta" sub-client at the end. If the method is a ne .beta.agents.delete_session_file .beta.agents.download_code .beta.agents.download_session_file -.beta.agents.get_candidate_file -.beta.agents.get_optimization_candidate -.beta.agents.get_optimization_candidate_config -.beta.agents.get_optimization_candidate_results .beta.agents.get_optimization_job .beta.agents.get_session .beta.agents.get_session_log_stream -.beta.agents.list_optimization_candidates .beta.agents.list_optimization_jobs .beta.agents.list_session_files .beta.agents.list_sessions .beta.agents.patch_agent_details -.beta.agents.promote_candidate .beta.agents.stop_session .beta.agents.upload_session_file* @@ -150,12 +144,12 @@ Alphabetically sorted, with ".beta" sub-client at the end. If the method is a ne .beta.memory_stores.update_memory .beta.models.create* -.beta.models.pending_create_version .beta.models.delete .beta.models.get .beta.models.get_credentials .beta.models.list .beta.models.list_versions +.beta.models.pending_create_version .beta.models.pending_upload .beta.models.update From b0c69f49c011876144620a2eed3e45af62457ae5 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:46:42 -0700 Subject: [PATCH 15/40] Remove changelog update step from emitter skill --- .../SKILL.md | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md index 190df28bcbd0..a64f2072daa8 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-emit-from-typespec/SKILL.md @@ -174,18 +174,7 @@ In the folder `sdk\ai\azure-ai-projects`, run `pip install -e .` to install the --- -## Step 12: Update CHANGELOG.md - -Use the **`azsdk-common-generate-sdk-locally`** skill's changelog capability (`azsdk_package_update_changelog_content`) to update `CHANGELOG.md` in the `sdk/ai/azure-ai-projects` folder with a summary of changes from the TypeSpec emit. Some guidelines to follow: -* Start by examining the public SDK API surface of the latest released version of the azure-ai-projects package. The source code for this version can be found in the Main branch of the `azure-sdk-for-python` repository, in the folder `sdk\ai\azure-ai-projects`. -* Then compare it to the public SDK API surface of current version in this topic branch. -* Look at the existing change log from the latest version (if exists) and edit or add to it to capture all the changes you see. If a change log does not exist for the current version at the top of `CHANGELOG.md`, create a new one. -* If a new method was added, there is no need to add the list of all new classes that define the inputs and output of the method. It's enough to mention that the new method was added. -* Show the user the proposed changelog entry and ask for confirmation or edits before saving. - ---- - -## Step 13: Commit and push +## Step 12: Commit and push Stage all changes (excluding file names that start with `.env`), commit, and push the topic branch: @@ -199,7 +188,7 @@ git push -u origin --- -## Step 14: Create a Pull Request +## Step 13: Create a Pull Request Create a draft PR from the **topic branch** to the **base branch** (recorded in Step 2): @@ -216,7 +205,7 @@ Open a new tab in the default browser and navigate to the PR URL. --- -## Step 15: Optionally run tests locally +## Step 14: Optionally run tests locally Prompt the user with this message: "Tests will run as part of the Pull Request. However, you can optionally run tests locally in a Python virtual environment, right now. It will take a few minutes. Do you want to run tests locally? (yes/no)" From 696c71904add0b851ecfdac38ff504f4ce9ac6a9 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:53:27 -0700 Subject: [PATCH 16/40] restore tsp-location.yaml --- .../{tsp-location.yaml.saved => tsp-location.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sdk/ai/azure-ai-projects/{tsp-location.yaml.saved => tsp-location.yaml} (100%) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.saved b/sdk/ai/azure-ai-projects/tsp-location.yaml similarity index 100% rename from sdk/ai/azure-ai-projects/tsp-location.yaml.saved rename to sdk/ai/azure-ai-projects/tsp-location.yaml From b19ddad8e03397f54e908069f576659fe1ab7f92 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:34:26 -0700 Subject: [PATCH 17/40] [azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294) --- .../azure-ai-projects/apiview-properties.json | 3 +- .../ai/projects/aio/operations/_operations.py | 106 +++++++++--------- .../azure/ai/projects/models/__init__.py | 2 - .../azure/ai/projects/models/_models.py | 51 +-------- .../ai/projects/operations/_operations.py | 101 ++++++++--------- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 6 files changed, 104 insertions(+), 161 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 9aebac269df8..84e5808339c6 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -24,7 +24,6 @@ "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", - "azure.ai.projects.models.AgentsPagedResultOptimizationCandidate": "Azure.AI.Projects.AgentsPagedResult", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", @@ -475,5 +474,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "c44eac94eea1" + "CrossLanguageVersion": "3ae42dbde611" } \ No newline at end of file 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 118e80092cf3..5104a3473fa8 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 @@ -4889,17 +4889,16 @@ async def delete_optimization_job(self, job_id: str, *, force: Optional[bool] = if cls: return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace_async - async def list_optimization_candidates( + @distributed_trace + def list_optimization_candidates( self, job_id: str, *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultOptimizationCandidate: + ) -> AsyncItemPaged["_models.OptimizationCandidate"]: """Returns a list of candidates for an optimization job. List candidates produced by a job. @@ -4914,23 +4913,22 @@ async def list_optimization_candidates( ascending order and``desc`` for descending order. Known values are: "asc" and "desc". Default value is None. :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword after: A cursor for use in pagination. ``after`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :return: AgentsPagedResultOptimizationCandidate. The AgentsPagedResultOptimizationCandidate is - compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultOptimizationCandidate + :return: An iterator like instance of OptimizationCandidate + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4939,56 +4937,54 @@ async def list_optimization_candidates( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultOptimizationCandidate] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=after, - before=before, - api_version=self._config.api_version, - 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) + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request - _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 - ) + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - if response.status_code not in [200]: - 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, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentsPagedResultOptimizationCandidate, response.json()) + if response.status_code not in [200]: + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async async def get_optimization_candidate( 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 29197fc4bbad..20c92f03d969 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 @@ -34,7 +34,6 @@ AgentTaxonomyInput, AgentVersionDetails, AgenticIdentityPreviewCredentials, - AgentsPagedResultOptimizationCandidate, ApiError, ApiErrorResponse, ApiKeyCredentials, @@ -462,7 +461,6 @@ "AgentTaxonomyInput", "AgentVersionDetails", "AgenticIdentityPreviewCredentials", - "AgentsPagedResultOptimizationCandidate", "ApiError", "ApiErrorResponse", "ApiKeyCredentials", 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 308e0e1be187..40f17df60f48 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 @@ -1013,51 +1013,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentsPagedResultOptimizationCandidate(_Model): - """The response data for a requested list of items. - - :ivar data: The requested list of items. Required. - :vartype data: list[~azure.ai.projects.models.OptimizationCandidate] - :ivar first_id: The first ID represented in this list. - :vartype first_id: str - :ivar last_id: The last ID represented in this list. - :vartype last_id: str - :ivar has_more: A value indicating whether there are additional values available not captured - in this list. Required. - :vartype has_more: bool - """ - - data: list["_models.OptimizationCandidate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The requested list of items. Required.""" - first_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The first ID represented in this list.""" - last_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The last ID represented in this list.""" - has_more: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A value indicating whether there are additional values available not captured in this list. - Required.""" - - @overload - def __init__( - self, - *, - data: list["_models.OptimizationCandidate"], - has_more: bool, - first_id: Optional[str] = None, - last_id: 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 EvaluationTaxonomyInput(_Model): """Input configuration for the evaluation taxonomy. @@ -6422,14 +6377,14 @@ class EvaluationScheduleTask(ScheduleTask, discriminator="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: any + :vartype eval_run: dict[str, any] """ type: Literal[ScheduleTaskType.EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. Evaluation task.""" eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) """Identifier of the evaluation group. Required.""" - eval_run: Any = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) + eval_run: dict[str, Any] = rest_field(name="evalRun", visibility=["read", "create", "update", "delete", "query"]) """The evaluation run payload. Required.""" @overload @@ -6437,7 +6392,7 @@ def __init__( self, *, eval_id: str, - eval_run: Any, + eval_run: dict[str, Any], configuration: Optional[dict[str, str]] = None, ) -> None: ... 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 2ae3231aea70..e75ce4c9d73f 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 @@ -8499,10 +8499,9 @@ def list_optimization_candidates( *, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultOptimizationCandidate: + ) -> ItemPaged["_models.OptimizationCandidate"]: """Returns a list of candidates for an optimization job. List candidates produced by a job. @@ -8517,23 +8516,21 @@ def list_optimization_candidates( ascending order and``desc`` for descending order. Known values are: "asc" and "desc". Default value is None. :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword after: A cursor for use in pagination. ``after`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None. :paramtype before: str - :return: AgentsPagedResultOptimizationCandidate. The AgentsPagedResultOptimizationCandidate is - compatible with MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultOptimizationCandidate + :return: An iterator like instance of OptimizationCandidate + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8542,56 +8539,54 @@ def list_optimization_candidates( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultOptimizationCandidate] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=after, - before=before, - api_version=self._config.api_version, - 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) + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request - _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 - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) - if response.status_code not in [200]: - 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, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentsPagedResultOptimizationCandidate, response.json()) + if response.status_code not in [200]: + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index ce66d3088118..b9bf529d1e4c 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai-foundry/data-plane/Foundry -commit: e041b5a178996b62fe86a267dc468df5c1677c54 +commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 repo: Azure/azure-rest-api-specs additionalDirectories: From 6521ec4b51b1beee735bf3085fdfec691dc2e642 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:25:21 -0700 Subject: [PATCH 18/40] [azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318) --- eng/emitter-package-lock.json | 37 ++ eng/emitter-package.json | 19 + .../azure-ai-projects/apiview-properties.json | 11 +- .../azure/ai/projects/models/__init__.py | 18 + .../azure/ai/projects/models/_enums.py | 28 ++ .../azure/ai/projects/models/_models.py | 367 ++++++++++++++++-- 6 files changed, 438 insertions(+), 42 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 8ada17490f1b..13834ca670d7 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,12 +9,21 @@ "@azure-tools/typespec-python": "0.63.1" }, "devDependencies": { +<<<<<<< HEAD "@azure-tools/openai-typespec": "1.20.0", "@azure-tools/typespec-autorest": "~0.69.0", "@azure-tools/typespec-azure-core": "~0.69.0", "@azure-tools/typespec-azure-resource-manager": "~0.69.0", "@azure-tools/typespec-azure-rulesets": "~0.69.0", "@azure-tools/typespec-client-generator-core": "~0.69.0", +======= + "@azure-tools/openai-typespec": "1.19.0", + "@azure-tools/typespec-autorest": "~0.68.0", + "@azure-tools/typespec-azure-core": "~0.68.0", + "@azure-tools/typespec-azure-resource-manager": "~0.68.0", + "@azure-tools/typespec-azure-rulesets": "~0.68.0", + "@azure-tools/typespec-client-generator-core": "~0.68.0", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@azure-tools/typespec-liftr-base": "0.14.0", "@typespec/compiler": "^1.13.0", "@typespec/events": "~0.83.0", @@ -30,9 +39,15 @@ } }, "node_modules/@azure-tools/openai-typespec": { +<<<<<<< HEAD "version": "1.20.0", "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", +======= + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", + "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "dev": true, "license": "MIT", "peerDependencies": { @@ -116,9 +131,15 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { +<<<<<<< HEAD "version": "0.69.0", "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.0.tgz", "integrity": "sha512-ro8zzOeiN/74r0wM19R77gzLtbfjIFgKgr1Rusii/vhCfJIoVC7IcqLxhbJl0RVkjyhRFKt4GCRAw4iurnrDnw==", +======= + "version": "0.68.4", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.68.4.tgz", + "integrity": "sha512-p32EXsrSC9giZUNdsQ2gmvDENFIEW2E0zto3FmjBZ3OeB5wCw1ZAZ+KnO0rsoKFovBvHSsQatNCKJvM/x89AgA==", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -958,9 +979,15 @@ } }, "node_modules/@scalar/helpers": { +<<<<<<< HEAD "version": "0.8.2", "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.2.tgz", "integrity": "sha512-qNbqUjSB3S4Gr4A0oANcm5G1Ip+EqBxICYKhe9YzmnaBpbmW6shxqpiivApTvvuDf+uIhR3uMwWyVQbYcGLsxA==", +======= + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.1.tgz", + "integrity": "sha512-yuiuBCadP5bjAnIv23QvifVN/NaMi9xBF6b8Wdk4QOzwzLPJmp699MAdf33J0A5i2qKcvnu32iz/VkEJmQRe5g==", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "dev": true, "license": "MIT", "engines": { @@ -968,6 +995,7 @@ } }, "node_modules/@scalar/json-magic": { +<<<<<<< HEAD "version": "0.12.16", "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.16.tgz", "integrity": "sha512-w8cDbZhHCzmIblWx92IVWoAXsbI4Fz3m++jiBANTSO1hgphF6UqEPQiCt3wnMPaxaanjMQxjS/iBk1UGXR2EGA==", @@ -975,6 +1003,15 @@ "license": "MIT", "dependencies": { "@scalar/helpers": "0.8.2", +======= + "version": "0.12.15", + "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.15.tgz", + "integrity": "sha512-ZYgdYZ0jSZXQeyhG2lJ20FjzvKsaDRXk4bPguF/Ytl2nGBh9a6RIIr9NvVy4zAD67a/ahm+xipXlfoR1KtB5fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@scalar/helpers": "0.8.1", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "pathe": "^2.0.3", "yaml": "^2.8.3" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 6d4440af96a1..304f366b05c1 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -4,6 +4,7 @@ "@azure-tools/typespec-python": "0.63.1" }, "devDependencies": { +<<<<<<< HEAD "@typespec/compiler": "^1.13.0", "@typespec/http": "^1.13.0", "@typespec/rest": "~0.83.0", @@ -21,6 +22,24 @@ "@azure-tools/typespec-azure-resource-manager": "~0.69.0", "@azure-tools/typespec-azure-rulesets": "~0.69.0", "@azure-tools/typespec-client-generator-core": "~0.69.0", +======= + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0", + "@typespec/rest": "~0.82.0", + "@typespec/versioning": "~0.82.0", + "@typespec/openapi": "^1.12.0", + "@typespec/events": "~0.82.0", + "@typespec/sse": "~0.82.0", + "@typespec/streams": "~0.82.0", + "@typespec/xml": "~0.82.0", + "@typespec/openapi3": "1.12.0", + "@azure-tools/openai-typespec": "1.19.0", + "@azure-tools/typespec-autorest": "~0.68.0", + "@azure-tools/typespec-azure-core": "~0.68.0", + "@azure-tools/typespec-azure-resource-manager": "~0.68.0", + "@azure-tools/typespec-azure-rulesets": "~0.68.0", + "@azure-tools/typespec-client-generator-core": "~0.68.0", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@azure-tools/typespec-liftr-base": "0.14.0" } } diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 84e5808339c6..2495388ba138 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -78,6 +78,7 @@ "azure.ai.projects.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", "azure.ai.projects.models.ComparisonFilter": "OpenAI.ComparisonFilter", "azure.ai.projects.models.CompoundFilter": "OpenAI.CompoundFilter", + "azure.ai.projects.models.ComputerTool": "OpenAI.ComputerTool", "azure.ai.projects.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", "azure.ai.projects.models.FunctionShellToolParamEnvironment": "OpenAI.FunctionShellToolParamEnvironment", @@ -131,6 +132,7 @@ "azure.ai.projects.models.Dimension": "Azure.AI.Projects.Dimension", "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", "azure.ai.projects.models.EntraAuthorizationScheme": "Azure.AI.Projects.EntraAuthorizationScheme", "azure.ai.projects.models.EntraIDCredentials": "Azure.AI.Projects.EntraIDCredentials", "azure.ai.projects.models.IsolationKeySource": "Azure.AI.Projects.IsolationKeySource", @@ -173,6 +175,7 @@ "azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam": "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam", "azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam": "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam", "azure.ai.projects.models.FunctionTool": "OpenAI.FunctionTool", + "azure.ai.projects.models.FunctionToolParam": "OpenAI.FunctionToolParam", "azure.ai.projects.models.GitHubIssueRoutineTrigger": "Azure.AI.Projects.GitHubIssueRoutineTrigger", "azure.ai.projects.models.HeaderIsolationKeySource": "Azure.AI.Projects.HeaderIsolationKeySource", "azure.ai.projects.models.TelemetryEndpointAuth": "Azure.AI.Projects.TelemetryEndpointAuth", @@ -228,6 +231,7 @@ "azure.ai.projects.models.ModelSourceData": "Azure.AI.Projects.ModelSourceData", "azure.ai.projects.models.ModelVersion": "Azure.AI.Projects.ModelVersion", "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", + "azure.ai.projects.models.NamespaceToolParam": "OpenAI.NamespaceToolParam", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", "azure.ai.projects.models.OneTimeTrigger": "Azure.AI.Projects.OneTimeTrigger", "azure.ai.projects.models.OpenApiAuthDetails": "Azure.AI.Projects.OpenApiAuthDetails", @@ -307,6 +311,8 @@ "azure.ai.projects.models.ToolboxVersionObject": "Azure.AI.Projects.ToolboxVersionObject", "azure.ai.projects.models.ToolChoiceAllowed": "OpenAI.ToolChoiceAllowed", "azure.ai.projects.models.ToolChoiceCodeInterpreter": "OpenAI.ToolChoiceCodeInterpreter", + "azure.ai.projects.models.ToolChoiceComputer": "OpenAI.ToolChoiceComputer", + "azure.ai.projects.models.ToolChoiceComputerUse": "OpenAI.ToolChoiceComputerUse", "azure.ai.projects.models.ToolChoiceComputerUsePreview": "OpenAI.ToolChoiceComputerUsePreview", "azure.ai.projects.models.ToolChoiceCustom": "OpenAI.ToolChoiceCustom", "azure.ai.projects.models.ToolChoiceFileSearch": "OpenAI.ToolChoiceFileSearch", @@ -318,6 +324,7 @@ "azure.ai.projects.models.ToolConfig": "Azure.AI.Projects.ToolConfig", "azure.ai.projects.models.ToolDescription": "Azure.AI.Projects.ToolDescription", "azure.ai.projects.models.ToolProjectConnection": "Azure.AI.Projects.ToolProjectConnection", + "azure.ai.projects.models.ToolSearchToolParam": "OpenAI.ToolSearchToolParam", "azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions": "Azure.AI.Projects.ToolUseFineTuningDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobOptions": "Azure.AI.Projects.TracesDataGenerationJobOptions", "azure.ai.projects.models.TracesDataGenerationJobSource": "Azure.AI.Projects.TracesDataGenerationJobSource", @@ -351,7 +358,9 @@ "azure.ai.projects.models.OpenApiAuthType": "Azure.AI.Projects.OpenApiAuthType", "azure.ai.projects.models.FunctionShellToolParamEnvironmentType": "OpenAI.FunctionShellToolParamEnvironmentType", "azure.ai.projects.models.ContainerSkillType": "OpenAI.ContainerSkillType", + "azure.ai.projects.models.ToolSearchExecutionType": "OpenAI.ToolSearchExecutionType", "azure.ai.projects.models.SearchContextSize": "OpenAI.SearchContextSize", + "azure.ai.projects.models.SearchContentType": "OpenAI.SearchContentType", "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.CodeDependencyResolution": "Azure.AI.Projects.CodeDependencyResolution", "azure.ai.projects.models.TelemetryEndpointKind": "Azure.AI.Projects.TelemetryEndpointKind", @@ -474,5 +483,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "3ae42dbde611" + "CrossLanguageVersion": "ca205130211f" } \ No newline at end of file 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 20c92f03d969..0379362a10a5 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 @@ -80,6 +80,7 @@ CodeInterpreterTool, ComparisonFilter, CompoundFilter, + ComputerTool, ComputerUsePreviewTool, Connection, ContainerAutoParam, @@ -129,6 +130,7 @@ Dimension, DispatchRoutineResult, EmbeddingConfiguration, + EmptyModelParam, EntraAuthorizationScheme, EntraIDCredentials, EntraIsolationKeySource, @@ -173,6 +175,7 @@ FunctionShellToolParamEnvironmentContainerReferenceParam, FunctionShellToolParamEnvironmentLocalEnvironmentParam, FunctionTool, + FunctionToolParam, GitHubIssueRoutineTrigger, HeaderIsolationKeySource, HeaderTelemetryEndpointAuth, @@ -231,6 +234,7 @@ ModelSourceData, ModelVersion, MonthlyRecurrenceSchedule, + NamespaceToolParam, NoAuthenticationCredentials, OneTimeTrigger, OpenApiAnonymousAuthDetails, @@ -311,6 +315,8 @@ Tool, ToolChoiceAllowed, ToolChoiceCodeInterpreter, + ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, @@ -323,6 +329,7 @@ ToolConfig, ToolDescription, ToolProjectConnection, + ToolSearchToolParam, ToolUseFineTuningDataGenerationJobOptions, ToolboxObject, ToolboxPolicies, @@ -421,6 +428,7 @@ SampleType, ScheduleProvisioningStatus, ScheduleTaskType, + SearchContentType, SearchContextSize, SessionLogEventType, SimpleQnAFineTuningQuestionType, @@ -430,6 +438,7 @@ TelemetryTransportProtocol, TextResponseFormatConfigurationType, ToolChoiceParamType, + ToolSearchExecutionType, ToolType, TreatmentEffectType, TriggerType, @@ -507,6 +516,7 @@ "CodeInterpreterTool", "ComparisonFilter", "CompoundFilter", + "ComputerTool", "ComputerUsePreviewTool", "Connection", "ContainerAutoParam", @@ -556,6 +566,7 @@ "Dimension", "DispatchRoutineResult", "EmbeddingConfiguration", + "EmptyModelParam", "EntraAuthorizationScheme", "EntraIDCredentials", "EntraIsolationKeySource", @@ -600,6 +611,7 @@ "FunctionShellToolParamEnvironmentContainerReferenceParam", "FunctionShellToolParamEnvironmentLocalEnvironmentParam", "FunctionTool", + "FunctionToolParam", "GitHubIssueRoutineTrigger", "HeaderIsolationKeySource", "HeaderTelemetryEndpointAuth", @@ -658,6 +670,7 @@ "ModelSourceData", "ModelVersion", "MonthlyRecurrenceSchedule", + "NamespaceToolParam", "NoAuthenticationCredentials", "OneTimeTrigger", "OpenApiAnonymousAuthDetails", @@ -738,6 +751,8 @@ "Tool", "ToolChoiceAllowed", "ToolChoiceCodeInterpreter", + "ToolChoiceComputer", + "ToolChoiceComputerUse", "ToolChoiceComputerUsePreview", "ToolChoiceCustom", "ToolChoiceFileSearch", @@ -750,6 +765,7 @@ "ToolConfig", "ToolDescription", "ToolProjectConnection", + "ToolSearchToolParam", "ToolUseFineTuningDataGenerationJobOptions", "ToolboxObject", "ToolboxPolicies", @@ -845,6 +861,7 @@ "SampleType", "ScheduleProvisioningStatus", "ScheduleTaskType", + "SearchContentType", "SearchContextSize", "SessionLogEventType", "SimpleQnAFineTuningQuestionType", @@ -854,6 +871,7 @@ "TelemetryTransportProtocol", "TextResponseFormatConfigurationType", "ToolChoiceParamType", + "ToolSearchExecutionType", "ToolType", "TreatmentEffectType", "TriggerType", 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 fb8d84b06bce..bc29c0a8b58d 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 @@ -950,6 +950,15 @@ class ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Insight task.""" +class SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of SearchContentType.""" + + TEXT = "text" + """TEXT.""" + IMAGE = "image" + """IMAGE.""" + + class SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of SearchContextSize.""" @@ -1051,6 +1060,19 @@ class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IMAGE_GENERATION.""" CODE_INTERPRETER = "code_interpreter" """CODE_INTERPRETER.""" + COMPUTER = "computer" + """COMPUTER.""" + COMPUTER_USE = "computer_use" + """COMPUTER_USE.""" + + +class ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolSearchExecutionType.""" + + SERVER = "server" + """SERVER.""" + CLIENT = "client" + """CLIENT.""" class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1060,6 +1082,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """FUNCTION.""" FILE_SEARCH = "file_search" """FILE_SEARCH.""" + COMPUTER = "computer" + """COMPUTER.""" COMPUTER_USE_PREVIEW = "computer_use_preview" """COMPUTER_USE_PREVIEW.""" WEB_SEARCH = "web_search" @@ -1076,6 +1100,10 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SHELL.""" CUSTOM = "custom" """CUSTOM.""" + NAMESPACE = "namespace" + """NAMESPACE.""" + TOOL_SEARCH = "tool_search" + """TOOL_SEARCH.""" WEB_SEARCH_PREVIEW = "web_search_preview" """WEB_SEARCH_PREVIEW.""" APPLY_PATCH = "apply_patch" 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 40f17df60f48..368fad6a64fd 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 @@ -66,31 +66,32 @@ class Tool(_Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool, BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationPreviewTool, - CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerUsePreviewTool, CustomToolParam, - MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, - LocalShellToolParam, MCPTool, MemorySearchPreviewTool, OpenApiTool, SharepointPreviewTool, - FunctionShellToolParam, ToolboxSearchPreviewTool, WebSearchTool, WebSearchPreviewTool, - WorkIQPreviewTool - - :ivar type: Required. Known values are: "function", "file_search", "computer_use_preview", - "web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom", - "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". + CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerTool, ComputerUsePreviewTool, + CustomToolParam, MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, + ImageGenTool, LocalShellToolParam, MCPTool, MemorySearchPreviewTool, NamespaceToolParam, + OpenApiTool, SharepointPreviewTool, FunctionShellToolParam, ToolSearchToolParam, + ToolboxSearchPreviewTool, 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". :vartype type: str or ~azure.ai.projects.models.ToolType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function\", \"file_search\", \"computer_use_preview\", - \"web_search\", \"mcp\", \"code_interpreter\", \"image_generation\", \"local_shell\", - \"shell\", \"custom\", \"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\".""" + """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\".""" @overload def __init__( @@ -3414,8 +3415,8 @@ class ComparisonFilter(_Model): * `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"] - :vartype type: str or str or str or str or str or str + Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"], Literal["in"], Literal["nin"] + :vartype type: str or str or str or str or str or str or str or str :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 @@ -3423,7 +3424,7 @@ class ComparisonFilter(_Model): :vartype value: str or float or bool or list[str or float] """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"] = rest_field( + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, @@ -3437,7 +3438,8 @@ class ComparisonFilter(_Model): * `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[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"], + Literal[\"in\"], Literal[\"nin\"]""" key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The key to compare against the value. Required.""" value: Union[str, float, bool, list[Union[str, float]]] = rest_field( @@ -3450,7 +3452,7 @@ class ComparisonFilter(_Model): def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"], + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], key: str, value: Union[str, float, bool, list[Union[str, float]]], ) -> None: ... @@ -3504,6 +3506,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ComputerTool(Tool, discriminator="computer"): + """Computer. + + :ivar type: The type of the computer tool. Always ``computer``. Required. COMPUTER. + :vartype type: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer tool. Always ``computer``. Required. COMPUTER.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolType.COMPUTER # type: ignore + + class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): """Computer use preview. @@ -3758,7 +3787,7 @@ class ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discrimi allowed_domains: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A list of allowed domains when type is ``allowlist``. Required.""" domain_secrets: Optional[list["_models.ContainerNetworkPolicyDomainSecretParam"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + visibility=["create"] ) """Optional domain-scoped secrets for allowlisted domains.""" @@ -3922,6 +3951,10 @@ class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="contin :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: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -3932,6 +3965,12 @@ class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="contin name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] ) """Maximum number of evaluation runs allowed per hour.""" + sampling_rate: Optional[float] = rest_field( + name="samplingRate", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -3939,6 +3978,7 @@ def __init__( *, eval_id: str, max_hourly_runs: Optional[int] = None, + sampling_rate: Optional[float] = None, ) -> None: ... @overload @@ -4487,6 +4527,8 @@ class CustomToolParam(Tool, discriminator="custom"): :vartype description: str :ivar format: The input format for the custom tool. Default is unconstrained text. :vartype format: ~azure.ai.projects.models.CustomToolParamFormat + :ivar defer_loading: Whether this tool should be deferred and discovered via tool search. + :vartype defer_loading: bool """ type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -4499,6 +4541,8 @@ class CustomToolParam(Tool, discriminator="custom"): visibility=["read", "create", "update", "delete", "query"] ) """The input format for the custom tool. Default is unconstrained text.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this tool should be deferred and discovered via tool search.""" @overload def __init__( @@ -4507,6 +4551,7 @@ def __init__( name: str, description: Optional[str] = None, format: Optional["_models.CustomToolParamFormat"] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -5654,6 +5699,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class EmptyModelParam(_Model): + """EmptyModelParam.""" + + class EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator="Entra"): """EntraAuthorizationScheme. @@ -7601,6 +7650,8 @@ class FunctionTool(Tool, discriminator="function"): :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: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -7612,6 +7663,8 @@ class FunctionTool(Tool, discriminator="function"): """Required.""" strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function is deferred and loaded via tool search.""" @overload def __init__( @@ -7621,6 +7674,7 @@ def __init__( parameters: dict[str, Any], strict: bool, description: Optional[str] = None, + defer_loading: Optional[bool] = None, ) -> None: ... @overload @@ -7635,6 +7689,58 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FUNCTION # type: ignore +class FunctionToolParam(_Model): + """FunctionToolParam. + + :ivar name: Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + :ivar strict: + :vartype strict: bool + :ivar type: Required. Default value is "function". + :vartype type: str + :ivar defer_loading: Whether this function should be deferred and discovered via tool search. + :vartype defer_loading: bool + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["function"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"function\".""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this function should be deferred and discovered via tool search.""" + + @overload + def __init__( + self, + *, + name: str, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = None, + strict: Optional[bool] = None, + defer_loading: Optional[bool] = 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) + self.type: Literal["function"] = "function" + + class GitHubIssueRoutineTrigger(RoutineTrigger, discriminator="github_issue"): """A GitHub issue routine trigger. @@ -7993,10 +8099,18 @@ class ImageGenTool(Tool, discriminator="image_generation"): ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], Literal["medium"], Literal["high"], Literal["auto"] :vartype quality: str or str or str or str - :ivar size: The size of the generated image. One of ``1024x1024``, ``1024x1536``, - ``1536x1024``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"] - :vartype size: str or str or str or str + :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: str or str or str or str or 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"] @@ -8044,12 +8158,19 @@ class ImageGenTool(Tool, discriminator="image_generation"): """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: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """The size of the generated image. One of ``1024x1024``, ``1024x1536``, ``1536x1024``, or - ``auto``. Default: ``auto``. Is one of the following types: Literal[\"1024x1024\"], - Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"]""" + """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: Optional[Literal["png", "webp", "jpeg"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -8103,7 +8224,9 @@ def __init__( Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-1.5"], str] ] = None, quality: Optional[Literal["low", "medium", "high", "auto"]] = None, - size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None, + size: Optional[ + Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str] + ] = None, output_format: Optional[Literal["png", "webp", "jpeg"]] = None, output_compression: Optional[int] = None, moderation: Optional[Literal["auto", "low"]] = None, @@ -9024,6 +9147,8 @@ class MCPTool(Tool, discriminator="mcp"): :ivar require_approval: Is one of the following types: MCPToolRequireApproval, Literal["always"], Literal["never"] :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :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. @@ -9083,6 +9208,8 @@ class MCPTool(Tool, discriminator="mcp"): rest_field(visibility=["read", "create", "update", "delete", "query"]) ) """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + defer_loading: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this MCP tool is deferred and discovered via tool search.""" project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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.""" @@ -9116,6 +9243,7 @@ def __init__( headers: Optional[dict[str, str]] = None, allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + defer_loading: Optional[bool] = None, project_connection_id: Optional[str] = None, tool_configs: Optional[dict[str, "_models.ToolConfig"]] = None, ) -> None: ... @@ -10302,6 +10430,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.MONTHLY # type: ignore +class NamespaceToolParam(Tool, discriminator="namespace"): + """Namespace. + + :ivar type: The type of the tool. Always ``namespace``. Required. NAMESPACE. + :vartype type: str or ~azure.ai.projects.models.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[~azure.ai.projects.models.FunctionToolParam or + ~azure.ai.projects.models.CustomToolParam] + """ + + type: Literal[ToolType.NAMESPACE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``namespace``. Required. NAMESPACE.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace name used in tool calls (for example, ``crm``). Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of the namespace shown to the model. Required.""" + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The function/custom tools available inside this namespace. Required.""" + + @overload + def __init__( + self, + *, + name: str, + description: str, + tools: list[Union["_models.FunctionToolParam", "_models.CustomToolParam"]], + ) -> 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) + self.type = ToolType.NAMESPACE # type: ignore + + class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): """Credentials that do not require authentication. @@ -13177,14 +13351,15 @@ class ToolChoiceParam(_Model): ``tools`` parameter to see how to specify which tools the model can call. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, - ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, ToolChoiceFunction, - ToolChoiceImageGeneration, ToolChoiceMCP, SpecificFunctionShellParam, + ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, ToolChoiceComputer, + ToolChoiceComputerUse, ToolChoiceComputerUsePreview, ToolChoiceCustom, ToolChoiceFileSearch, + ToolChoiceFunction, ToolChoiceImageGeneration, ToolChoiceMCP, SpecificFunctionShellParam, ToolChoiceWebSearchPreview, ToolChoiceWebSearchPreview20250311 :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", "apply_patch", "shell", "file_search", "web_search_preview", "computer_use_preview", - "web_search_preview_2025_03_11", "image_generation", and "code_interpreter". + "web_search_preview_2025_03_11", "image_generation", "code_interpreter", "computer", and + "computer_use". :vartype type: str or ~azure.ai.projects.models.ToolChoiceParamType """ @@ -13192,7 +13367,8 @@ class ToolChoiceParam(_Model): type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", \"apply_patch\", \"shell\", \"file_search\", \"web_search_preview\", \"computer_use_preview\", - \"web_search_preview_2025_03_11\", \"image_generation\", and \"code_interpreter\".""" + \"web_search_preview_2025_03_11\", \"image_generation\", \"code_interpreter\", \"computer\", + and \"computer_use\".""" @overload def __init__( @@ -14094,6 +14270,62 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolChoiceParamType.CODE_INTERPRETER # type: ignore +class ToolChoiceComputer(ToolChoiceParam, discriminator="computer"): + """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: str or ~azure.ai.projects.models.COMPUTER + """ + + type: Literal[ToolChoiceParamType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolChoiceParamType.COMPUTER # type: ignore + + +class ToolChoiceComputerUse(ToolChoiceParam, discriminator="computer_use"): + """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: str or ~azure.ai.projects.models.COMPUTER_USE + """ + + type: Literal[ToolChoiceParamType.COMPUTER_USE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. COMPUTER_USE.""" + + @overload + def __init__( + self, + ) -> 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) + self.type = ToolChoiceParamType.COMPUTER_USE # type: ignore + + class ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator="computer_use_preview"): """Indicates that the model should use a built-in tool to generate a response. `Learn more about built-in tools `_. @@ -14438,6 +14670,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ToolSearchToolParam(Tool, discriminator="tool_search"): + """Tool search tool. + + :ivar type: The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH. + :vartype type: str or ~azure.ai.projects.models.TOOL_SEARCH + :ivar execution: Whether tool search is executed by the server or by the client. Known values + are: "server" and "client". + :vartype execution: str or ~azure.ai.projects.models.ToolSearchExecutionType + :ivar description: + :vartype description: str + :ivar parameters: + :vartype parameters: ~azure.ai.projects.models.EmptyModelParam + """ + + type: Literal[ToolType.TOOL_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``tool_search``. Required. TOOL_SEARCH.""" + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether tool search is executed by the server or by the client. Known values are: \"server\" + and \"client\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: Optional["_models.EmptyModelParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + execution: Optional[Union[str, "_models.ToolSearchExecutionType"]] = None, + description: Optional[str] = None, + parameters: Optional["_models.EmptyModelParam"] = 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) + self.type = ToolType.TOOL_SEARCH # type: ignore + + class ToolUseFineTuningDataGenerationJobOptions( DataGenerationJobOptions, discriminator="tool_use" ): # pylint: disable=name-too-long @@ -14959,6 +15238,8 @@ class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: "low", "medium", and "high". :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize + :ivar search_content_types: + :vartype search_content_types: list[str or ~azure.ai.projects.models.SearchContentType] """ type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -14973,6 +15254,9 @@ class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): """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: Optional[list[Union[str, "_models.SearchContentType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( @@ -14980,6 +15264,7 @@ def __init__( *, user_location: Optional["_models.ApproximateLocation"] = None, search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, + search_content_types: Optional[list[Union[str, "_models.SearchContentType"]]] = None, ) -> None: ... @overload From 172b7985c14e03b98b613ee3763e6f511b152393 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:37:11 -0700 Subject: [PATCH 19/40] Cleanup unused `# [START` tages --- sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py | 1 - sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py | 1 - 2 files changed, 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py index 3285c1afb474..1c5727c583b9 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py @@ -30,7 +30,6 @@ def test_red_teams(self, **kwargs): with self.create_client(**kwargs) as project_client: - # [START red_team_sample] print("Creating a Red Team scan for direct model testing") # Create target configuration for testing an Azure OpenAI model diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py index 3fda37b15180..17f494cb2f8e 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py @@ -30,7 +30,6 @@ async def test_red_teams_async(self, **kwargs): async with self.create_async_client(**kwargs) as project_client: - # [START red_team_sample] print("Creating a Red Team scan for direct model testing") # Create target configuration for testing an Azure OpenAI model From 907a3cf6f9a87bb219c7a4e6f51f271846e57213 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:50:21 -0700 Subject: [PATCH 20/40] First --- .../azure-ai-projects/.github/skills/README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sdk/ai/azure-ai-projects/.github/skills/README.md b/sdk/ai/azure-ai-projects/.github/skills/README.md index 7ea120484d10..5fa39f44900e 100644 --- a/sdk/ai/azure-ai-projects/.github/skills/README.md +++ b/sdk/ai/azure-ai-projects/.github/skills/README.md @@ -7,7 +7,7 @@ git clone https://github.com/Azure/azure-sdk-for-python.git ``` * Change to the directory `sdk\ai\azure-ai-projects`. -* Switch to the current feature branch: `git switch feature/azure-ai-projects/2.2.0`. +* Switch to the current feature branch, for example: `git switch feature/azure-ai-projects/2.3.0`. * Make sure you don't have any files edited or added in this branch (clean `git status` state). ## Emit from TypeSpec and create a PR @@ -17,16 +17,26 @@ * Open VSCode in the current folder. * Open the CoPilot chat window ("Toggle Chat"). * Make sure you are in "Agent" mode. -* Start typing `/azure-ai-projects` and press tab to auto complete it to `/azure-ai-projects-emit-from-typespec`, then press Enter. +* Start typing `/` followed by the skill name, like `/azure-ai-projects` and press tab to auto complete it to the designed skill, like `/azure-ai-projects-emit-from-typespec`, then press Enter. * Answer some questions and approve execution to go through the workflow ### Using CoPilot CLI or Agency Copilot CLI * Install [GitHub CoPilot CLI](https://docs.github.com/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) or [Agency CoPilot CLI](https://aka.ms/agency) (VPN required) if you don't already have it. * Run CoPilot CLI by typing `copilot` -* Start typing `/azure-ai-projects` and press tab to auto complete it to `/azure-ai-projects-emit-from-typespec`, then press Enter. +* Start typing `/` followed by the skill name, like `/azure-ai-projects` and press tab to auto complete it to the desired skill, like `/azure-ai-projects-emit-from-typespec`, then press Enter. * Answer some questions and approve execution to go through the workflow +## Skills + +### azure-ai-projects-emit-from-typespec + +This skill creates a new topic branch, emits SDK from TypeSpec, runs some post-processing and creates a PR. + +### azure-ai-projects-update-changelog + +This skill updates the file CHANGELOG.md, comparing the source in the current branch which the source of the latest public release. It does not create a new topic branch or a PR. + From 21e4a84d318f98010993f2a115b5e785191fb217 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:36:27 -0700 Subject: [PATCH 21/40] Separate skill for updating CHANGELOG.md file (#47327) --- .../SKILL.md | 342 ++++++++++++++++++ sdk/ai/azure-ai-projects/CHANGELOG.md | 6 + 2 files changed, 348 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md diff --git a/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md new file mode 100644 index 000000000000..eeb810776294 --- /dev/null +++ b/sdk/ai/azure-ai-projects/.github/skills/azure-ai-projects-update-changelog/SKILL.md @@ -0,0 +1,342 @@ +--- +name: azure-ai-projects-update-changelog +license: MIT +metadata: + version: "1.0.0" + distribution: local +description: "Update CHANGELOG.md by comparing public APIs between the current branch and the latest released version on PyPI. WHEN: \"update changelog\", \"generate changelog\", \"add changelog entry\", \"what changed in this version\". DO NOT USE FOR: other Azure SDK packages. INVOKES: PyPI API, GitHub API (for tags), file operations." +compatibility: + requires: "local azure-sdk-for-python clone, git, internet access" +--- + +# Update azure-ai-projects Changelog + +This skill guides Copilot through updating the CHANGELOG.md file for the azure-ai-projects package by comparing public APIs between the current branch and the latest released version. + +**Working directory:** `sdk/ai/azure-ai-projects` + +--- + +## Overview + +The skill performs these steps: +1. Read the current version from `azure/ai/projects/_version.py` +2. Fetch the latest released version from PyPI +3. Compare public classes, methods, and properties between current branch and released version +4. Update CHANGELOG.md with a new section or update the existing "(Unreleased)" section + +--- + +## Step 1: Read the current version + +Read the current version from `azure/ai/projects/_version.py`. The file contains a line like: +```python +VERSION = "X.Y.Z" +``` + +Extract this version number and save it as `CURRENT_VERSION`. + +--- + +## Step 2: Fetch the latest released version from PyPI + +Use the PyPI JSON API to get the latest released version: + +``` +https://pypi.org/pypi/azure-ai-projects/json +``` + +From the JSON response: +- Extract `info.version` as `LATEST_PYPI_VERSION` +- This is the version we will compare against + +--- + +## Step 3: Determine if CHANGELOG needs updating + +Check if CHANGELOG.md already has a section for the current version: +- If there's a section `## {CURRENT_VERSION} (Unreleased)` — we will update it +- If there's a section `## {CURRENT_VERSION} (YYYY-MM-DD)` with an actual date — the version is already released, report this to the user and stop +- If there's no section for `CURRENT_VERSION` — we will create a new one + +--- + +## Step 4: Construct the GitHub tag for the released version + +The tag name for a released version follows this pattern: +``` +azure-ai-projects_{VERSION} +``` + +For example, for version `2.2.0`, the tag is `azure-ai-projects_2.2.0`. + +The source code for that release can be found at: +``` +https://github.com/Azure/azure-sdk-for-python/tree/azure-ai-projects_{VERSION}/sdk/ai/azure-ai-projects +``` + +--- + +## Step 5: Compare public APIs + +Compare the public APIs between the current branch and the latest released version. Focus on these locations: + +### 5a. Public classes and enums in `azure/ai/projects/models/__init__.py` + +Compare the `__all__` list and imports in both versions to identify: +- **New classes/enums**: Present in current branch but not in released version +- **Removed classes/enums**: Present in released version but not in current branch +- **Renamed classes/enums**: Check if a removed class has a similar new class (likely a rename) + +### 5b. Public operations in `azure/ai/projects/operations/__init__.py` + +Compare the `__all__` list to identify new or removed operation classes. + +### 5c. Public methods on sub-clients + +For each operations class (like `AgentsOperations`, `BetaOperations`, etc.), compare the public methods: +- Look at files under `azure/ai/projects/operations/` and `azure/ai/projects/aio/operations/` +- Also check `_patch.py` files which may define additional public methods +- Public methods are those that don't start with underscore `_` + +### 5d. Properties on model classes + +For significant model classes, compare public properties (attributes) between versions: +- Properties are defined in `azure/ai/projects/models/_models.py` +- Look for new, removed, or renamed properties +- Pay attention to required vs optional changes + +### 5e. Beta sub-clients on `BetaOperations` + +The `BetaOperations` class exposes beta/preview functionality. Check for: +- New sub-client properties (like `.beta.datasets`, `.beta.models`, `.beta.routines`, etc.) +- Removed sub-client properties +- Check both `azure/ai/projects/operations/_patch.py` and the released version + +### 5f. Sample files in `samples/` folder + +Compare sample files between the current branch and the released version: + +1. **List all `.py` files** recursively under `samples/` in both versions +2. **Identify new samples**: Files present in current branch but not in released version +3. **Identify removed samples**: Files present in released version but not in current branch +4. **Ignore async variants**: If a sample has both sync and async versions (e.g., `sample_foo.py` and `sample_foo_async.py`), only report the sync version +5. **Check existing changelog entries**: If a sample is already mentioned in the current changelog section, leave it as is +6. **Remove stale entries**: If a sample mentioned in the changelog has been removed from the codebase, remove it from the changelog + +For each new sample, provide a one-line description of what it demonstrates. Read the sample file to understand its purpose — typically the docstring at the top or the `if __name__ == "__main__"` block explains what it does. + +--- + +## Step 6: Categorize the changes + +Organize detected changes into these categories: + +### Features Added +- New sub-clients (e.g., "New `.beta.routines` sub-client with routine operations: `create_or_update`, `get`, `enable`, ...") +- New methods on existing sub-clients (e.g., "New methods on `.beta.agents` for optimization jobs: `create_optimization_job`, `get_optimization_job`, ...") +- New model classes that represent significant features (e.g., "Support integration of external Agents. See new `ExternalAgentDefinition` class.") +- New properties on existing classes (e.g., "New optional `force` parameter on `agents.delete` method.") +- New tools (e.g., "New Agent tool in preview `FabricIQPreviewTool`.") + +### Breaking Changes +List breaking changes in beta methods and classes separately: +- Renamed methods (e.g., "Method `.beta.agents.get_session_files` renamed to `.beta.agents.list_session_files`.") +- Renamed arguments (e.g., "Argument `body` in method `.beta.skills.create_from_files()` renamed to `content`.") +- Signature changes (e.g., "Method `.beta.skills.create` signature changed — now takes `name` and keyword `inline_content: SkillInlineContent`; returns `SkillVersion`.") +- Renamed classes (e.g., "Renamed class `AgentEndpoint` to `AgentEndpointConfig`.") +- Property changes (e.g., "Required property `isolation_key_source` removed from class `EntraAuthorizationScheme`.") +- Renamed properties (e.g., "Property `skill_id` renamed to `id` on class `SkillDetails`.") + +**Format for beta changes:** +```markdown +Breaking changes in beta methods: +* ... + +Breaking changes in beta classes: +* ... +``` + +### Bugs Fixed +This section typically contains bug fixes. Leave empty unless you have specific bug fix information to add. + +### Sample updates +List new sample files that were added, with a one-line description of what they demonstrate: +- Compare sample files in the `samples/` folder between current branch and released version +- Only report the sync version — do not list async samples separately (files ending with `_async.py`) +- If a sample is already mentioned in the existing changelog section, preserve that entry +- If a sample mentioned in the changelog has been removed from the codebase, remove it from the changelog +- Group related samples together (e.g., all agent samples, all evaluation samples) +- Use format: `Added \`sample_name.py\` demonstrating [brief description].` + +--- + +## Step 7: Format the changelog entry + +Use this format for the changelog entry: + +```markdown +## {CURRENT_VERSION} (Unreleased) + +### Features Added + +* [List each feature on its own bullet point] + +### Breaking Changes + +Breaking changes in beta methods: +* [List method changes] + +Breaking changes in beta classes: +* [List class changes] + +### Bugs Fixed + +* [List bug fixes, if any] + +### Sample updates + +* [List sample updates, if any] +``` + +**Guidelines for writing entries:** +- For new methods: mention the sub-client and method name, briefly describe what it does. Only report the sync version — do not list both sync and async versions separately. +- For new sub-clients: list all the methods it provides (sync versions only) +- For new tools: just mention the class name +- For property changes: mention the class name and the affected property +- For renames: show "X renamed to Y" format +- Use backticks for code references: `.beta.agents`, `create_version()`, `AgentDetails` + +--- + +## Step 8: Update CHANGELOG.md + +Insert or update the changelog entry in `CHANGELOG.md`: + +1. If updating an existing "(Unreleased)" section: + - Replace the existing section content with the new content + - Preserve any manually-added entries that aren't API-related (like "Sample updates" written by developers) + +2. If creating a new section: + - Insert the new section immediately after the `# Release History` header + - Keep all previous version sections intact + +--- + +## Step 9: Report to user + +After updating the changelog, report: +1. The current version and latest PyPI version compared +2. Summary of changes detected: + - Number of new classes/enums + - Number of new methods + - Number of breaking changes + - Number of removed items +3. Remind the user to: + - Review the generated changelog for accuracy + - Add any bug fixes that were made + - Review sample descriptions for accuracy + - Verify method descriptions are accurate + +--- + +## Tips for API Comparison + +### Using git to compare files + +You can compare files between the current branch and a tag: +```bash +git diff azure-ai-projects_{VERSION} -- azure/ai/projects/models/__init__.py +``` + +### Using GitHub raw URLs + +To fetch files from the released version: +``` +https://raw.githubusercontent.com/Azure/azure-sdk-for-python/azure-ai-projects_{VERSION}/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +``` + +### Identifying renames vs additions/removals + +If a class was removed and a similar class was added, it's likely a rename. Look for: +- Similar names (e.g., `SkillObject` → `SkillDetails`) +- Similar structure/properties +- Check if there's a corresponding note in the TypeSpec changes + +--- + +## Example Output + +Here's an example of a well-formatted changelog entry: + +```markdown +## 2.3.0 (Unreleased) + +### Features Added + +* Support integration of external Agents (in preview). See new `ExternalAgentDefinition` class. +* New Agent tool in preview `FabricIQPreviewTool`. +* New Agent tool in preview `ToolboxSearchPreviewTool`. +* New methods on `.beta.agents` for + * Code-based hosted agents: `create_version_from_code`, `download_code`. + * Optimization jobs: `create_optimization_job`, `get_optimization_job`, `list_optimization_jobs`, `cancel_optimization_job`, `list_optimization_candidates`. + * Optimization candidate management: `list_optimization_candidates`, `get_optimization_candidate`, `get_optimization_candidate_config`, `get_optimization_candidate_results`, `get_candidate_file`, `promote_candidate`. + * `stop_session` to stop a running agent session. +* New `.beta.datasets` sub-client with data generation job operations: `create_generation_job`, `get_generation_job`, `list_generation_jobs`, `cancel_generation_job`, `delete_generation_job`. +* New `.beta.models` sub-client to handle AI model weights: `create`, `list_versions`, `list`, `get`, `delete`, `update`, `pending_create_version`, `pending_upload`, `get_credentials`. +* New `.beta.routines` sub-client with routine operations: `create_or_update`, `get`, `enable`, `disable`, `list`, `delete`, `list_runs`, `dispatch`. +* New methods on `.beta.evaluators` for evaluator generation jobs: `create_generation_job`, `get_generation_job`, `list_generation_jobs`, `cancel_generation_job`, `delete_generation_job`. +* New methods on `.beta.memory_stores` to handle individual memory items: `create_memory`, `update_memory`, `list_memories`, `get_memory`, `delete_memory`. +* New methods on `.beta.skills` for versioned skill management: `create`, `list_versions`, `get_version`, `download_version`, `delete_version`. +* New optional string properties `description` and `name` added to Agent tools classes which did not have them before. +* New optional `tool_configs` added to Agent tool classes. +* New read-only property `content_hash` on `CodeConfiguration`, returning the SHA-256 hex digest of the uploaded code zip. +* New optional `force` parameter on `agents.delete` and `agents.delete_version` methods. +* New optional `blueprint_reference` parameters on `agents.create_version` method. + + +### Breaking Changes + +Breaking changes in beta methods: +* Argument `isolation_key` in methods `.beta.agents.create_session()` and `.beta.agents.delete_session()` renamed to `user_isolation_key`. +* Argument `body` in methods `.beta.evaluation_taxonomies.create()` and `.beta.evaluation_taxonomies.update()` renamed to `taxonomy`. +* Argument `body` in method `.beta.skills.create_from_files()` renamed to `content`. +* Method `.beta.agents.get_session_files` renamed to `.beta.agents.list_session_files`. +* Method `.beta.skills.create` signature changed — now takes `name` and keyword `inline_content: SkillInlineContent`; returns `SkillVersion`. +* Method `.beta.skills.create_from_package` renamed to `.beta.skills.create_from_files`. +* Method `.beta.skills.create_from_files` signature changed — now takes `name` and `content: CreateSkillVersionFromFilesBody`; returns `SkillVersion`. +* Method `.beta.skills.update` signature changed — now only accepts keyword `default_version`; returns `SkillDetails`. + +Breaking changes in beta classes: +* Required property `isolation_key_source` removed from class `EntraAuthorizationScheme`. +* Renamed class `AgentEndpoint` to `AgentEndpointConfig`. +* Renamed class `DeleteSkillResponse` to `DeleteSkillResult`. +* Renamed class `SessionDirectoryListResponse` to `SessionDirectoryListResult`. +* Renamed class `SessionFileWriteResponse` to `SessionFileWriteResult`. +* Renamed class `SkillObject` to `SkillDetails`. Property `skill_id` renamed to `id`. Properties `has_blob` and `metadata` were removed. +* Renamed class `Target` to `EvaluationTarget`. +* Renamed class `TargetConfig` to `RedTeamTargetConfig`. + +### Bugs Fixed + +* Fixed telemetry instrumentor to correctly call is_recording() as a method on spans, ensuring non-recording spans are properly skipped (e.g., when sampling is configured) ([GitHub issue 46544](https://github.com/Azure/azure-sdk-for-python/issues/46544)). + +### Sample updates + +* Added new Agent tool samples `sample_agent_work_iq.py` and `sample_agent_work_iq_async.py` demonstrating use of `WorkIQPreviewTool`. +* Added new Agent tool samples `sample_agent_fabric_iq.py` and `sample_agent_fabric_iq_async.py` demonstrating use of `FabricIQPreviewTool`. +* Hosted Agents: + * Added Hosted Agent creation samples `sample_create_hosted_agent.py` and `sample_create_hosted_agent_async.py`, demonstrating hosted agent version creation and retrieval with `AIProjectClient`. + * Added Hosted Agent code-upload samples `sample_create_hosted_agent_from_code.py` and `sample_create_hosted_agent_from_code_async.py`, demonstrating uploading a code package (zip) as a new hosted agent version. + * The Hosted Agent creation sample also demonstrates assigning the hosted agent managed identity the Azure AI User RBAC role on the backing Azure AI account. + * Updated the other Hosted Agent samples to reuse an existing Hosted Agent as a prerequisite, instead of creating a new hosted agent version in each sample. +* Added Toolbox tool-search sample `sample_toolboxes_with_search_preview.py` and `sample_toolboxes_with_search_preview_async.py`, demonstrating creating a Toolbox version with `ToolboxSearchPreviewTool` and invoking `MCPTool`. +* Added `.beta.models` samples under `samples/models/`: + * `sample_models_basic.py` — synchronous end-to-end registration via the `create` helper (uses `azcopy`), followed by `get`, `list_versions`, `list`, `get_credentials`, `update`, and `delete`. + * `sample_models_create_and_poll.py` — alternative synchronous registration that hand-rolls the spec's three-step flow (`pending_upload` → upload via `azure-storage-blob` → `pending_create_version` + poll), without taking a dependency on `azcopy`. + * `sample_models_basic_async.py` — asynchronous version of the same three-step flow using `azure.ai.projects.aio.AIProjectClient` and `azure.storage.blob.aio.ContainerClient`. +* Added new evaluation sample `sample_model_evaluation_instant_model.py` demonstrating model evaluation with an instant model. +* Refreshed evaluation samples under `samples/evaluations/` and `samples/evaluations/agentic_evaluators/` (including `sample_agent_evaluation`, `sample_agent_response_evaluation`, `sample_eval_catalog_prompt_based_evaluators`, `sample_evaluations_ai_assisted`, `sample_evaluations_builtin_with_csv`, `sample_evaluations_builtin_with_dataset_id`, `sample_evaluations_builtin_with_inline_data`, `sample_evaluations_builtin_with_inline_data_oai`, `sample_scheduled_evaluations`, `sample_coherence`, `sample_fluency`, `sample_intent_resolution`, `sample_relevance`, `sample_response_completeness`, `sample_tool_call_accuracy`, `sample_tool_call_success`, `sample_tool_input_accuracy`, `sample_tool_output_utilization`, `sample_tool_selection`, and `sample_generic_agentic_evaluator`). +* New sample `sample_dataset_generation_job_simpleqna_with_prompt_source.py` showing an end-to-end flow that generates a QnA dataset via `.beta.datasets.create_generation_job` and runs an OpenAI evaluation. + +``` diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index b601407b5999..78feb424836f 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -2,11 +2,17 @@ ## 2.3.0 (Unreleased) +### Breaking Changes + +Breaking changes in beta methods: +* Method `.beta.agents.list_optimization_candidates` now returns `ItemPaged[OptimizationCandidate]` instead of `AgentsPagedResultOptimizationCandidate`. The `after` parameter has been removed (use continuation-token-based paging instead). + ### Sample updates * Added `sample_routines_crud.py` to demonstrate CRUD operations. * Added `sample_routines_with_timer_trigger.py` to demonstrate triggering a routine with a timer. * Added `sample_routines_with_schedule_trigger.py` to demonstrate triggering a routine on a recurring cron schedule via `ScheduleRoutineTrigger`. +* Added `sample_skill_in_toolbox.py` demonstrating how to expose a Skill to a Prompt Agent via a Toolbox using `MCPTool`. * Updated `sample_dataset_generation_job_traces_for_evaluation.py` and `sample_dataset_generation_job_traces_for_finetuning.py` to create a temporary agent, seed conversations, retry the data generation job over the trace window, and clean up all created resources. * Updated `sample_memory_crud.py` and `sample_memory_crud_async.py` to demonstrate memory item CRUD (`create_memory`, `get_memory`, `update_memory`, `list_memories`, `delete_memory`) in addition to memory store CRUD. * Updated the rubric evaluator generation samples (`sample_rubric_evaluator_generation_basic.py`, `sample_rubric_evaluator_generation_iterate.py`, `sample_rubric_evaluator_generation_lifecycle.py`, `sample_rubric_evaluator_generation_all_sources.py`) to use the typed `EvaluatorGenerationJob` / `EvaluatorGenerationInputs` / `*EvaluatorGenerationJobSource` models. The job inputs are now nested under `inputs` per the service contract, and the traces source uses `datetime` values for `start_time` / `end_time`. From dc50ff6a2a1cc4a2eca91b20c8ba711f905aa62c Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 5 Jun 2026 09:27:07 -0700 Subject: [PATCH 22/40] Update Python tsp-location.yaml to match recent TypeSpec client.tsp file move (#47361) --- sdk/ai/azure-ai-projects/tsp-location.yaml | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index b9bf529d1e4c..fba1c89d1f07 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,29 @@ -directory: specification/ai-foundry/data-plane/Foundry -commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects +commit: 1a46f23eb6ff991b777135f70d7d0782fc0fb324 repo: Azure/azure-rest-api-specs additionalDirectories: + - specification/ai-foundry/data-plane/Foundry/src/agents + - specification/ai-foundry/data-plane/Foundry/src/agents-optimization + - specification/ai-foundry/data-plane/Foundry/src/agents-session-files + - specification/ai-foundry/data-plane/Foundry/src/common + - specification/ai-foundry/data-plane/Foundry/src/connections + - specification/ai-foundry/data-plane/Foundry/src/data_generation_jobs + - specification/ai-foundry/data-plane/Foundry/src/datasets + - specification/ai-foundry/data-plane/Foundry/src/deployments + - specification/ai-foundry/data-plane/Foundry/src/evaluation-rules + - specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies + - specification/ai-foundry/data-plane/Foundry/src/evaluators + - specification/ai-foundry/data-plane/Foundry/src/indexes + - specification/ai-foundry/data-plane/Foundry/src/insights + - specification/ai-foundry/data-plane/Foundry/src/memory-stores + - specification/ai-foundry/data-plane/Foundry/src/models + - specification/ai-foundry/data-plane/Foundry/src/openai-conversations + - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations + - specification/ai-foundry/data-plane/Foundry/src/openai-responses + - specification/ai-foundry/data-plane/Foundry/src/red-teams + - specification/ai-foundry/data-plane/Foundry/src/routines + - specification/ai-foundry/data-plane/Foundry/src/schedules + - specification/ai-foundry/data-plane/Foundry/src/servicepatterns.tsp + - specification/ai-foundry/data-plane/Foundry/src/skills + - specification/ai-foundry/data-plane/Foundry/src/toolboxes + - specification/ai-foundry/data-plane/Foundry/src/tools \ No newline at end of file From be0e6ca93eefebaebe883c0d521d03583e0d37e2 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:23:50 -0700 Subject: [PATCH 23/40] Update subclient doc --- sdk/ai/azure-ai-projects/docs/subclients.md | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sdk/ai/azure-ai-projects/docs/subclients.md b/sdk/ai/azure-ai-projects/docs/subclients.md index e6b40e3e6e1b..538c79bea5e4 100644 --- a/sdk/ai/azure-ai-projects/docs/subclients.md +++ b/sdk/ai/azure-ai-projects/docs/subclients.md @@ -4,7 +4,7 @@ This document lists all sub-clients available on `AIProjectClient` and their pub ## Summary -There are a total of 139 unique public methods across all sub-clients. +There are a total of 140 unique public methods across all sub-clients. ### Top-level Sub-clients (stable operations) @@ -28,7 +28,7 @@ There are a total of 139 unique public methods across all sub-clients. | `beta.evaluators` | BetaEvaluatorsOperations | 13 | | `beta.insights` | BetaInsightsOperations | 3 | | `beta.memory_stores` | BetaMemoryStoresOperations | 13 | -| `beta.models` | BetaModelsOperations | 8 | +| `beta.models` | BetaModelsOperations | 9 | | `beta.red_teams` | BetaRedTeamsOperations | 3 | | `beta.routines` | BetaRoutinesOperations | 8 | | `beta.schedules` | BetaSchedulesOperations | 6 | @@ -38,7 +38,7 @@ There are a total of 139 unique public methods across all sub-clients. ## Method list table -Alphabetically sorted, with ".beta" sub-client at the end. +Alphabetically sorted, with ".beta" sub-client at the end. If the method is a new hand-written method, there will be an asterisk at the end. ``` .agents.create_version @@ -50,8 +50,8 @@ Alphabetically sorted, with ".beta" sub-client at the end. .agents.list .agents.list_versions -.connections.get -.connections.get_default +.connections.get* +.connections.get_default* .connections.list .datasets.create_or_update @@ -61,8 +61,8 @@ Alphabetically sorted, with ".beta" sub-client at the end. .datasets.list .datasets.list_versions .datasets.pending_upload -.datasets.upload_file -.datasets.upload_folder +.datasets.upload_file* +.datasets.upload_folder* .deployments.get .deployments.list @@ -78,7 +78,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .indexes.list .indexes.list_versions -.telemetry.get_application_insights_connection_string +.telemetry.get_application_insights_connection_string* .beta.agents.cancel_optimization_job .beta.agents.create_optimization_job @@ -103,7 +103,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.agents.patch_agent_details .beta.agents.promote_candidate .beta.agents.stop_session -.beta.agents.upload_session_file +.beta.agents.upload_session_file* .beta.datasets.cancel_generation_job .beta.datasets.create_generation_job @@ -135,7 +135,7 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.insights.get .beta.insights.list -.beta.memory_stores.begin_update_memories +.beta.memory_stores.begin_update_memories* .beta.memory_stores.create .beta.memory_stores.create_memory .beta.memory_stores.delete @@ -145,10 +145,11 @@ Alphabetically sorted, with ".beta" sub-client at the end. .beta.memory_stores.get_memory .beta.memory_stores.list .beta.memory_stores.list_memories -.beta.memory_stores.search_memories +.beta.memory_stores.search_memories* .beta.memory_stores.update .beta.memory_stores.update_memory +.beta.models.create* .beta.models.pending_create_version .beta.models.delete .beta.models.get From a39e6e0551064f70c44f9c5bef0e8612a5028a32 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 11:03:02 -0700 Subject: [PATCH 24/40] Add sample for dispatching routines with manual triggers (#47404) --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + .../sample_routines_with_dispatch.py | 130 ++++++++++++++++++ .../tests/samples/test_samples.py | 1 + 3 files changed, 132 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 78feb424836f..b5d5a54cfaaa 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -12,6 +12,7 @@ Breaking changes in beta methods: * Added `sample_routines_crud.py` to demonstrate CRUD operations. * Added `sample_routines_with_timer_trigger.py` to demonstrate triggering a routine with a timer. * Added `sample_routines_with_schedule_trigger.py` to demonstrate triggering a routine on a recurring cron schedule via `ScheduleRoutineTrigger`. +* Added `sample_routines_with_dispatch.py` to demonstrate manually firing a routine on demand via `routines.dispatch(...)` using a `CustomRoutineTrigger`. * Added `sample_skill_in_toolbox.py` demonstrating how to expose a Skill to a Prompt Agent via a Toolbox using `MCPTool`. * Updated `sample_dataset_generation_job_traces_for_evaluation.py` and `sample_dataset_generation_job_traces_for_finetuning.py` to create a temporary agent, seed conversations, retry the data generation job over the trace window, and clean up all created resources. * Updated `sample_memory_crud.py` and `sample_memory_crud_async.py` to demonstrate memory item CRUD (`create_memory`, `get_memory`, `update_memory`, `list_memories`, `delete_memory`) in addition to memory store CRUD. diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py new file mode 100644 index 000000000000..4b7db7a01602 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py @@ -0,0 +1,130 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to create a Routine with a manual (custom) + trigger and fire it on demand via `dispatch(...)`, then record the + resulting run by polling `list_runs(...)` using the synchronous + AIProjectClient. + + The routine is bound to an existing hosted agent. Because the trigger is + a `CustomRoutineTrigger`, the routine never fires on its own; the sample + explicitly invokes it with `project_client.beta.routines.dispatch(...)` + passing an `InvokeAgentResponsesApiDispatchPayload` carrying the input + sent to the agent. The sample then polls the run history until a + terminal phase is reached (or a deadline elapses), printing each + observed transition. The routine is deleted at the end of the sample. + + Routines are currently a preview feature. In the Python SDK, you access + these operations via `project_client.beta.routines`. + +USAGE: + python sample_routines_with_dispatch.py + + Before running the sample: + + pip install "azure-ai-projects>=2.2.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) FOUNDRY_HOSTED_AGENT_NAME - The name of an existing Hosted Agent to invoke + when the routine is dispatched. +""" + +import json +import os +import time + +from dotenv import load_dotenv + +from azure.core.exceptions import ResourceNotFoundError +from azure.identity import DefaultAzureCredential + +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + CustomRoutineTrigger, + InvokeAgentResponsesApiDispatchPayload, + InvokeAgentResponsesApiRoutineAction, + RoutineRun, + RoutineRunPhase, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +agent_name = os.environ["FOUNDRY_HOSTED_AGENT_NAME"] + + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, +): + + routine_name = "sample-routine-dispatch" + + try: + project_client.beta.routines.delete(routine_name) + print(f"Routine `{routine_name}` deleted") + except ResourceNotFoundError: + pass + + created = project_client.beta.routines.create_or_update( + routine_name, + description="Routine used by the dispatch sample.", + enabled=True, + triggers={ + "manual": CustomRoutineTrigger( + provider="sample-provider", + event_name="sample-event", + parameters={}, + ), + }, + action=InvokeAgentResponsesApiRoutineAction(agent_name=agent_name), + ) + print(f"Created routine: {created.name} enabled={created.enabled}") + + dispatch_result = project_client.beta.routines.dispatch( + routine_name, + payload=InvokeAgentResponsesApiDispatchPayload( + input="Say hello from a manually dispatched routine.", + ), + ) + print(f"Dispatched routine: dispatch_id={dispatch_result.dispatch_id} task_id={dispatch_result.task_id}") + + seen_phases: dict[str, RoutineRunPhase] = {} + final_run: RoutineRun | None = None + + deadline = time.monotonic() + 180 + while time.monotonic() < deadline: + runs = list(project_client.beta.routines.list_runs(routine_name, limit=20, order="desc")) + for run in runs: + if seen_phases.get(run.id) == run.phase: + continue + seen_phases[run.id] = run.phase # type: ignore[assignment] + print( + f" - run_id={run.id} phase={run.phase} status={run.status} " + f"trigger_type={run.trigger_type} triggered_at={run.triggered_at} ended_at={run.ended_at}" + ) + if str(run.status).lower() == "finished": + final_run = run + + if final_run is not None: + break + time.sleep(5) + + if final_run: + print("Final run:") + print(json.dumps(final_run.as_dict(), indent=2, default=str)) + # Note: retrieving the response body produced by a routine-dispatched + # run via `openai_client.responses.retrieve(final_run.response_id)` is + # not yet supported by the service for this scenario. + else: + print("Dispatch did not produce a terminal run within the deadline.") + + project_client.beta.routines.delete(routine_name) + print("Routine deleted") diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index c3fa6905f7df..8e92f51580c4 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -257,6 +257,7 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: "sample_routines_with_schedule_trigger.py", # Specify through AdditionalSampleTestDetail "sample_routines_crud.py", # Skipped due to service serialization issues "sample_routines_with_timer_trigger.py", # Skipped due to service serialization issues + "sample_routines_with_dispatch.py", # 403: test identity lacks routines/dispatch data-action ], ), ) From f0f161f9e32f75527ba84ae1fd1f4172dd05cc43 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 15 Jun 2026 07:48:15 -0700 Subject: [PATCH 25/40] restore packages --- eng/emitter-package-lock.json | 465 +++++++++++++++++++--------------- eng/emitter-package.json | 27 +- 2 files changed, 264 insertions(+), 228 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 13834ca670d7..1787807b517f 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -6,48 +6,33 @@ "": { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.63.1" + "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { -<<<<<<< HEAD "@azure-tools/openai-typespec": "1.20.0", - "@azure-tools/typespec-autorest": "~0.69.0", - "@azure-tools/typespec-azure-core": "~0.69.0", - "@azure-tools/typespec-azure-resource-manager": "~0.69.0", - "@azure-tools/typespec-azure-rulesets": "~0.69.0", - "@azure-tools/typespec-client-generator-core": "~0.69.0", -======= - "@azure-tools/openai-typespec": "1.19.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.0", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) + "@azure-tools/typespec-client-generator-core": "~0.68.4", "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "~0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/http-client-python": "^0.31.1", - "@typespec/openapi": "^1.13.0", - "@typespec/openapi3": "1.13.0", - "@typespec/rest": "~0.83.0", - "@typespec/sse": "~0.83.0", - "@typespec/streams": "~0.83.0", - "@typespec/versioning": "~0.83.0", - "@typespec/xml": "~0.83.0" + "@typespec/compiler": "^1.12.0", + "@typespec/events": "~0.82.0", + "@typespec/http": "^1.12.0", + "@typespec/http-client-python": "^0.31.0", + "@typespec/openapi": "^1.12.0", + "@typespec/openapi3": "1.12.0", + "@typespec/rest": "~0.82.0", + "@typespec/sse": "~0.82.0", + "@typespec/streams": "~0.82.0", + "@typespec/versioning": "~0.82.0", + "@typespec/xml": "~0.82.0" } }, "node_modules/@azure-tools/openai-typespec": { -<<<<<<< HEAD "version": "1.20.0", "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", -======= - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", - "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "dev": true, "license": "MIT", "peerDependencies": { @@ -56,23 +41,23 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.0.tgz", - "integrity": "sha512-6lOOe3NWfLI8M5NGLM1ZzIFRe34gVPj2GXzti9ag6o3fVpC6eMUfacv1sU4zmz9dkpKTdOUXNO5qm3DvqPRC8Q==", + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.68.0.tgz", + "integrity": "sha512-ywcB68x0jOuplKg1u9ZpjOamHbIEEgAaMuXTP72cvWXE7q1eGLCN1DQx1Uk5ME8VLJKAX6cMOMHK4hcmg9tvuw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.0", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.68.0", + "@azure-tools/typespec-azure-resource-manager": "^0.68.0", + "@azure-tools/typespec-client-generator-core": "^0.68.0", + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": "^0.82.0", + "@typespec/versioning": "^0.82.0", + "@typespec/xml": "^0.82.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -81,23 +66,23 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha512-UNdPb/DgMvXqwWk9hb54QOAumCJ6u6GGy+bj3RIIT1Sht6FR9rIn8AQ/UQ7WtrhbJBoqvQo5dxtS565a9/VRZw==", + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.68.0.tgz", + "integrity": "sha512-p0qUkRZav5fdQvGe2gSCvlgsvpM0y9xVhgH2GpXi5ZzpYfNGzxd8oZr8VOCP8mjMVfGQ3AtnowbmrHALEZgz7Q==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0", + "@typespec/rest": "^0.82.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.0.tgz", - "integrity": "sha512-q/kdsGhVpvn2wb3OedxFHg7hp+al3FynUAPsz2gwqJx62z6UGOEJhtYCWP3osatVgxvKRhhh8uYl5mHRMDFi3g==", + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.68.0.tgz", + "integrity": "sha512-1zgXpOb/fGfB7SrFqawKasSOTIi9cZPWyK8V3RHyNWFZVQclEMGBzSvBHi6an4AEChqcjCSMh5MEr4BSujW4Ew==", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -107,39 +92,33 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.68.0", + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": "^0.82.0", + "@typespec/versioning": "^0.82.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.0.tgz", - "integrity": "sha512-+7KThtfHupWBDSwDR9rRHNmBb15gxACH8iPOOohRr1J28Gu25YWlz1G00r62X9VUBFLZTxYc4rQ2QCxPFT0uFw==", + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.68.0.tgz", + "integrity": "sha512-cXZ3jiDNqJgpBQLguNgXjvAsvYo7VwtlQxFMzTr96gpoAiuBViH+3eOhVd5HA4H96NgAWSddTMHXZJZzcsnE5A==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.0", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0" + "@azure-tools/typespec-azure-core": "^0.68.0", + "@azure-tools/typespec-azure-resource-manager": "^0.68.0", + "@azure-tools/typespec-client-generator-core": "^0.68.0", + "@typespec/compiler": "^1.12.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { -<<<<<<< HEAD - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.0.tgz", - "integrity": "sha512-ro8zzOeiN/74r0wM19R77gzLtbfjIFgKgr1Rusii/vhCfJIoVC7IcqLxhbJl0RVkjyhRFKt4GCRAw4iurnrDnw==", -======= "version": "0.68.4", "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.68.4.tgz", "integrity": "sha512-p32EXsrSC9giZUNdsQ2gmvDENFIEW2E0zto3FmjBZ3OeB5wCw1ZAZ+KnO0rsoKFovBvHSsQatNCKJvM/x89AgA==", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -150,16 +129,16 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.68.0", + "@typespec/compiler": "^1.12.0", + "@typespec/events": "^0.82.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": "^0.82.0", + "@typespec/sse": "^0.82.0", + "@typespec/streams": "^0.82.0", + "@typespec/versioning": "^0.82.0", + "@typespec/xml": "^0.82.0" } }, "node_modules/@azure-tools/typespec-liftr-base": { @@ -169,13 +148,13 @@ "dev": true }, "node_modules/@azure-tools/typespec-python": { - "version": "0.63.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.63.1.tgz", - "integrity": "sha512-+hRzFg+pE4nGu0kko8TFcwW7Wc9irQe1QNhfu5jJj8OmMbk4idYXWKh+yo+25HUJ54Eu6L4/vgX8RzYGAfJogQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.63.0.tgz", + "integrity": "sha512-8CSHcHhI1egOE9BabVD3P8pjkYEt38vF85bA//ZEMOwgTVn0OCpOeuJN/uCy3uEYNSQUSOVKin35H2m04xupJQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@typespec/http-client-python": "^0.31.1", + "@typespec/http-client-python": "^0.30.0", "semver": "^7.7.4", "tsx": "^4.21.0" }, @@ -183,20 +162,65 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": "^0.69.0", - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.0", - "@azure-tools/typespec-azure-rulesets": "^0.69.0", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-autorest": "^0.68.0", + "@azure-tools/typespec-azure-core": "^0.68.0", + "@azure-tools/typespec-azure-resource-manager": "^0.68.0", + "@azure-tools/typespec-azure-rulesets": "^0.68.0", + "@azure-tools/typespec-client-generator-core": "^0.68.2", + "@typespec/compiler": "^1.12.0", + "@typespec/events": "^0.82.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": "^0.82.0", + "@typespec/sse": "^0.82.0", + "@typespec/streams": "^0.82.0", + "@typespec/versioning": "^0.82.0", + "@typespec/xml": "^0.82.0" + } + }, + "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.30.1.tgz", + "integrity": "sha512-fo78R2GhPjUntPwZGDHxZ/ddRQZgLRSCzO3F+u8hPrHPzmBXA0rMkeS2WKCWYmT/wcFDPAojjH9pMUl27dLQ0w==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "js-yaml": "~4.1.0", + "marked": "^15.0.6", + "pyodide": "0.26.2", + "semver": "~7.6.2", + "tsx": "^4.21.0" + }, + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-autorest": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.68.2 <1.0.0", + "@typespec/compiler": "^1.12.0", + "@typespec/events": ">=0.82.0 <1.0.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": ">=0.82.0 <1.0.0", + "@typespec/sse": ">=0.82.0 <1.0.0", + "@typespec/streams": ">=0.82.0 <1.0.0", + "@typespec/versioning": ">=0.82.0 <1.0.0", + "@typespec/xml": ">=0.82.0 <1.0.0" + } + }, + "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/@babel/code-frame": { @@ -979,15 +1003,9 @@ } }, "node_modules/@scalar/helpers": { -<<<<<<< HEAD - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.2.tgz", - "integrity": "sha512-qNbqUjSB3S4Gr4A0oANcm5G1Ip+EqBxICYKhe9YzmnaBpbmW6shxqpiivApTvvuDf+uIhR3uMwWyVQbYcGLsxA==", -======= "version": "0.8.1", "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.1.tgz", "integrity": "sha512-yuiuBCadP5bjAnIv23QvifVN/NaMi9xBF6b8Wdk4QOzwzLPJmp699MAdf33J0A5i2qKcvnu32iz/VkEJmQRe5g==", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "dev": true, "license": "MIT", "engines": { @@ -995,15 +1013,6 @@ } }, "node_modules/@scalar/json-magic": { -<<<<<<< HEAD - "version": "0.12.16", - "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.16.tgz", - "integrity": "sha512-w8cDbZhHCzmIblWx92IVWoAXsbI4Fz3m++jiBANTSO1hgphF6UqEPQiCt3wnMPaxaanjMQxjS/iBk1UGXR2EGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@scalar/helpers": "0.8.2", -======= "version": "0.12.15", "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.15.tgz", "integrity": "sha512-ZYgdYZ0jSZXQeyhG2lJ20FjzvKsaDRXk4bPguF/Ytl2nGBh9a6RIIr9NvVy4zAD67a/ahm+xipXlfoR1KtB5fg==", @@ -1011,7 +1020,6 @@ "license": "MIT", "dependencies": { "@scalar/helpers": "0.8.1", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "pathe": "^2.0.3", "yaml": "^2.8.3" }, @@ -1020,31 +1028,66 @@ } }, "node_modules/@scalar/openapi-parser": { - "version": "0.28.7", - "resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.28.7.tgz", - "integrity": "sha512-E6beEdTsJxUStxOmY1knQvSNJq6LTiXOsRX2WTrfmU6d/kiATn6IKkAU0kXtAZkaYCGU4UCEmBFHCMmNKn0JLA==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.25.12.tgz", + "integrity": "sha512-1hajBAbc7cbEcsSZEQxaPXZyCjMf6h6hObV+SO32jkC6rrxinPXQIucDu9HTu/jm/FaaMnNhc8/XDWz5/E49cQ==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.8.2", - "@scalar/json-magic": "0.12.16", - "@scalar/openapi-types": "0.9.1", - "@scalar/openapi-upgrader": "0.2.9", + "@scalar/helpers": "0.5.2", + "@scalar/json-magic": "0.12.8", + "@scalar/openapi-types": "0.8.0", + "@scalar/openapi-upgrader": "0.2.6", "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^3.0.1", "jsonpointer": "^5.0.1", "leven": "^4.0.0", - "yaml": "^2.8.3" + "yaml": "^2.8.0" }, "engines": { "node": ">=22" } }, + "node_modules/@scalar/openapi-parser/node_modules/@scalar/helpers": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-Pi1GAl8jO6ungmGj2sjDfCfqiBNrKW6HXDZmminV94ybGU/KtRLOqHwd0n9FIhY3j0RYGpGC0VCuniCICfQPHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + } + }, + "node_modules/@scalar/openapi-parser/node_modules/@scalar/json-magic": { + "version": "0.12.8", + "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.8.tgz", + "integrity": "sha512-a559iO8tmFeA90JJAAM3U5x1Asf3mr0Z8uDC1PmyLTDjdSOfajP7EY9VzNoXE2cM48ilf9qrjmkbw/d4VCFjQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@scalar/helpers": "0.5.2", + "pathe": "^2.0.3", + "yaml": "^2.8.0" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@scalar/openapi-parser/node_modules/@scalar/openapi-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.8.0.tgz", + "integrity": "sha512-WmaxVSfvY5K/TwcG2B2TU1WOe1As1uc2s7myswtP6dBlcjU3hM08SApxv/jmyGaCE8t4gO5BBhmHY4pDUfmr2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + } + }, "node_modules/@scalar/openapi-types": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.9.1.tgz", - "integrity": "sha512-gkGhSkxSzADaBiNg+ZAbJuwj+ZUmzP2Pg9CWZ7ZP+0fck2WjPeDDM7aAbouAm0aQQMF9xBjSPXSA9a/qTHYaTw==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.7.0.tgz", + "integrity": "sha512-kN0PwlJW0de4bwQ4ib+mBHzKJUvBCyR/gwU4zLEq6SCbj+GfgYUh+2a0/yl1WYVUiSkkwFsHjfmQ8KjhR3HK0Q==", "dev": true, "license": "MIT", "engines": { @@ -1052,18 +1095,28 @@ } }, "node_modules/@scalar/openapi-upgrader": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.9.tgz", - "integrity": "sha512-D5b0rGLLZgmkO9mdW2j/ND1KBlH1u3RCpr87HPxv9P9ZSr6PtM5iLqFOJq0ACiaHjY2mikCrxgDmnUEhTzRpHQ==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.6.tgz", + "integrity": "sha512-pvEmfSCDNYR4+lygidUqfo+shzyp4OSh9+UgK110rzA8Oot6WbJBM03Fuq3M255G7G6R9iXyfsebB7MBUocPkw==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/openapi-types": "0.9.1" + "@scalar/openapi-types": "0.8.0" }, "engines": { "node": ">=22" } }, + "node_modules/@scalar/openapi-upgrader/node_modules/@scalar/openapi-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.8.0.tgz", + "integrity": "sha512-WmaxVSfvY5K/TwcG2B2TU1WOe1As1uc2s7myswtP6dBlcjU3hM08SApxv/jmyGaCE8t4gO5BBhmHY4pDUfmr2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + } + }, "node_modules/@typespec/asset-emitter": { "version": "0.79.1", "resolved": "https://registry.npmjs.org/@typespec/asset-emitter/-/asset-emitter-0.79.1.tgz", @@ -1078,9 +1131,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha512-DonoHiyAMx0UjSmssqTrFtya+v97wny1aHcTLU5QF2wFzLATtcwUU9hbPC+eXhepuTunMOCHf8yk3pEsH6PZYA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.12.0.tgz", + "integrity": "sha512-hKCkHEEDdCpXFyOU8ln+TzBBwonFMbkeUV0zIc+vBETyO8p/Upui3XvEyLOyB4CpKUReHzGeGm3gcFjNc73ygg==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.0", @@ -1109,28 +1162,28 @@ } }, "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha512-3EP1EIjdLgwStgd2rGWaF/QqY7YRAt+DIYnnYG2VsdPwa8s2t6K6eJ9YJDXveeHImAkHs+cpFuwxnjKMl4hOyw==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.82.0.tgz", + "integrity": "sha512-4gxwWndMVmYF6e5ETrwW6b77h1DsSc2ZiIbNo98XePaynD6yz/ooHKKtNKacjC2gmWhfRz1ArPioYn0YHvQkxw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.12.0" } }, "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha512-tf8XFddU6g1MZSAVCLC/0Xa4fNfUO0CcHe6PWpmC3bvUojxMnpRcERI2DdoRJ+aycB9Q+Z8wN8bJO3up6u+sCw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.12.0.tgz", + "integrity": "sha512-3Bb1M6VSuEVPWOecXj3h3I/ddMpb9cmKRQQq34oq7LatiK4fwVBp+EdWbqzEzaRUGHm9mZtqsMsxZf5FndT8dg==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.12.0", + "@typespec/streams": "^0.82.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -1139,9 +1192,10 @@ } }, "node_modules/@typespec/http-client-python": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.31.1.tgz", - "integrity": "sha512-69lB3EzV/eVprES14ud6hDf6EgIuPu/Q/lhkCEzDZ9qNH5Q7ntScSweWDp71uoT56vpyl2rr41Zjb+FixQhS2g==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.31.0.tgz", + "integrity": "sha512-cG7ky7WMRfEeSp6YadVwHwgFSFLNFN82LTQziu6doNxQ0UipAIaobIELfVT5D/PDIz/Pa3w9mNG9CWF08uO7qA==", + "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1155,26 +1209,27 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.0 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": ">=0.83.0 <1.0.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/sse": ">=0.83.0 <1.0.0", - "@typespec/streams": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.68.4 <1.0.0", + "@typespec/compiler": "^1.12.0", + "@typespec/events": ">=0.82.0 <1.0.0", + "@typespec/http": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/rest": ">=0.82.0 <1.0.0", + "@typespec/sse": ">=0.82.0 <1.0.0", + "@typespec/streams": ">=0.82.0 <1.0.0", + "@typespec/versioning": ">=0.82.0 <1.0.0", + "@typespec/xml": ">=0.82.0 <1.0.0" } }, "node_modules/@typespec/http-client-python/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1184,28 +1239,28 @@ } }, "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha512-omPc9n+LM2WvjYwnIf31RCxmG17fFUOVLBRsWg4T1mbcsNCj4grnNP7Lwt+irIZCiKtmLKxq3ViE7jYixCkZ3g==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.12.0.tgz", + "integrity": "sha512-XtkCMPpzXFfuIzmx/BQrCMUCCk7d37lkqZe5ubJmvJ02Fr7yvAbofrgtNUZ1BbFe3TBBUS2nB3E3mjT3tE4zCQ==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0" } }, "node_modules/@typespec/openapi3": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-1.13.0.tgz", - "integrity": "sha512-G6ayl30kXYVhJvL2/zFwtTdWnCt6N6jZWxs8rAwYiFlZfaG8R/dzjRgcap9Dr0v+6AyWmRwooxRKM3TLi5R/mg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-1.12.0.tgz", + "integrity": "sha512-r2CechzwGyr+BtLo7ApoaaTsrYybaE0gsGCLVWbkfH9Fs2KTu0ilpMKGxXjhKRS6cWHMkGGuB3hM0OJjFyFydw==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/json-magic": "^0.12.15", - "@scalar/openapi-parser": "^0.28.6", - "@scalar/openapi-types": "^0.9.1", + "@scalar/json-magic": "^0.12.5", + "@scalar/openapi-parser": "^0.25.8", + "@scalar/openapi-types": "^0.7.0", "@typespec/asset-emitter": "^0.79.1", "yaml": "^2.8.3" }, @@ -1216,14 +1271,14 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/json-schema": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@typespec/compiler": "^1.12.0", + "@typespec/events": "^0.82.0", + "@typespec/http": "^1.12.0", + "@typespec/json-schema": "^1.12.0", + "@typespec/openapi": "^1.12.0", + "@typespec/sse": "^0.82.0", + "@typespec/streams": "^0.82.0", + "@typespec/versioning": "^0.82.0" }, "peerDependenciesMeta": { "@typespec/events": { @@ -1247,67 +1302,67 @@ } }, "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha512-WMEwEe1kdaOdZ0c+ct5BVmTSBXkrPniUYDWCz3K52T4in2dNc7J6YGP6tL8bXgQz5B0CsP0VNO12N+UysQDsLw==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.82.0.tgz", + "integrity": "sha512-cKjKEd8lgE3EdU9b5xXLoSdKBcifITOhHS2n9LPbEG9w6APfWDWGdtUe4UKV3wxWq9HlT143wpECW7IjrPhjnA==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.12.0", + "@typespec/http": "^1.12.0" } }, "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha512-04WNaju2rwBbcF5pG+HrKQtdcrmSGuTVziLHNA9XOqj1qM7Uon3+wo2g+ZZ3Z6tngfqQoTCPyDcRHqZtGRdNuw==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.82.0.tgz", + "integrity": "sha512-4jBByfLsS7yQAIqmbLkfrw4XoPm9kOqawvW5gVXmKtnMMDYR0RmfBhsnAXBqhUXGbnFq0bDJGEw3GX+6k3mKnA==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.12.0", + "@typespec/events": "^0.82.0", + "@typespec/http": "^1.12.0", + "@typespec/streams": "^0.82.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha512-wbO6sdH1Uf+UwjxxsWdHQkjJ3wwiYsAKI+L66qnDYVXAFe02sUdMKd0mxH5o9ipGXE52MZ+yvZ52vHAD+g3RFQ==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.82.0.tgz", + "integrity": "sha512-cr/6h6VV/6OJeG8RNcSd0SDes5iEXiuGUcKGrMN6wF8qKTTrY2hXNhfqCCn3lamDOg00wbi7ke+laz6pHWN3tg==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.12.0" } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha512-nE66ta0ixpHB6FQpSzqnj8QnVfgFsxeK/4Xv+DxYx2nB/w18f6VjkF+hW+A/zs1tZIYvBZVbCNa/Rcr8zM6fhg==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.82.0.tgz", + "integrity": "sha512-s8giuYQTQPniy2YxNfKXYpAU2Vm4L74TdOsbFWe0tG+jnOy/9tt7kKTH4QF1sB8nRvmjv8h31EoHtZYOPe1GvA==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.12.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha512-2/dtAD8jGPkIdwpQ1G1P+5+qdMPeafQiIKCd8NdAnOo0w9OZ59Io52jINm9HdN8+FcbOrqK8+B2N9rlPRj7PqA==", + "version": "0.82.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.82.0.tgz", + "integrity": "sha512-/Bwlt7HwSltojSbalkh7hGRh/lB5aMJllnb7gAAf3xRPMlnmu5VJqDFFcbZKqDvkwgGXZX/xHo458c4kott5Ug==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.12.0" } }, "node_modules/ajv": { @@ -1746,9 +1801,9 @@ } }, "node_modules/prettier": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", - "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -1788,9 +1843,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", - "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", + "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 304f366b05c1..b4ee98d3d708 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,28 +1,9 @@ { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.63.1" + "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { -<<<<<<< HEAD - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "~0.83.0", - "@typespec/versioning": "~0.83.0", - "@typespec/openapi": "^1.13.0", - "@typespec/events": "~0.83.0", - "@typespec/sse": "~0.83.0", - "@typespec/streams": "~0.83.0", - "@typespec/xml": "~0.83.0", - "@typespec/openapi3": "1.13.0", - "@typespec/http-client-python": "^0.31.1", - "@azure-tools/openai-typespec": "1.20.0", - "@azure-tools/typespec-autorest": "~0.69.0", - "@azure-tools/typespec-azure-core": "~0.69.0", - "@azure-tools/typespec-azure-resource-manager": "~0.69.0", - "@azure-tools/typespec-azure-rulesets": "~0.69.0", - "@azure-tools/typespec-client-generator-core": "~0.69.0", -======= "@typespec/compiler": "^1.12.0", "@typespec/http": "^1.12.0", "@typespec/rest": "~0.82.0", @@ -33,13 +14,13 @@ "@typespec/streams": "~0.82.0", "@typespec/xml": "~0.82.0", "@typespec/openapi3": "1.12.0", - "@azure-tools/openai-typespec": "1.19.0", + "@typespec/http-client-python": "^0.31.0", + "@azure-tools/openai-typespec": "1.20.0", "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.0", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) + "@azure-tools/typespec-client-generator-core": "~0.68.4", "@azure-tools/typespec-liftr-base": "0.14.0" } } From c550e40fffb07cff735287d7f465deef432e17c9 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 19:58:39 -0700 Subject: [PATCH 26/40] sample update routines (#47423) * sample update routines * Add test for routines samples and update sample skipping logic --- .../sample_routines_crud.py | 2 +- .../sample_routines_with_dispatch.py | 2 +- .../sample_routines_with_schedule_trigger.py | 2 +- .../sample_routines_with_timer_trigger.py | 2 +- .../tests/samples/test_samples.py | 40 ++++++++++++++----- 5 files changed, 34 insertions(+), 14 deletions(-) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_crud.py (97%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_dispatch.py (97%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_schedule_trigger.py (99%) rename sdk/ai/azure-ai-projects/samples/{hosted_agents => routines}/sample_routines_with_timer_trigger.py (98%) diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py similarity index 97% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py index f71a74b33b48..45aadc1f8b26 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_crud.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_crud.py @@ -58,7 +58,7 @@ def print_routine_state(routine: Routine) -> None: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py similarity index 97% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py index 4b7db7a01602..1c5164cf00c8 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_dispatch.py @@ -62,7 +62,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine-dispatch" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py similarity index 99% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py index 7bd7c0780661..7f3b6404d644 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_schedule_trigger.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_schedule_trigger.py @@ -62,7 +62,7 @@ def main() -> None: with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): routine_name = "sample-routine-schedule" diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py similarity index 98% rename from sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py rename to sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py index 96ed2f533e81..1ef31fb4a108 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_timer_trigger.py +++ b/sdk/ai/azure-ai-projects/samples/routines/sample_routines_with_timer_trigger.py @@ -74,7 +74,7 @@ with ( DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, ): # Azure Monitor exporter: same spans also sent to the Application Insights # resource attached to the Foundry project, viewable in the "Tracing" tab diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index 8e92f51580c4..d27d0e8b5975 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -240,19 +240,41 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: "FOUNDRY_HOSTED_AGENT_REMOTE_BUILD": "true", }, ), - AdditionalSampleTestDetail( - test_id="sample_routines_with_schedule_trigger", - sample_filename="sample_routines_with_schedule_trigger.py", - env_vars={ - "POLL_INTERVAL_SECONDS": "300", - }, - ), ] ) @pytest.mark.parametrize( "sample_path", get_sample_paths( "hosted_agents", + samples_to_skip=[], + ), + ) + @SamplePathPasser() + @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) + def test_hosted_agents_samples(self, sample_path: str, **kwargs) -> None: + if os.path.basename(sample_path).startswith("sample_create_hosted_agent") and not self.is_live: + pytest.skip("sample_create_hosted_agent.py is skipped in replay mode due to RBAC complications.") + env_vars = get_sample_env_vars(kwargs) + executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) + executor.execute() + executor.validate_print_calls_by_llm() + + @servicePreparer() + # @additionalSampleTests( + # [ + # AdditionalSampleTestDetail( + # test_id="sample_routines_with_schedule_trigger", + # sample_filename="sample_routines_with_schedule_trigger.py", + # env_vars={ + # "POLL_INTERVAL_SECONDS": "300", + # }, + # ), + # ] + # ) + @pytest.mark.parametrize( + "sample_path", + get_sample_paths( + "routines", samples_to_skip=[ "sample_routines_with_schedule_trigger.py", # Specify through AdditionalSampleTestDetail "sample_routines_crud.py", # Skipped due to service serialization issues @@ -263,9 +285,7 @@ def test_chat_completions_samples(self, sample_path: str, **kwargs) -> None: ) @SamplePathPasser() @recorded_by_proxy(RecordedTransport.AZURE_CORE, RecordedTransport.HTTPX) - def test_hosted_agents_samples(self, sample_path: str, **kwargs) -> None: - if os.path.basename(sample_path).startswith("sample_create_hosted_agent") and not self.is_live: - pytest.skip("sample_create_hosted_agent.py is skipped in replay mode due to RBAC complications.") + def test_routines_samples(self, sample_path: str, **kwargs) -> None: env_vars = get_sample_env_vars(kwargs) executor = SyncSampleExecutor(self, sample_path, env_vars=env_vars, **kwargs) executor.execute() From 7f2a28c4291b33b4f5d7980c841b187c961e3634 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 12 Jun 2026 15:57:46 -0700 Subject: [PATCH 27/40] Emit from latest TypeSpec, including new Agent Optimization methods (#47482) --- .../azure-ai-projects/apiview-properties.json | 24 +- sdk/ai/azure-ai-projects/assets.json | 2 +- .../azure/ai/projects/_types.py | 1 + .../azure/ai/projects/_utils/utils.py | 50 +- .../ai/projects/aio/operations/_operations.py | 1547 +++++++-------- .../azure/ai/projects/models/__init__.py | 40 +- .../azure/ai/projects/models/_enums.py | 15 +- .../azure/ai/projects/models/_models.py | 946 ++++----- .../azure/ai/projects/models/_patch.py | 2 +- .../ai/projects/operations/_operations.py | 1720 +++++++---------- .../azure-ai-projects/post-emitter-fixes.cmd | 18 +- .../foundry_features_header_test_base.py | 4 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 13 files changed, 1851 insertions(+), 2520 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 2495388ba138..38cbceeeaadd 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -20,7 +20,6 @@ "azure.ai.projects.models.AgentEvaluatorGenerationJobSource": "Azure.AI.Projects.AgentEvaluatorGenerationJobSource", "azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials", "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", - "azure.ai.projects.models.AgentIdentifier": "Azure.AI.Projects.AgentIdentifier", "azure.ai.projects.models.AgentIdentity": "Azure.AI.Projects.AgentIdentity", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentSessionResource": "Azure.AI.Projects.AgentSessionResource", @@ -62,10 +61,6 @@ "azure.ai.projects.models.BrowserAutomationPreviewTool": "Azure.AI.Projects.BrowserAutomationPreviewTool", "azure.ai.projects.models.BrowserAutomationToolConnectionParameters": "Azure.AI.Projects.BrowserAutomationToolConnectionParameters", "azure.ai.projects.models.BrowserAutomationToolParameters": "Azure.AI.Projects.BrowserAutomationToolParameters", - "azure.ai.projects.models.CandidateDeployConfig": "Azure.AI.Projects.CandidateDeployConfig", - "azure.ai.projects.models.CandidateFileInfo": "Azure.AI.Projects.CandidateFileInfo", - "azure.ai.projects.models.CandidateMetadata": "Azure.AI.Projects.CandidateMetadata", - "azure.ai.projects.models.CandidateResults": "Azure.AI.Projects.CandidateResults", "azure.ai.projects.models.CaptureStructuredOutputsTool": "Azure.AI.Projects.CaptureStructuredOutputsTool", "azure.ai.projects.models.ChartCoordinate": "Azure.AI.Projects.ChartCoordinate", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", @@ -118,8 +113,6 @@ "azure.ai.projects.models.DatasetCredential": "Azure.AI.Projects.AssetCredentialResponse", "azure.ai.projects.models.DatasetDataGenerationJobOutput": "Azure.AI.Projects.DatasetDataGenerationJobOutput", "azure.ai.projects.models.DatasetEvaluatorGenerationJobSource": "Azure.AI.Projects.DatasetEvaluatorGenerationJobSource", - "azure.ai.projects.models.DatasetInfo": "Azure.AI.Projects.DatasetInfo", - "azure.ai.projects.models.DatasetRef": "Azure.AI.Projects.DatasetRef", "azure.ai.projects.models.DatasetReference": "Azure.AI.Projects.DatasetReference", "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", @@ -243,21 +236,25 @@ "azure.ai.projects.models.OpenApiProjectConnectionAuthDetails": "Azure.AI.Projects.OpenApiProjectConnectionAuthDetails", "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", "azure.ai.projects.models.OpenApiTool": "Azure.AI.Projects.OpenApiTool", - "azure.ai.projects.models.OptimizationAgentDefinition": "Azure.AI.Projects.OptimizationAgentDefinition", + "azure.ai.projects.models.OptimizationAgentIdentifier": "Azure.AI.Projects.OptimizationAgentIdentifier", "azure.ai.projects.models.OptimizationCandidate": "Azure.AI.Projects.OptimizationCandidate", + "azure.ai.projects.models.OptimizationDatasetCriterion": "Azure.AI.Projects.OptimizationDatasetCriterion", + "azure.ai.projects.models.OptimizationDatasetInput": "Azure.AI.Projects.OptimizationDatasetInput", + "azure.ai.projects.models.OptimizationDatasetItem": "Azure.AI.Projects.OptimizationDatasetItem", + "azure.ai.projects.models.OptimizationEvaluatorRef": "Azure.AI.Projects.OptimizationEvaluatorRef", + "azure.ai.projects.models.OptimizationInlineDatasetInput": "Azure.AI.Projects.OptimizationInlineDatasetInput", "azure.ai.projects.models.OptimizationJob": "Azure.AI.Projects.OptimizationJob", "azure.ai.projects.models.OptimizationJobInputs": "Azure.AI.Projects.OptimizationJobInputs", + "azure.ai.projects.models.OptimizationJobListItem": "Azure.AI.Projects.OptimizationJobListItem", "azure.ai.projects.models.OptimizationJobProgress": "Azure.AI.Projects.OptimizationJobProgress", "azure.ai.projects.models.OptimizationJobResult": "Azure.AI.Projects.OptimizationJobResult", "azure.ai.projects.models.OptimizationOptions": "Azure.AI.Projects.OptimizationOptions", - "azure.ai.projects.models.OptimizationTaskResult": "Azure.AI.Projects.OptimizationTaskResult", + "azure.ai.projects.models.OptimizationReferenceDatasetInput": "Azure.AI.Projects.OptimizationReferenceDatasetInput", "azure.ai.projects.models.TelemetryEndpoint": "Azure.AI.Projects.TelemetryEndpoint", "azure.ai.projects.models.OtlpTelemetryEndpoint": "Azure.AI.Projects.OtlpTelemetryEndpoint", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", - "azure.ai.projects.models.PromoteCandidateRequest": "Azure.AI.Projects.PromoteCandidateRequest", - "azure.ai.projects.models.PromoteCandidateResponse": "Azure.AI.Projects.PromoteCandidateResponse", "azure.ai.projects.models.PromotionInfo": "Azure.AI.Projects.PromotionInfo", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", @@ -379,8 +376,9 @@ "azure.ai.projects.models.AgentSessionStatus": "Azure.AI.Projects.AgentSessionStatus", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.SessionLogEventType": "Azure.AI.Projects.SessionLogEventType", - "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", + "azure.ai.projects.models.OptimizationDatasetInputType": "Azure.AI.Projects.OptimizationDatasetInputType", "azure.ai.projects.models.EvaluationLevel": "Azure.AI.Projects.EvaluationLevel", + "azure.ai.projects.models.JobStatus": "Azure.AI.Projects.JobStatus", "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", "azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory", "azure.ai.projects.models.EvaluatorType": "Azure.AI.Projects.EvaluatorType", @@ -483,5 +481,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, - "CrossLanguageVersion": "ca205130211f" + "CrossLanguageVersion": "9cf16cec0d0a" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index e52797a1c639..c546cf197dd0 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_059be0eaf8" + "Tag": "python/ai/azure-ai-projects_cc9f48b0e7" } diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py index 5e23b3911701..abad0c3afee4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py @@ -11,3 +11,4 @@ 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/utils.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/utils.py index dcc813297e02..c91d6470e2bf 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 @@ -31,25 +31,21 @@ def serialize_multipart_data_entry(data_entry: Any) -> Any: def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any: - """Ensure each multipart file entry carries a filename so that it is encoded - as a file part (with ``filename=``) rather than a plain form field. - - Servers commonly distinguish multipart file parts from form-data parts by - the presence of ``filename=`` in the part's ``Content-Disposition`` header. - When callers pass bare bytes / str / IO objects (e.g. - ``Path("x.zip").read_bytes()``), the underlying HTTP client emits the part - without a filename, which several Foundry endpoints reject with errors like - "At least one file must be uploaded". This helper synthesizes a filename - from the IO object's ``name`` attribute when available, otherwise falls - back to a stable default. - - :param field_name: The multipart form field name, used as a fallback filename. - :type field_name: str - :param entry: The file entry to normalize. May be a tuple, bytes, str, or IO object. + """Ensure a multipart file entry carries a filename for Content-Disposition. + + Servers distinguish file parts from plain form fields by the presence of + ``filename=`` in the ``Content-Disposition`` header. When callers pass + bare bytes/str/IO the HTTP client omits the filename and the server may + reject the upload. This helper wraps bare values into a (filename, content) + tuple, deriving the name from IO.name when available. + + :param str field_name: The multipart field name used as a filename fallback. + :param entry: The user-provided file entry (tuple, bytes, str, or IO). :type entry: any - :param index: Position of the entry within its field's list, used to disambiguate fallback filenames. - :type index: int - :return: A ``(filename, entry)`` tuple if ``entry`` was not already a tuple, otherwise ``entry`` unchanged. + :param int index: The positional index of the entry within the field, used + to disambiguate fallback filenames when multiple entries are provided. + :return: Either the original tuple entry, or a ``(filename, content)`` tuple + wrapping the bare value. :rtype: any """ if isinstance(entry, tuple): @@ -60,7 +56,14 @@ def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> filename = os.path.basename(name_attr) if not filename: filename = f"{field_name}_{index}" if index else field_name - return (filename, entry) + + # Return a 3-tuple with an explicit "application/octet-stream" content type. + # A 2-tuple (filename, content) would leave the part's Content-Type unset, and + # the sdk core library only defaults to "application/octet-stream" for bare + # (non-tuple) values - a tuple bypasses that default and falls back to the + # HTTP "text/plain" default instead. Setting it explicitly preserves the + # pre-existing behavior for bare bytes/IO across all transports. + return (filename, entry, "application/octet-stream") def prepare_multipart_form_data( @@ -68,11 +71,8 @@ def prepare_multipart_form_data( ) -> list[FileType]: files: list[FileType] = [] - # Append data fields first so they appear before file parts in the encoded - # multipart body. Some streaming server-side parsers (e.g. the Foundry - # hosted-agents `create_agent_version_from_code` endpoint) require small - # JSON metadata parts to precede large binary file parts; otherwise they - # report the metadata part as missing. + # Data fields first so streaming server-side parsers see metadata before + # binary file parts. for data_field in data_fields: data_entry = body.get(data_field) if data_entry: @@ -83,7 +83,7 @@ def prepare_multipart_form_data( if isinstance(multipart_entry, list): for idx, e in enumerate(multipart_entry): files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx))) - elif multipart_entry: + elif multipart_entry is not None: files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0))) return files 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 5104a3473fa8..e278f6761204 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 @@ -54,19 +54,13 @@ build_beta_agents_delete_session_request, build_beta_agents_download_code_request, build_beta_agents_download_session_file_request, - build_beta_agents_get_candidate_file_request, - build_beta_agents_get_optimization_candidate_config_request, - build_beta_agents_get_optimization_candidate_request, - build_beta_agents_get_optimization_candidate_results_request, build_beta_agents_get_optimization_job_request, build_beta_agents_get_session_log_stream_request, build_beta_agents_get_session_request, - build_beta_agents_list_optimization_candidates_request, build_beta_agents_list_optimization_jobs_request, build_beta_agents_list_session_files_request, build_beta_agents_list_sessions_request, build_beta_agents_patch_agent_details_request, - build_beta_agents_promote_candidate_request, build_beta_agents_stop_session_request, build_beta_agents_upload_session_file_request, build_beta_datasets_cancel_generation_job_request, @@ -235,7 +229,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Retrieves the agent. + """Get an agent. + + Retrieves an agent definition by its unique name. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -302,7 +298,9 @@ async def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: async def delete( self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentResponse: - """Deletes an agent. For hosted agents, if any version has active sessions, the request is + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated sessions are cascade-deleted along with the agent and its versions. @@ -383,7 +381,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentDetails"]: - """Returns the list of all agents. + """List agents. + + Returns a paged collection of agent resources. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values are: "prompt", "hosted", "workflow", and "external". Default value is None. @@ -480,7 +480,9 @@ async def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -515,7 +517,9 @@ async def create_version( async def create_version( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -538,7 +542,9 @@ async def create_version( async def create_version( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -569,7 +575,9 @@ async def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -685,7 +693,9 @@ async def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -720,7 +730,9 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -743,7 +755,9 @@ async def create_version_from_manifest( async def create_version_from_manifest( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -774,7 +788,9 @@ async def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -882,7 +898,9 @@ async def create_version_from_manifest( @distributed_trace_async async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Retrieves a specific version of an agent. + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -952,7 +970,9 @@ async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) async def delete_version( self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentVersionResponse: - """Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all sessions associated with this version are cascade-deleted. @@ -1037,7 +1057,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentVersionDetails"]: - """Returns the list of versions of an agent. + """List agent versions. + + Returns a paged collection of versions for the specified agent. :param agent_name: The name of the agent to retrieve versions for. Required. :type agent_name: str @@ -1143,6 +1165,8 @@ def __init__(self, *args, **kwargs) -> None: async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: """Get an evaluation rule. + Retrieves the specified evaluation rule and its configuration. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping @@ -1204,6 +1228,8 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: async def delete(self, id: str, **kwargs: Any) -> None: """Delete an evaluation rule. + Removes the specified evaluation rule from the project. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: None @@ -1254,6 +1280,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1272,6 +1300,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1290,6 +1320,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -1308,6 +1340,8 @@ async def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: @@ -1387,7 +1421,10 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. + """List evaluation rules. + + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. :keyword action_type: Filter by the type of evaluation rule. Known values are: "continuousEvaluation" and "humanEvaluationPreview". Default value is None. @@ -1503,7 +1540,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, without populating connection credentials. + """Get a connection. + + Retrieves the specified connection and its configuration details without including credential + values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -1569,7 +1609,9 @@ async def _get(self, name: str, **kwargs: Any) -> _models.Connection: @distributed_trace_async async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + """Get a connection with credentials. + + Retrieves the specified connection together with its credential values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -1641,13 +1683,16 @@ def list( default_connection: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Connection"]: - """List all connections in the project, without populating connection credentials. + """List connections. - :keyword connection_type: List connections of this specific type. Known values are: + Returns the connections available in the current project, optionally filtered by type or + default status. + + :keyword connection_type: Lists connections of this specific type. Known values are: "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List connections that are default connections. Default value is + :keyword default_connection: Lists connections that are default connections. Default value is None. :paramtype default_connection: bool :return: An iterator like instance of Connection @@ -1756,7 +1801,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List all versions of the given DatasetVersion. + """List versions. + + List all versions of the given DatasetVersion. :param name: The name of the resource. Required. :type name: str @@ -1847,7 +1894,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + """List latest versions. + + List the latest version of each DatasetVersion. :return: An iterator like instance of DatasetVersion :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] @@ -1935,7 +1984,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + """Get a version. + + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -2000,7 +2051,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + """Delete a version. + + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -2060,7 +2113,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2086,7 +2141,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2112,7 +2169,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2132,7 +2191,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2217,7 +2278,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2243,7 +2306,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2269,7 +2334,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2293,7 +2360,9 @@ async def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -2371,7 +2440,9 @@ async def pending_upload( @distributed_trace_async async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + """Get dataset credentials. + + Gets the SAS credential to access the storage account associated with a Dataset version. :param name: The name of the resource. Required. :type name: str @@ -2453,7 +2524,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + """Get a deployment. + + Gets a deployed model. :param name: Name of the deployment. Required. :type name: str @@ -2526,7 +2599,10 @@ def list( deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Deployment"]: - """List all deployed models in the project. + """List deployments. + + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. :keyword model_publisher: Model publisher to filter models by. Default value is None. :paramtype model_publisher: str @@ -2643,7 +2719,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List all versions of the given Index. + """List versions. + + List all versions of the given Index. :param name: The name of the resource. Required. :type name: str @@ -2734,7 +2812,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List the latest version of each Index. + """List latest versions. + + List the latest version of each Index. :return: An iterator like instance of Index :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] @@ -2822,7 +2902,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get the specific version of the Index. The service returns 404 Not Found error if the Index + """Get a version. + + Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. :param name: The name of the resource. Required. @@ -2887,7 +2969,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the Index. The service returns 204 No Content if the Index was + """Delete a version. + + Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. :param name: The name of the resource. Required. @@ -2947,7 +3031,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2967,7 +3053,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -2993,7 +3081,9 @@ async def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -3013,7 +3103,9 @@ async def create_or_update( async def create_or_update( self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -3089,7 +3181,7 @@ async def create_or_update( return deserialized # type: ignore -class BetaAgentsOperations: # pylint: disable=too-many-public-methods +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -3116,7 +3208,9 @@ async def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3136,7 +3230,9 @@ async def patch_agent_details( async def patch_agent_details( self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3154,7 +3250,9 @@ async def patch_agent_details( async def patch_agent_details( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3178,7 +3276,9 @@ async def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3269,7 +3369,12 @@ async def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3292,7 +3397,12 @@ async def create_version_from_code( async def create_version_from_code( self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3320,7 +3430,12 @@ async def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -3404,7 +3519,9 @@ async def create_version_from_code( async def download_code( self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Download the code zip for a code-based hosted agent. + """Download agent code. + + Downloads the code zip for a code-based hosted agent. Returns the previously-uploaded zip (``application/zip``). If ``agent_version`` is supplied, returns that version's code zip; otherwise @@ -3490,7 +3607,9 @@ async def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3522,7 +3641,9 @@ async def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3551,7 +3672,9 @@ async def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3581,7 +3704,9 @@ async def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -3676,7 +3801,9 @@ async def create_session( async def get_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Retrieves a session by ID. + """Get a session. + + Retrieves the details of a hosted agent session by agent name and session identifier. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3750,7 +3877,9 @@ async def get_session( async def delete_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + """Delete a session. + + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist. :param agent_name: The name of the agent. Required. @@ -3810,7 +3939,10 @@ async def delete_session( @distributed_trace_async async def stop_session(self, agent_name: str, session_id: str, **kwargs: Any) -> None: - """Stops a session. Returns 204 No Content when the stop succeeds. + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3874,7 +4006,9 @@ def list_sessions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentSessionResource"]: - """Returns a list of sessions for the specified agent. + """List sessions for an agent. + + Returns a paged collection of sessions associated with the specified agent endpoint. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -3966,7 +4100,9 @@ async def get_next(_continuation_token=None): async def get_session_log_stream( self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any ) -> _models.SessionLogEvent: - """Streams console logs (stdout / stderr) for a specific hosted agent session + """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: @@ -4074,8 +4210,10 @@ async def _upload_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.SessionFileWriteResult: - """Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads - exceeding this limit return 413 Payload Too Large. + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4166,7 +4304,10 @@ async def download_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - """Download a file from the session sandbox as a binary stream. + """Download a session file. + + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4250,9 +4391,11 @@ def list_session_files( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SessionDirectoryEntry"]: - """List files and directories at a given path in the session sandbox. Returns only the immediate - children of the specified directory (non-recursive). If path is not provided, lists the session - home directory. + """List session files. + + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4359,8 +4502,10 @@ async def delete_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Delete a file or directory from the session sandbox. If ``recursive`` is false (default) and - the target is a non-empty directory, the API returns 409 Conflict. + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -4428,7 +4573,7 @@ async def delete_session_file( @overload async def create_optimization_job( self, - inputs: _models.OptimizationJobInputs, + job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -4439,8 +4584,8 @@ async def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.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 @@ -4454,15 +4599,15 @@ async def create_optimization_job( @overload async def create_optimization_job( - self, inputs: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: JSON + :param job: The job to create. Required. + :type job: JSON :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 @@ -4477,7 +4622,7 @@ async def create_optimization_job( @overload async def create_optimization_job( self, - inputs: IO[bytes], + job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -4488,8 +4633,8 @@ async def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: IO[bytes] + :param job: The job to create. Required. + :type job: 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 @@ -4503,20 +4648,16 @@ async def create_optimization_job( @distributed_trace_async async def create_optimization_job( - self, - inputs: Union[_models.OptimizationJobInputs, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any + self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Is one of the following types: - OptimizationJobInputs, JSON, IO[bytes] Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs or JSON or IO[bytes] + :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] :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 @@ -4540,10 +4681,10 @@ async def create_optimization_job( content_type = content_type or "application/json" _content = None - if isinstance(inputs, (IOBase, bytes)): - _content = inputs + if isinstance(job, (IOBase, bytes)): + _content = job else: - _content = json.dumps(inputs, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_agents_create_optimization_job_request( operation_id=operation_id, @@ -4597,7 +4738,7 @@ async def create_optimization_job( async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: """Get info about an agent optimization job. - Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + Get an optimization job by id. :param job_id: The ID of the job. Required. :type job_id: str @@ -4637,7 +4778,7 @@ async def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Opti response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -4673,7 +4814,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationJob"]: + ) -> AsyncItemPaged["_models.OptimizationJobListItem"]: """Returns a list of agent optimization jobs. List optimization jobs. Supports cursor pagination and optional status / agent_name filters. @@ -4697,14 +4838,15 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJob - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJob] + :return: An iterator like instance of OptimizationJobListItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4736,7 +4878,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJob], + List[_models.OptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -4760,465 +4902,21 @@ async def get_next(_continuation_token=None): ) raise HttpResponseError(response=response, model=error) - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: - """Cancels an agent optimization job. - - Request cancellation. Idempotent on terminal states. - - :param job_id: The ID of the job to cancel. Required. - :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - - _request = build_beta_agents_cancel_optimization_job_request( - job_id=job_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_optimization_job(self, job_id: str, *, force: Optional[bool] = None, **kwargs: Any) -> None: - """Deletes an agent optimization job. - - Delete the job and its candidate artifacts. Cancels first if non-terminal. - - :param job_id: The ID of the job to delete. Required. - :type job_id: str - :keyword force: When true, force-delete even if the job is in a non-terminal state. Default - value is None. - :paramtype force: bool - :return: None - :rtype: None - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_beta_agents_delete_optimization_job_request( - job_id=job_id, - force=force, - api_version=self._config.api_version, - 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) - - _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 [204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_optimization_candidate( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_candidate_file( - self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Get a candidate file. + async def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + """Cancels an agent optimization job. - Stream a specific file from the candidate's blob directory. + Request cancellation of a running or queued job. Returns an error if the job is already in a + terminal state. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to cancel. Required. :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5232,12 +4930,10 @@ async def get_candidate_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - _request = build_beta_agents_get_candidate_file_request( + _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5248,7 +4944,7 @@ async def get_candidate_file( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -5268,122 +4964,26 @@ async def get_candidate_file( ) raise HttpResponseError(response=response, model=error) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. + async def delete_optimization_job(self, job_id: str, **kwargs: Any) -> None: + """Deletes an agent optimization job. - Promotes a candidate, recording the deployment timestamp and target agent version. + Delete the job and its candidate artifacts. Cancels first if non-terminal. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to delete. Required. :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5394,25 +4994,14 @@ async def promote_candidate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agents_promote_candidate_request( + _request = build_beta_agents_delete_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -5421,20 +5010,14 @@ async def promote_candidate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -5442,15 +5025,8 @@ async def promote_candidate( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore class BetaEvaluationTaxonomiesOperations: @@ -5472,7 +5048,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: - """Get an evaluation run by name. + """Get an evaluation taxonomy. + + Retrieves the specified evaluation taxonomy. :param name: The name of the resource. Required. :type name: str @@ -5537,6 +5115,9 @@ def list( ) -> AsyncItemPaged["_models.EvaluationTaxonomy"]: """List evaluation taxonomies. + Returns the evaluation taxonomies available in the project, optionally filtered by input name + or input type. + :keyword input_name: Filter by the evaluation input name. Default value is None. :paramtype input_name: str :keyword input_type: Filter by taxonomy input type. Default value is None. @@ -5629,7 +5210,9 @@ async def get_next(next_link=None): @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> None: - """Delete an evaluation taxonomy by name. + """Delete an evaluation taxonomy. + + Removes the specified evaluation taxonomy from the project. :param name: The name of the resource. Required. :type name: str @@ -5681,6 +5264,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5699,6 +5284,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5717,6 +5304,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5735,6 +5324,8 @@ async def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -5811,6 +5402,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5829,6 +5422,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5847,6 +5442,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -5865,6 +5462,8 @@ async def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -5962,7 +5561,9 @@ def list_versions( limit: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. + """List evaluator versions. + + Returns the available versions for the specified evaluator. :param name: The name of the resource. Required. :type name: str @@ -6068,7 +5669,9 @@ def list( limit: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + """List latest evaluator versions. + + Lists the latest version of each evaluator. :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default @@ -6165,8 +5768,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + """Get an evaluator version. + + Retrieves the specified evaluator version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -6230,8 +5834,9 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.E @distributed_trace_async async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. + """Delete an evaluator version. + + Removes the specified evaluator version. Returns 204 whether the version existed or not. :param name: The name of the resource. Required. :type name: str @@ -6289,7 +5894,9 @@ async def create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6307,7 +5914,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6325,7 +5934,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6343,7 +5954,9 @@ async def create_version( async def create_version( self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -6425,7 +6038,9 @@ async def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6445,7 +6060,9 @@ async def update_version( async def update_version( self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6471,7 +6088,9 @@ async def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6495,7 +6114,9 @@ async def update_version( evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -6580,7 +6201,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6606,7 +6230,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6632,7 +6259,10 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6656,7 +6286,10 @@ async def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -6746,7 +6379,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6772,7 +6408,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6798,7 +6437,10 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6822,7 +6464,10 @@ async def get_credentials( credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -6911,7 +6556,7 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6933,7 +6578,7 @@ async def create_generation_job( async def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6960,7 +6605,7 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -6986,7 +6631,7 @@ async def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -7072,7 +6717,7 @@ async def create_generation_job( @distributed_trace_async async def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Get info about an evaluator generation job. + """Get an evaluator generation job. Gets the details of an evaluator generation job by its ID. @@ -7149,9 +6794,11 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorGenerationJob"]: - """Returns a list of evaluator generation jobs. + """List evaluator generation jobs. - Returns a list of evaluator generation jobs. + Returns a list of evaluator generation jobs. The List API has up to a few seconds of + propagation delay, so a recently created job may not appear immediately; use the Get evaluator + generation job API with the job ID to retrieve a specific job without delay. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -7235,7 +6882,7 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Cancels an evaluator generation job. + """Cancel an evaluator generation job. Cancels an evaluator generation job by its ID. @@ -7302,7 +6949,9 @@ async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Eva @distributed_trace_async async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: - """Deletes an evaluator generation job by its ID. Deletes the job record only; the generated + """Delete an evaluator generation job. + + Deletes an evaluator generation job by its ID. Deletes the job record only; the generated evaluator (if any) is preserved. :param job_id: The ID of the job to delete. Required. @@ -7375,7 +7024,9 @@ def __init__(self, *args, **kwargs) -> None: async def generate( self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7392,7 +7043,9 @@ async def generate( async def generate( self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7409,7 +7062,9 @@ async def generate( async def generate( self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -7424,7 +7079,9 @@ async def generate( @distributed_trace_async async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: - """Generate Insights. + """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. @@ -7501,7 +7158,9 @@ async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwa async def get( self, insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any ) -> _models.Insight: - """Get a specific insight by Id. + """Get an insight. + + Retrieves the specified insight report and its results. :param insight_id: The unique identifier for the insights report. Required. :type insight_id: str @@ -7579,7 +7238,9 @@ def list( include_coordinates: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + """List insights. + + Returns insights in reverse chronological order, with the most recent entries first. :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". Default value is None. @@ -7717,6 +7378,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7740,6 +7403,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -7756,6 +7421,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -7779,6 +7446,8 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + 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] :keyword name: The name of the memory store. Required. @@ -7877,6 +7546,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -7898,6 +7569,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -7916,6 +7589,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -7940,6 +7615,8 @@ async def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :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. @@ -8023,7 +7700,9 @@ async def update( @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + """Get a memory store. + + Retrieves the specified memory store and its current configuration. :param name: The name of the memory store to retrieve. Required. :type name: str @@ -8095,7 +7774,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + """List memory stores. + + Returns the memory stores available to the caller. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -8180,6 +7861,8 @@ async def get_next(_continuation_token=None): async def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: """Delete a memory store. + Deletes the specified memory store. + :param name: The name of the memory store to delete. Required. :type name: str :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping @@ -8274,7 +7957,9 @@ async def _search_memories( options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + """Search memories. + + Searches the specified memory store for memories relevant to the provided conversation context. :param name: The name of the memory store to search. Required. :type name: str @@ -8482,7 +8167,10 @@ async def _begin_update_memories( update_delay: Optional[int] = None, **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + """Update memories. + + Starts an update that writes conversation memories into the specified memory store. The + operation returns a long-running status location for polling the update result. :param name: The name of the memory store to update. Required. :type name: str @@ -8573,7 +8261,9 @@ def get_long_running_output(pipeline_response): async def delete_scope( self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8593,7 +8283,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8612,7 +8304,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8631,7 +8325,9 @@ async def delete_scope( async def delete_scope( self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -8726,7 +8422,9 @@ async def create_memory( content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8750,7 +8448,9 @@ async def create_memory( async def create_memory( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8768,7 +8468,9 @@ async def create_memory( async def create_memory( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8793,7 +8495,9 @@ async def create_memory( kind: Union[str, _models.MemoryItemKind] = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -8889,7 +8593,9 @@ async def create_memory( async def update_memory( self, name: str, memory_id: str, *, content: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8909,7 +8615,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8929,7 +8637,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -8949,7 +8659,9 @@ async def update_memory( async def update_memory( self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9036,7 +8748,9 @@ async def update_memory( @distributed_trace_async async def get_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.MemoryItem: - """Retrieve a memory item from a memory store. + """Get a memory item. + + Retrieves the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9115,7 +8829,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9160,7 +8876,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9204,7 +8922,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9248,7 +8968,9 @@ def list_memories( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -9365,7 +9087,9 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: - """Delete a memory item from a memory store. + """Delete a memory item. + + Deletes the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -9451,7 +9175,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.ModelVersion"]: - """List all versions of the given ModelVersion. + """List versions. + + List all versions of the given ModelVersion. :param name: The name of the resource. Required. :type name: str @@ -9542,7 +9268,9 @@ async def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelVersion"]: - """List the latest version of each ModelVersion. + """List latest versions. + + List the latest version of each ModelVersion. :return: An iterator like instance of ModelVersion :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.ModelVersion] @@ -9630,8 +9358,9 @@ async def get_next(next_link=None): @distributed_trace_async async def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: - """Get the specific version of the ModelVersion. The service returns 404 Not Found error if the - ModelVersion does not exist. + """Get a model version. + + Retrieves the specified model version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -9695,7 +9424,9 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVers @distributed_trace_async async def delete(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion + """Delete a model version. + + Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. :param name: The name of the resource. Required. @@ -9755,7 +9486,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9782,7 +9515,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9809,7 +9544,9 @@ async def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9834,7 +9571,9 @@ async def update( model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -9921,8 +9660,10 @@ async def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9942,8 +9683,10 @@ async def pending_create_version( async def pending_create_version( self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9969,8 +9712,10 @@ async def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -9990,8 +9735,10 @@ async def pending_create_version( async def pending_create_version( self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -10079,7 +9826,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10106,7 +9855,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10133,7 +9884,9 @@ async def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10158,7 +9911,9 @@ async def pending_upload( pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -10245,7 +10000,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10271,7 +10028,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10297,7 +10056,9 @@ async def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10321,7 +10082,9 @@ async def get_credentials( credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -10416,7 +10179,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: - """Get a redteam by name. + """Get a redteam. + + Retrieves the specified redteam and its configuration. :param name: Identifier of the red team run. Required. :type name: str @@ -10477,7 +10242,9 @@ async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: @distributed_trace def list(self, **kwargs: Any) -> AsyncItemPaged["_models.RedTeam"]: - """List a redteam by name. + """List redteams. + + Returns the redteams available in the current project. :return: An iterator like instance of RedTeam :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RedTeam] @@ -10567,7 +10334,9 @@ async def get_next(next_link=None): async def create( self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: ~azure.ai.projects.models.RedTeam @@ -10581,7 +10350,9 @@ async def create( @overload async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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 @@ -10597,7 +10368,9 @@ async def create(self, red_team: JSON, *, content_type: str = "application/json" async def create( self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: IO[bytes] @@ -10611,7 +10384,9 @@ async def create( @distributed_trace_async async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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. @@ -10716,6 +10491,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -10741,6 +10518,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -10759,6 +10538,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -10785,6 +10566,8 @@ async def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :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. @@ -10872,7 +10655,9 @@ async def create_or_update( @distributed_trace_async async def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: - """Retrieve a routine. + """Get a routine. + + Retrieves the specified routine and its current configuration. :param routine_name: The unique name of the routine. Required. :type routine_name: str @@ -10939,6 +10724,8 @@ async def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: async def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Enable a routine. + Enables the specified routine so it can be dispatched. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -11004,6 +10791,8 @@ async def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: async def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Disable a routine. + Disables the specified routine so it no longer runs. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -11071,6 +10860,8 @@ def list( ) -> AsyncItemPaged["_models.Routine"]: """List routines. + Returns the routines available in the current project. + :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int :keyword before: Unsupported. Reserved for future backward pagination support. Default value is @@ -11148,6 +10939,8 @@ async def get_next(_continuation_token=None): async def delete(self, routine_name: str, **kwargs: Any) -> None: """Delete a routine. + Deletes the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: None @@ -11209,6 +11002,8 @@ def list_runs( ) -> AsyncItemPaged["_models.RoutineRun"]: """List prior runs for a routine. + Returns prior runs recorded for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword filter: An optional MLflow search-runs filter expression applied within the routine's @@ -11300,6 +11095,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11319,6 +11116,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -11337,6 +11136,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -11360,6 +11161,8 @@ async def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :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. @@ -11461,6 +11264,8 @@ def __init__(self, *args, **kwargs) -> None: async def delete(self, schedule_id: str, **kwargs: Any) -> None: """Delete a schedule. + Deletes the specified schedule resource. + :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :return: None @@ -11507,7 +11312,9 @@ async def delete(self, schedule_id: str, **kwargs: Any) -> None: @distributed_trace_async async def get(self, schedule_id: str, **kwargs: Any) -> _models.Schedule: - """Get a schedule by id. + """Get a schedule. + + Retrieves the specified schedule resource. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11574,7 +11381,9 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.Schedule"]: - """List all schedules. + """List schedules. + + Returns schedules that match the supplied type and enabled filters. :keyword type: Filter by the type of schedule. Known values are: "Evaluation" and "Insight". Default value is None. @@ -11671,7 +11480,9 @@ async def get_next(next_link=None): async def create_or_update( self, schedule_id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11689,7 +11500,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11707,7 +11520,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11725,7 +11540,9 @@ async def create_or_update( async def create_or_update( self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -11799,7 +11616,9 @@ async def create_or_update( @distributed_trace_async async def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: - """Get a schedule run by id. + """Get a schedule run. + + Retrieves the specified run for a schedule. :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str @@ -11874,7 +11693,9 @@ def list_runs( enabled: Optional[bool] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ScheduleRun"]: - """List all schedule runs. + """List schedule runs. + + Returns schedule runs that match the supplied filters. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -12001,7 +11822,9 @@ async def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12031,7 +11854,9 @@ async def create_version( async def create_version( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12050,7 +11875,9 @@ async def create_version( async def create_version( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12078,7 +11905,9 @@ async def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -12182,6 +12011,8 @@ async def create_version( async def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: """Retrieve a toolbox. + Retrieves the specified toolbox and its current configuration. + :param name: The name of the toolbox to retrieve. Required. :type name: str :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping @@ -12252,7 +12083,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ToolboxObject"]: - """List all toolboxes. + """List toolboxes. + + Returns the toolboxes available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -12343,7 +12176,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ToolboxVersionObject"]: - """List all versions of a toolbox. + """List toolbox versions. + + Returns the available versions for the specified toolbox. :param name: The name of the toolbox to list versions for. Required. :type name: str @@ -12431,6 +12266,8 @@ async def get_next(_continuation_token=None): async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: """Retrieve a specific version of a toolbox. + Retrieves the specified version of a toolbox by name and version identifier. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -12501,6 +12338,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :keyword default_version: The version identifier that the toolbox should point to. When set, @@ -12520,6 +12359,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -12538,6 +12379,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -12556,6 +12399,8 @@ async def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :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. @@ -12639,7 +12484,9 @@ async def update( @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> None: - """Delete a toolbox and all its versions. + """Delete a toolbox. + + Removes the specified toolbox along with all of its versions. :param name: The name of the toolbox to delete. Required. :type name: str @@ -12693,6 +12540,8 @@ async def delete(self, name: str, **kwargs: Any) -> None: async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: """Delete a specific version of a toolbox. + Removes the specified version of a toolbox. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to delete. Required. @@ -12764,7 +12613,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, name: str, **kwargs: Any) -> _models.SkillDetails: - """Retrieves a skill. + """Retrieve a skill. + + Retrieves the specified skill and its current configuration. :param name: The unique name of the skill. Required. :type name: str @@ -12836,7 +12687,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SkillDetails"]: - """Returns the list of all skills. + """List skills. + + Returns the skills available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -12923,6 +12776,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :keyword default_version: The version identifier that the skill should point to. When set, the @@ -12942,6 +12797,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -12960,6 +12817,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -12978,6 +12837,8 @@ async def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :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. @@ -13061,7 +12922,9 @@ async def update( @distributed_trace_async async def delete(self, name: str, **kwargs: Any) -> _models.DeleteSkillResult: - """Deletes a skill. + """Delete a skill. + + Removes the specified skill and its associated versions. :param name: The unique name of the skill. Required. :type name: str @@ -13134,7 +12997,9 @@ async def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13155,7 +13020,9 @@ async def create( async def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13173,7 +13040,9 @@ async def create( async def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13197,7 +13066,9 @@ async def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -13284,7 +13155,9 @@ async def create( async def create_from_files( self, name: str, content: _models.CreateSkillVersionFromFilesBody, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13297,7 +13170,9 @@ async def create_from_files( @overload async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13312,7 +13187,9 @@ async def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _m async def create_from_files( self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -13393,7 +13270,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SkillVersion"]: - """List all versions of a skill. + """List skill versions. + + Returns the available versions for the specified skill. :param name: The name of the skill to list versions for. Required. :type name: str @@ -13481,6 +13360,8 @@ async def get_next(_continuation_token=None): async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVersion: """Retrieve a specific version of a skill. + Retrieves the specified version of a skill by name and version identifier. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -13549,6 +13430,8 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.S async def download(self, name: str, **kwargs: Any) -> AsyncIterator[bytes]: """Download the zip content for the default version of a skill. + Downloads the zip content for the default version of a skill. + :param name: The name of the skill. Required. :type name: str :return: AsyncIterator[bytes] @@ -13614,6 +13497,8 @@ async def download(self, name: str, **kwargs: Any) -> AsyncIterator[bytes]: async def download_version(self, name: str, version: str, **kwargs: Any) -> AsyncIterator[bytes]: """Download the zip content for a specific version of a skill. + Downloads the zip content for a specific version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version to download content for. Required. @@ -13682,6 +13567,8 @@ async def download_version(self, name: str, version: str, **kwargs: Any) -> Asyn async def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.DeleteSkillVersionResult: """Delete a specific version of a skill. + Removes the specified version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to delete. Required. @@ -13767,9 +13654,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Get info about a data generation job. + """Get a data generation job. - Gets the details of a data generation job by its ID. + Retrieves the specified data generation job and its current status. :param job_id: The ID of the job. Required. :type job_id: str @@ -13844,7 +13731,7 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.DataGenerationJob"]: - """Returns a list of data generation jobs. + """List data generation jobs. Returns a list of data generation jobs. @@ -13936,9 +13823,9 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: ~azure.ai.projects.models.DataGenerationJob @@ -13957,9 +13844,9 @@ async def create_generation_job( async def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: JSON @@ -13983,9 +13870,9 @@ async def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: IO[bytes] @@ -14008,9 +13895,9 @@ async def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates 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. @@ -14093,9 +13980,9 @@ async def create_generation_job( @distributed_trace_async async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Cancels a data generation job. + """Cancel a data generation job. - Cancels a data generation job by its ID. + Cancels the specified data generation job if it is still in progress. :param job_id: The ID of the job to cancel. Required. :type job_id: str @@ -14160,9 +14047,9 @@ async def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Dat @distributed_trace_async async def delete_generation_job(self, job_id: str, **kwargs: Any) -> None: - """Deletes a data generation job. + """Delete a data generation job. - Deletes a data generation job by its ID. + Removes the specified data generation job and its associated output. :param job_id: The ID of the job to delete. Required. :type job_id: str 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 0379362a10a5..692d897c2926 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 @@ -27,7 +27,6 @@ AgentEndpointAuthorizationScheme, AgentEndpointConfig, AgentEvaluatorGenerationJobSource, - AgentIdentifier, AgentIdentity, AgentObjectVersions, AgentSessionResource, @@ -66,10 +65,6 @@ BrowserAutomationPreviewTool, BrowserAutomationToolConnectionParameters, BrowserAutomationToolParameters, - CandidateDeployConfig, - CandidateFileInfo, - CandidateMetadata, - CandidateResults, CaptureStructuredOutputsTool, ChartCoordinate, ChatSummaryMemoryItem, @@ -116,8 +111,6 @@ DatasetCredential, DatasetDataGenerationJobOutput, DatasetEvaluatorGenerationJobSource, - DatasetInfo, - DatasetRef, DatasetReference, DatasetVersion, DeleteAgentResponse, @@ -246,20 +239,24 @@ OpenApiProjectConnectionAuthDetails, OpenApiProjectConnectionSecurityScheme, OpenApiTool, - OptimizationAgentDefinition, + OptimizationAgentIdentifier, OptimizationCandidate, + OptimizationDatasetCriterion, + OptimizationDatasetInput, + OptimizationDatasetItem, + OptimizationEvaluatorRef, + OptimizationInlineDatasetInput, OptimizationJob, OptimizationJobInputs, + OptimizationJobListItem, OptimizationJobProgress, OptimizationJobResult, OptimizationOptions, - OptimizationTaskResult, + OptimizationReferenceDatasetInput, OtlpTelemetryEndpoint, PendingUploadRequest, PendingUploadResponse, ProceduralMemoryItem, - PromoteCandidateRequest, - PromoteCandidateResponse, PromotionInfo, PromptAgentDefinition, PromptAgentDefinitionTextOptions, @@ -415,6 +412,7 @@ MemoryStoreUpdateStatus, OpenApiAuthType, OperationState, + OptimizationDatasetInputType, PageOrder, PendingUploadType, RankerVersionType, @@ -463,7 +461,6 @@ "AgentEndpointAuthorizationScheme", "AgentEndpointConfig", "AgentEvaluatorGenerationJobSource", - "AgentIdentifier", "AgentIdentity", "AgentObjectVersions", "AgentSessionResource", @@ -502,10 +499,6 @@ "BrowserAutomationPreviewTool", "BrowserAutomationToolConnectionParameters", "BrowserAutomationToolParameters", - "CandidateDeployConfig", - "CandidateFileInfo", - "CandidateMetadata", - "CandidateResults", "CaptureStructuredOutputsTool", "ChartCoordinate", "ChatSummaryMemoryItem", @@ -552,8 +545,6 @@ "DatasetCredential", "DatasetDataGenerationJobOutput", "DatasetEvaluatorGenerationJobSource", - "DatasetInfo", - "DatasetRef", "DatasetReference", "DatasetVersion", "DeleteAgentResponse", @@ -682,20 +673,24 @@ "OpenApiProjectConnectionAuthDetails", "OpenApiProjectConnectionSecurityScheme", "OpenApiTool", - "OptimizationAgentDefinition", + "OptimizationAgentIdentifier", "OptimizationCandidate", + "OptimizationDatasetCriterion", + "OptimizationDatasetInput", + "OptimizationDatasetItem", + "OptimizationEvaluatorRef", + "OptimizationInlineDatasetInput", "OptimizationJob", "OptimizationJobInputs", + "OptimizationJobListItem", "OptimizationJobProgress", "OptimizationJobResult", "OptimizationOptions", - "OptimizationTaskResult", + "OptimizationReferenceDatasetInput", "OtlpTelemetryEndpoint", "PendingUploadRequest", "PendingUploadResponse", "ProceduralMemoryItem", - "PromoteCandidateRequest", - "PromoteCandidateResponse", "PromotionInfo", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", @@ -848,6 +843,7 @@ "MemoryStoreUpdateStatus", "OpenApiAuthType", "OperationState", + "OptimizationDatasetInputType", "PageOrder", "PendingUploadType", "RankerVersionType", 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 bc29c0a8b58d..53716def91a6 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 @@ -49,8 +49,8 @@ class _FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DATA_GENERATION_JOBS_V1_PREVIEW.""" MODELS_V1_PREVIEW = "Models=V1Preview" """MODELS_V1_PREVIEW.""" - AGENTS_OPTIMIZATION_V1_PREVIEW = "AgentsOptimization=V1Preview" - """AGENTS_OPTIMIZATION_V1_PREVIEW.""" + AGENTS_OPTIMIZATION_V2_PREVIEW = "AgentsOptimization=V2Preview" + """AGENTS_OPTIMIZATION_V2_PREVIEW.""" class AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -123,6 +123,8 @@ class AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ACTIVITY_PROTOCOL.""" RESPONSES = "responses" """RESPONSES.""" + A2A = "a2a" + """A2A.""" MCP = "mcp" """MCP.""" INVOCATIONS = "invocations" @@ -792,6 +794,15 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been canceled by the user.""" +class OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Discriminator values for the dataset input union.""" + + INLINE = "inline" + """Inline dataset — items are provided directly in the request body.""" + REFERENCE = "reference" + """Reference to a registered Foundry dataset by name and version.""" + + class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of PageOrder.""" 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 368fad6a64fd..8c31b279e262 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 @@ -39,6 +39,7 @@ MemoryStoreKind, MemoryStoreObjectType, OpenApiAuthType, + OptimizationDatasetInputType, PendingUploadType, RecurrenceType, RoutineActionType, @@ -858,40 +859,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore -class AgentIdentifier(_Model): - """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Registered Foundry agent name (required). Required.""" - agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pinned agent version. Defaults to latest if omitted.""" - - @overload - def __init__( - self, - *, - agent_name: str, - agent_version: 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 AgentIdentity(_Model): """AgentIdentity. @@ -2648,208 +2615,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CandidateDeployConfig(_Model): - """Deploy-config blob for a candidate. Suitable for setting OPTIMIZATION_CONFIG on a hosted-agent - version. - - :ivar instructions: System prompt / instructions. - :vartype instructions: str - :ivar model: Foundry deployment name. - :vartype model: str - :ivar temperature: Optional sampling temperature. - :vartype temperature: float - :ivar skills: Optional skill overrides. - :vartype skills: list[dict[str, any]] - :ivar tools: Optional tool overrides. - :vartype tools: list[dict[str, any]] - """ - - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """System prompt / instructions.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Foundry deployment name.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional sampling temperature.""" - skills: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional skill overrides.""" - tools: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional tool overrides.""" - - @overload - def __init__( - self, - *, - instructions: Optional[str] = None, - model: Optional[str] = None, - temperature: Optional[float] = None, - skills: Optional[list[dict[str, Any]]] = None, - tools: Optional[list[dict[str, Any]]] = 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 CandidateFileInfo(_Model): - """File entry in a candidate's blob directory. - - :ivar path: Relative path of the file. Required. - :vartype path: str - :ivar type: File type category (e.g. 'config', 'results'). Required. - :vartype type: str - :ivar size_bytes: File size in bytes. Required. - :vartype size_bytes: int - """ - - path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative path of the file. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File type category (e.g. 'config', 'results'). Required.""" - size_bytes: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File size in bytes. Required.""" - - @overload - def __init__( - self, - *, - path: str, - type: str, - size_bytes: int, - ) -> 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 CandidateMetadata(_Model): - """Candidate metadata returned by GET /candidates/{id}. - - :ivar candidate_id: Server-assigned candidate identifier. Required. - :vartype candidate_id: str - :ivar job_id: Owning optimization job id. Required. - :vartype job_id: str - :ivar candidate_name: Display name of the candidate. Required. - :vartype candidate_name: str - :ivar status: Candidate lifecycle status. Required. - :vartype status: str - :ivar score: Candidate's aggregate score. - :vartype score: float - :ivar has_results: Whether detailed results are available for this candidate. Required. - :vartype has_results: bool - :ivar created_at: Timestamp when the candidate was created, represented in Unix time. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: Timestamp when the candidate was last updated, represented in Unix time. - Required. - :vartype updated_at: ~datetime.datetime - :ivar promotion: Promotion metadata. Null if not promoted. - :vartype promotion: ~azure.ai.projects.models.PromotionInfo - :ivar files: Files in the candidate's blob directory. Required. - :vartype files: list[~azure.ai.projects.models.CandidateFileInfo] - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server-assigned candidate identifier. Required.""" - job_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Owning optimization job id. Required.""" - candidate_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Display name of the candidate. Required.""" - status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate lifecycle status. Required.""" - score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Candidate's aggregate score.""" - has_results: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether detailed results are available for this candidate. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when the candidate was created, represented in Unix time. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when the candidate was last updated, represented in Unix time. Required.""" - promotion: Optional["_models.PromotionInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Promotion metadata. Null if not promoted.""" - files: list["_models.CandidateFileInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Files in the candidate's blob directory. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - job_id: str, - candidate_name: str, - status: str, - has_results: bool, - created_at: datetime.datetime, - updated_at: datetime.datetime, - files: list["_models.CandidateFileInfo"], - score: Optional[float] = None, - promotion: Optional["_models.PromotionInfo"] = 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 CandidateResults(_Model): - """Full per-task evaluation results for a candidate, returned by GET /candidates/{id}/results. - - :ivar candidate_id: Owning candidate id. Required. - :vartype candidate_id: str - :ivar results: Per-task evaluation rows. Required. - :vartype results: list[~azure.ai.projects.models.OptimizationTaskResult] - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Owning candidate id. Required.""" - results: list["_models.OptimizationTaskResult"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-task evaluation rows. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - results: list["_models.OptimizationTaskResult"], - ) -> 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 CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): """A tool for capturing structured outputs. @@ -5099,83 +4864,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluatorGenerationJobSourceType.DATASET # type: ignore -class DatasetInfo(_Model): - """Metadata about the dataset used for optimization, surfaced in the response. - - :ivar name: Dataset name when using a registered dataset reference. Null for inline datasets. - :vartype name: str - :ivar version: Dataset version when using a registered dataset reference. Null for inline - datasets. - :vartype version: str - :ivar task_count: Number of tasks/rows in the dataset. Required. - :vartype task_count: int - :ivar is_inline: True when the dataset was provided inline in the request body. Required. - :vartype is_inline: bool - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name when using a registered dataset reference. Null for inline datasets.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version when using a registered dataset reference. Null for inline datasets.""" - task_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of tasks/rows in the dataset. Required.""" - is_inline: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """True when the dataset was provided inline in the request body. Required.""" - - @overload - def __init__( - self, - *, - task_count: int, - is_inline: bool, - name: Optional[str] = None, - version: 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 DatasetRef(_Model): - """Reference to a registered dataset in the Foundry Dataset Service. - - :ivar name: Dataset name. Required. - :vartype name: str - :ivar version: Dataset version. If not specified, the latest version is used. - :vartype version: str - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset name. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Dataset version. If not specified, the latest version is used.""" - - @overload - def __init__( - self, - *, - name: str, - version: 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 DatasetReference(_Model): """Reference to a versioned Foundry Dataset. @@ -6858,6 +6546,12 @@ class EvaluatorVersion(_Model): :vartype evaluator_type: str or ~azure.ai.projects.models.EvaluatorType :ivar categories: The categories of the evaluator. Required. :vartype categories: list[str or ~azure.ai.projects.models.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[str or ~azure.ai.projects.models.EvaluationLevel] :ivar definition: Definition of the evaluator. Required. :vartype definition: ~azure.ai.projects.models.EvaluatorDefinition :ivar generation_artifacts: Provenance artifacts from the generation pipeline. Read-only; @@ -6893,6 +6587,13 @@ class EvaluatorVersion(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The categories of the evaluator. Required.""" + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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: "_models.EvaluatorDefinition" = rest_field(visibility=["read", "create"]) """Definition of the evaluator. Required.""" generation_artifacts: Optional["_models.EvaluatorGenerationArtifacts"] = rest_field(visibility=["read"]) @@ -6925,6 +6626,7 @@ def __init__( definition: "_models.EvaluatorDefinition", display_name: Optional[str] = None, metadata: Optional[dict[str, str]] = None, + supported_evaluation_levels: Optional[list[Union[str, "_models.EvaluationLevel"]]] = None, description: Optional[str] = None, tags: Optional[dict[str, str]] = None, ) -> None: ... @@ -10872,46 +10574,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.OPENAPI # type: ignore -class OptimizationAgentDefinition(_Model): - """Agent definition returned in response payloads (includes resolved config). +class OptimizationAgentIdentifier(_Model): + """Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and + system_prompt are specified in options.optimization_config. - :ivar agent_name: Agent name. + :ivar agent_name: Registered Foundry agent name (required). Required. :vartype agent_name: str - :ivar agent_version: Agent version. + :ivar agent_version: Pinned agent version. Defaults to latest if omitted. :vartype agent_version: str - :ivar model: Model deployment name. - :vartype model: str - :ivar system_prompt: System prompt / instructions. - :vartype system_prompt: str - :ivar skills: Agent skills. - :vartype skills: list[dict[str, any]] - :ivar tools: Agent tools. - :vartype tools: list[dict[str, any]] """ - agent_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent name.""" + agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered Foundry agent name (required). Required.""" agent_version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent version.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Model deployment name.""" - system_prompt: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """System prompt / instructions.""" - skills: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent skills.""" - tools: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Agent tools.""" + """Pinned agent version. Defaults to latest if omitted.""" @overload def __init__( self, *, - agent_name: Optional[str] = None, + agent_name: str, agent_version: Optional[str] = None, - model: Optional[str] = None, - system_prompt: Optional[str] = None, - skills: Optional[list[dict[str, Any]]] = None, - tools: Optional[list[dict[str, Any]]] = None, ) -> None: ... @overload @@ -10933,22 +10616,12 @@ class OptimizationCandidate(_Model): :vartype candidate_id: str :ivar name: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required. :vartype name: str - :ivar config: The agent configuration that produced this candidate. Required. - :vartype config: ~azure.ai.projects.models.OptimizationAgentDefinition :ivar mutations: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). - Required. :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 pass_rate: Fraction of tasks that met the pass threshold. Required. - :vartype pass_rate: float - :ivar task_scores: Individual task-level scores. Required. - :vartype task_scores: list[~azure.ai.projects.models.OptimizationTaskResult] - :ivar is_pareto_optimal: Whether this candidate is on the Pareto frontier (score vs cost). - Required. - :vartype is_pareto_optimal: bool :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. @@ -10961,24 +10634,12 @@ class OptimizationCandidate(_Model): """Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Display name of the candidate (e.g., 'baseline', 'instruction-v2'). Required.""" - config: "_models.OptimizationAgentDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The agent configuration that produced this candidate. Required.""" - mutations: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). Required.""" + mutations: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}).""" avg_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Average composite score across all tasks. Required.""" avg_tokens: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Average token usage across all tasks. Required.""" - pass_rate: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Fraction of tasks that met the pass threshold. Required.""" - task_scores: list["_models.OptimizationTaskResult"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Individual task-level scores. Required.""" - is_pareto_optimal: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether this candidate is on the Pareto frontier (score vs cost). Required.""" eval_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Foundry evaluation identifier used to score this candidate.""" eval_run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -10993,14 +10654,10 @@ def __init__( self, *, name: str, - config: "_models.OptimizationAgentDefinition", - mutations: dict[str, Any], avg_score: float, avg_tokens: float, - pass_rate: float, - task_scores: list["_models.OptimizationTaskResult"], - is_pareto_optimal: bool, candidate_id: Optional[str] = None, + mutations: Optional[dict[str, Any]] = None, eval_id: Optional[str] = None, eval_run_id: Optional[str] = None, promotion: Optional["_models.PromotionInfo"] = None, @@ -11017,6 +10674,187 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class OptimizationDatasetCriterion(_Model): + """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion name. Required.""" + instruction: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Criterion instruction / description. Required.""" + + @overload + def __init__( + self, + *, + name: str, + instruction: 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 OptimizationDatasetInput(_Model): + """Base discriminated model for dataset input. Either inline items or a registered reference. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OptimizationInlineDatasetInput, OptimizationReferenceDatasetInput + + :ivar type: Dataset input type discriminator. Required. Known values are: "inline" and + "reference". + :vartype type: str or ~azure.ai.projects.models.OptimizationDatasetInputType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Dataset input type discriminator. Required. Known values are: \"inline\" and \"reference\".""" + + @overload + def __init__( + self, + *, + type: 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 OptimizationDatasetItem(_Model): + """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[~azure.ai.projects.models.OptimizationDatasetCriterion] + """ + + query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user query / prompt.""" + ground_truth: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Expected ground truth answer.""" + desired_num_turns: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Desired number of conversation turns for simulation mode (1-20).""" + criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Per-item evaluation criteria.""" + + @overload + def __init__( + self, + *, + query: Optional[str] = None, + ground_truth: Optional[str] = None, + desired_num_turns: Optional[int] = None, + criteria: Optional[list["_models.OptimizationDatasetCriterion"]] = 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 OptimizationEvaluatorRef(_Model): + """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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Evaluator version. If not specified, the latest version is used.""" + + @overload + def __init__( + self, + *, + name: str, + version: 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 OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator="inline"): + """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: str or ~azure.ai.projects.models.INLINE + :ivar items_property: Dataset items. Required. + :vartype items_property: list[~azure.ai.projects.models.OptimizationDatasetItem] + """ + + type: Literal[OptimizationDatasetInputType.INLINE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Inline dataset — items are provided directly in the + request body.""" + items_property: list["_models.OptimizationDatasetItem"] = rest_field( + name="items", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="items" + ) + """Dataset items. Required.""" + + @overload + def __init__( + self, + *, + items_property: list["_models.OptimizationDatasetItem"], + ) -> 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) + self.type = OptimizationDatasetInputType.INLINE # type: ignore + + class OptimizationJob(_Model): """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 @@ -11024,48 +10862,48 @@ class OptimizationJob(_Model): :ivar id: Server-assigned unique identifier. Required. :vartype id: str + :ivar inputs: Caller-supplied inputs. + :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs + :ivar result: Result produced on success. + :vartype result: ~azure.ai.projects.models.OptimizationJobResult :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", "succeeded", "failed", and "cancelled". :vartype status: str or ~azure.ai.projects.models.JobStatus :ivar error: Error details — populated only on failure. :vartype error: ~azure.ai.projects.models.ApiError - :ivar result: Result produced on success. - :vartype result: ~azure.ai.projects.models.OptimizationJobResult - :ivar inputs: Caller-supplied inputs. - :vartype inputs: ~azure.ai.projects.models.OptimizationJobInputs :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the job was last updated (status, progress, or result - change), represented in Unix time. + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. :vartype updated_at: ~datetime.datetime - :ivar progress: Progress while in flight. Absent in terminal states. + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress - :ivar dataset: Metadata about the dataset used for this optimization job. - :vartype dataset: ~azure.ai.projects.models.DatasetInfo + :ivar warnings: Non-fatal warnings emitted at any point during optimization. + :vartype warnings: list[str] """ id: str = rest_field(visibility=["read"]) """Server-assigned unique identifier. Required.""" + inputs: Optional["_models.OptimizationJobInputs"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Caller-supplied inputs.""" + result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) + """Result produced on success.""" status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", \"succeeded\", \"failed\", and \"cancelled\".""" error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) """Error details — populated only on failure.""" - result: Optional["_models.OptimizationJobResult"] = rest_field(visibility=["read"]) - """Result produced on success.""" - inputs: Optional["_models.OptimizationJobInputs"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Caller-supplied inputs.""" created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") """The timestamp when the job was created, represented in Unix time. Required.""" - updated_at: Optional[datetime.datetime] = rest_field(visibility=["read"], format="unix-timestamp") - """The timestamp when the job was last updated (status, progress, or result change), represented - in Unix time.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) - """Progress while in flight. Absent in terminal states.""" - dataset: Optional["_models.DatasetInfo"] = rest_field(visibility=["read"]) - """Metadata about the dataset used for this optimization job.""" + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + warnings: Optional[list[str]] = rest_field(visibility=["read"]) + """Non-fatal warnings emitted at any point during optimization.""" @overload def __init__( @@ -11089,32 +10927,38 @@ class OptimizationJobInputs(_Model): """Caller-supplied inputs for an optimization job. :ivar agent: The agent (and pinned version) being optimized. Required. - :vartype agent: ~azure.ai.projects.models.AgentIdentifier - :ivar train_dataset_reference: Reference to a registered training dataset (required). Required. - :vartype train_dataset_reference: ~azure.ai.projects.models.DatasetRef - :ivar validation_dataset_reference: Optional held-out validation dataset for measuring - generalization of the final candidate. - :vartype validation_dataset_reference: ~azure.ai.projects.models.DatasetRef - :ivar evaluators: Job-level evaluators (referenced by name). Per-task criteria may override. - Default: ['task_adherence']. - :vartype evaluators: list[str] + :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier + :ivar train_dataset: Training dataset — either inline items or a reference to a registered + dataset. Required. Required. + :vartype train_dataset: ~azure.ai.projects.models.OptimizationDatasetInput + :ivar validation_dataset: Optional held-out validation dataset for measuring generalization of + the final candidate. + :vartype validation_dataset: ~azure.ai.projects.models.OptimizationDatasetInput + :ivar evaluators: Job-level evaluators referenced by name and optional version. Required; at + least one must be provided. Required. + :vartype evaluators: list[~azure.ai.projects.models.OptimizationEvaluatorRef] :ivar options: Tuning knobs and run-mode. :vartype options: ~azure.ai.projects.models.OptimizationOptions """ - agent: "_models.AgentIdentifier" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + agent: "_models.OptimizationAgentIdentifier" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The agent (and pinned version) being optimized. Required.""" - train_dataset_reference: "_models.DatasetRef" = rest_field( + train_dataset: "_models.OptimizationDatasetInput" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Reference to a registered training dataset (required). Required.""" - validation_dataset_reference: Optional["_models.DatasetRef"] = rest_field( + """Training dataset — either inline items or a reference to a registered dataset. Required. + Required.""" + validation_dataset: Optional["_models.OptimizationDatasetInput"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Optional held-out validation dataset for measuring generalization of the final candidate.""" - evaluators: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Job-level evaluators (referenced by name). Per-task criteria may override. Default: - ['task_adherence'].""" + evaluators: list["_models.OptimizationEvaluatorRef"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Job-level evaluators referenced by name and optional version. Required; at least one must be + provided. Required.""" options: Optional["_models.OptimizationOptions"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11124,10 +10968,10 @@ class OptimizationJobInputs(_Model): def __init__( self, *, - agent: "_models.AgentIdentifier", - train_dataset_reference: "_models.DatasetRef", - validation_dataset_reference: Optional["_models.DatasetRef"] = None, - evaluators: Optional[list[str]] = None, + agent: "_models.OptimizationAgentIdentifier", + train_dataset: "_models.OptimizationDatasetInput", + evaluators: list["_models.OptimizationEvaluatorRef"], + validation_dataset: Optional["_models.OptimizationDatasetInput"] = None, options: Optional["_models.OptimizationOptions"] = None, ) -> None: ... @@ -11142,11 +10986,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class OptimizationJobListItem(_Model): + """Slim job representation returned by the LIST endpoint. + + :ivar id: Server-assigned unique identifier. Required. + :vartype id: str + :ivar status: Current lifecycle status. Required. Known values are: "queued", "in_progress", + "succeeded", "failed", and "cancelled". + :vartype status: str or ~azure.ai.projects.models.JobStatus + :ivar error: Error details — populated only on failure. + :vartype error: ~azure.ai.projects.models.ApiError + :ivar created_at: The timestamp when the job was created, represented in Unix time. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the job was last updated, represented in Unix time. + Required. + :vartype updated_at: ~datetime.datetime + :ivar progress: Progress snapshot. May be present in terminal states reflecting last-known + progress. + :vartype progress: ~azure.ai.projects.models.OptimizationJobProgress + :ivar agent: The agent targeted by this optimization job. + :vartype agent: ~azure.ai.projects.models.OptimizationAgentIdentifier + """ + + id: str = rest_field(visibility=["read"]) + """Server-assigned unique identifier. Required.""" + status: Union[str, "_models.JobStatus"] = rest_field(visibility=["read"]) + """Current lifecycle status. Required. Known values are: \"queued\", \"in_progress\", + \"succeeded\", \"failed\", and \"cancelled\".""" + error: Optional["_models.ApiError"] = rest_field(visibility=["read"]) + """Error details — populated only on failure.""" + created_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was created, represented in Unix time. Required.""" + updated_at: datetime.datetime = rest_field(visibility=["read"], format="unix-timestamp") + """The timestamp when the job was last updated, represented in Unix time. Required.""" + progress: Optional["_models.OptimizationJobProgress"] = rest_field(visibility=["read"]) + """Progress snapshot. May be present in terminal states reflecting last-known progress.""" + agent: Optional["_models.OptimizationAgentIdentifier"] = rest_field(visibility=["read"]) + """The agent targeted by this optimization job.""" + + class OptimizationJobProgress(_Model): """In-flight progress; only populated while status is queued or in_progress. - :ivar current_iteration: 1-based current iteration index. Required. - :vartype current_iteration: int + :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. @@ -11154,8 +11038,8 @@ class OptimizationJobProgress(_Model): :vartype elapsed_seconds: float """ - current_iteration: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """1-based current iteration index. Required.""" + candidates_completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of candidates whose evaluation has completed so far. Required.""" best_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Best score observed so far across all candidates. Required.""" elapsed_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -11165,7 +11049,7 @@ class OptimizationJobProgress(_Model): def __init__( self, *, - current_iteration: int, + candidates_completed: int, best_score: float, elapsed_seconds: float, ) -> None: ... @@ -11184,56 +11068,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OptimizationJobResult(_Model): """Terminal-state result body. Populated when status is succeeded or failed. - :ivar baseline: Evaluation scores for the original (un-optimized) agent configuration. - :vartype baseline: ~azure.ai.projects.models.OptimizationCandidate - :ivar best: The highest-scoring candidate found during optimization. - :vartype best: ~azure.ai.projects.models.OptimizationCandidate + :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[~azure.ai.projects.models.OptimizationCandidate] - :ivar options: The options used for this optimization run. - :vartype options: ~azure.ai.projects.models.OptimizationOptions - :ivar warnings: Non-fatal warnings from the optimization run (e.g., target attribute failures - that were skipped). - :vartype warnings: list[str] - :ivar all_target_attributes_failed: True when all target attributes failed — only the baseline - was evaluated. - :vartype all_target_attributes_failed: bool """ - baseline: Optional["_models.OptimizationCandidate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Evaluation scores for the original (un-optimized) agent configuration.""" - best: Optional["_models.OptimizationCandidate"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The highest-scoring candidate found during optimization.""" + baseline: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the original (un-optimized) baseline evaluation.""" + best: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Candidate ID of the highest-scoring candidate found during optimization.""" candidates: Optional[list["_models.OptimizationCandidate"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """All evaluated candidates including baseline.""" - options: Optional["_models.OptimizationOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The options used for this optimization run.""" - warnings: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Non-fatal warnings from the optimization run (e.g., target attribute failures that were - skipped).""" - all_target_attributes_failed: Optional[bool] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """True when all target attributes failed — only the baseline was evaluated.""" @overload def __init__( self, *, - baseline: Optional["_models.OptimizationCandidate"] = None, - best: Optional["_models.OptimizationCandidate"] = None, + baseline: Optional[str] = None, + best: Optional[str] = None, candidates: Optional[list["_models.OptimizationCandidate"]] = None, - options: Optional["_models.OptimizationOptions"] = None, - warnings: Optional[list[str]] = None, - all_target_attributes_failed: Optional[bool] = None, ) -> None: ... @overload @@ -11250,8 +11108,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OptimizationOptions(_Model): """Tuning knobs and run-mode for an optimization job. - :ivar max_iterations: Maximum optimization iterations per strategy. Must be >= 1. Default: 5. - :vartype max_iterations: int + :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] @@ -11267,8 +11126,8 @@ class OptimizationOptions(_Model): :vartype evaluation_level: str or ~azure.ai.projects.models.EvaluationLevel """ - max_iterations: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum optimization iterations per strategy. Must be >= 1. Default: 5.""" + max_candidates: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of optimization candidates to generate. Must be >= 1. Default: 5.""" optimization_config: Optional[dict[str, Any]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11290,7 +11149,7 @@ class OptimizationOptions(_Model): def __init__( self, *, - max_iterations: Optional[int] = None, + max_candidates: Optional[int] = None, optimization_config: Optional[dict[str, Any]] = None, eval_model: Optional[str] = None, optimization_model: Optional[str] = None, @@ -11308,71 +11167,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OptimizationTaskResult(_Model): - """Per-task evaluation result for a single candidate. +class OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator="reference"): + """Reference to a registered Foundry dataset. - :ivar task_name: Task name (from the dataset). Required. - :vartype task_name: str - :ivar query: The user query / input for the task. - :vartype query: str - :ivar scores: Per-evaluator scores keyed by evaluator name. Required. - :vartype scores: dict[str, float] - :ivar composite_score: Composite score combining all evaluator scores. Required. - :vartype composite_score: float - :ivar tokens: Total tokens consumed during the agent run for this task. Required. - :vartype tokens: int - :ivar duration_seconds: Wall-clock seconds for this task's agent execution. Required. - :vartype duration_seconds: float - :ivar passed: Whether the task met the pass threshold. Required. - :vartype passed: bool - :ivar error_message: Error message if the task failed during execution. - :vartype error_message: str - :ivar rationales: Per-evaluator reasoning keyed by evaluator name. - :vartype rationales: dict[str, str] - :ivar response: Raw agent response text. - :vartype response: str - :ivar run_id: Identifier of the agent run that produced this result. - :vartype run_id: str + :ivar type: Dataset input type discriminator. Required. Reference to a registered Foundry + dataset by name and version. + :vartype type: str or ~azure.ai.projects.models.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 """ - task_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Task name (from the dataset). Required.""" - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user query / input for the task.""" - scores: dict[str, float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Per-evaluator scores keyed by evaluator name. Required.""" - composite_score: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Composite score combining all evaluator scores. Required.""" - tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total tokens consumed during the agent run for this task. Required.""" - duration_seconds: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Wall-clock seconds for this task's agent execution. Required.""" - passed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the task met the pass threshold. Required.""" - error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error message if the task failed during execution.""" - rationales: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Per-evaluator reasoning keyed by evaluator name.""" - response: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Raw agent response text.""" - run_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identifier of the agent run that produced this result.""" + type: Literal[OptimizationDatasetInputType.REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Dataset input type discriminator. Required. Reference to a registered Foundry dataset by name + and version.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Registered dataset name. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Dataset version. If not specified, the latest version is used.""" @overload def __init__( self, *, - task_name: str, - scores: dict[str, float], - composite_score: float, - tokens: int, - duration_seconds: float, - passed: bool, - query: Optional[str] = None, - error_message: Optional[str] = None, - rationales: Optional[dict[str, str]] = None, - response: Optional[str] = None, - run_id: Optional[str] = None, + name: str, + version: Optional[str] = None, ) -> None: ... @overload @@ -11384,6 +11204,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OptimizationDatasetInputType.REFERENCE # type: ignore class TelemetryEndpoint(_Model): @@ -11625,89 +11446,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = MemoryItemKind.PROCEDURAL # type: ignore -class PromoteCandidateRequest(_Model): - """Request body for promoting a candidate to a Foundry agent version. - - :ivar agent_name: Name of the Foundry agent to promote to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent to promote to. Required. - :vartype agent_version: str - """ - - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent to promote to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent to promote to. Required.""" - - @overload - def __init__( - self, - *, - agent_name: str, - agent_version: 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 PromoteCandidateResponse(_Model): - """Response after successfully promoting a candidate. - - :ivar candidate_id: The promoted candidate id. Required. - :vartype candidate_id: str - :ivar status: Status after promotion. Required. - :vartype status: str - :ivar promoted_at: Timestamp when promotion occurred, represented in Unix time. Required. - :vartype promoted_at: ~datetime.datetime - :ivar agent_name: Name of the Foundry agent promoted to. Required. - :vartype agent_name: str - :ivar agent_version: Version of the Foundry agent promoted to. Required. - :vartype agent_version: str - """ - - candidate_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The promoted candidate id. Required.""" - status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Status after promotion. Required.""" - promoted_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Timestamp when promotion occurred, represented in Unix time. Required.""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the Foundry agent promoted to. Required.""" - agent_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Foundry agent promoted to. Required.""" - - @overload - def __init__( - self, - *, - candidate_id: str, - status: str, - promoted_at: datetime.datetime, - agent_name: str, - agent_version: 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 PromotionInfo(_Model): """Promotion metadata recorded when a candidate is deployed to a Foundry agent. @@ -12013,7 +11751,7 @@ class ProtocolVersionRecord(_Model): """A record mapping for a single protocol and its version. :ivar protocol: The protocol type. Required. Known values are: "activity_protocol", - "responses", "mcp", "invocations", and "invocations_ws". + "responses", "a2a", "mcp", "invocations", and "invocations_ws". :vartype protocol: str or ~azure.ai.projects.models.AgentProtocol :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. :vartype version: str @@ -12022,8 +11760,8 @@ class ProtocolVersionRecord(_Model): protocol: Union[str, "_models.AgentProtocol"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The protocol type. Required. Known values are: \"activity_protocol\", \"responses\", \"mcp\", - \"invocations\", and \"invocations_ws\".""" + """The protocol type. Required. Known values are: \"activity_protocol\", \"responses\", \"a2a\", + \"mcp\", \"invocations\", and \"invocations_ws\".""" version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The version string for the protocol, e.g. 'v0.1.1'. Required.""" @@ -12444,7 +12182,7 @@ class RoutineRun(_Model): :ivar id: The unique run identifier for the routine attempt. Required. :vartype id: str - :ivar status: The run status. + :ivar status: The run status. Is one of the following types: str :vartype status: str :ivar phase: The AgentExtensions lifecycle phase for the routine attempt. Known values are: "queued", "dispatching", "completed", and "failed". @@ -12497,8 +12235,8 @@ class RoutineRun(_Model): id: str = rest_field(visibility=["read"]) """The unique run identifier for the routine attempt. Required.""" - status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The run status.""" + status: Optional["_types.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"] ) @@ -12564,7 +12302,7 @@ class RoutineRun(_Model): def __init__( self, *, - status: Optional[str] = None, + status: Optional["_types.RoutineRunStatus"] = None, phase: Optional[Union[str, "_models.RoutineRunPhase"]] = None, trigger_type: Optional[Union[str, "_models.RoutineTriggerType"]] = None, trigger_name: Optional[str] = None, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index a907ab276781..532e98b62daf 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -52,7 +52,7 @@ _AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW.value, _AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW.value, _AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW.value, - _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V1_PREVIEW.value, + _FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V2_PREVIEW.value, ] ) 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 e75ce4c9d73f..09319efc0d67 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 @@ -1328,7 +1328,7 @@ def build_beta_agents_cancel_optimization_job_request( # pylint: disable=name-t def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-too-long - job_id: str, *, force: Optional[bool] = None, **kwargs: Any + job_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1342,192 +1342,11 @@ def build_beta_agents_delete_optimization_job_request( # pylint: disable=name-t _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if force is not None: - _params["force"] = _SERIALIZER.query("force", force, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_beta_agents_list_optimization_candidates_request( # pylint: disable=name-too-long - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, - before: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if limit is not None: - _params["limit"] = _SERIALIZER.query("limit", limit, "int") - if order is not None: - _params["order"] = _SERIALIZER.query("order", order, "str") - if after is not None: - _params["after"] = _SERIALIZER.query("after", after, "str") - if before is not None: - _params["before"] = _SERIALIZER.query("before", before, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_config_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/config" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_optimization_candidate_results_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/results" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_get_candidate_file_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, *, path: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/octet-stream") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}/files" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["path"] = _SERIALIZER.query("path", path, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_agents_promote_candidate_request( # pylint: disable=name-too-long - job_id: str, candidate_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agent_optimization_jobs/{jobId}/candidates/{candidateId}:promote" - path_format_arguments = { - "jobId": _SERIALIZER.url("job_id", job_id, "str"), - "candidateId": _SERIALIZER.url("candidate_id", candidate_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_beta_evaluation_taxonomies_get_request( # pylint: disable=name-too-long name: str, **kwargs: Any ) -> HttpRequest: @@ -3839,7 +3658,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: - """Retrieves the agent. + """Get an agent. + + Retrieves an agent definition by its unique name. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -3904,7 +3725,9 @@ def get(self, agent_name: str, **kwargs: Any) -> _models.AgentDetails: @distributed_trace def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any) -> _models.DeleteAgentResponse: - """Deletes an agent. For hosted agents, if any version has active sessions, the request is + """Delete an agent. + + Deletes an agent. For hosted agents, if any version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all associated sessions are cascade-deleted along with the agent and its versions. @@ -3985,7 +3808,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentDetails"]: - """Returns the list of all agents. + """List agents. + + Returns a paged collection of agent resources. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values are: "prompt", "hosted", "workflow", and "external". Default value is None. @@ -4082,7 +3907,9 @@ def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4117,7 +3944,9 @@ def create_version( def create_version( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4140,7 +3969,9 @@ def create_version( def create_version( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4171,7 +4002,9 @@ def create_version( blueprint_reference: Optional[_models.AgentBlueprintReference] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version. + """Create an agent version. + + Creates a new version for the specified agent and returns the created version resource. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4287,7 +4120,9 @@ def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4322,7 +4157,9 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4345,7 +4182,9 @@ def create_version_from_manifest( def create_version_from_manifest( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4376,7 +4215,9 @@ def create_version_from_manifest( description: Optional[str] = None, **kwargs: Any ) -> _models.AgentVersionDetails: - """Create a new agent version from a manifest. + """Create an agent version from manifest. + + Imports the provided manifest to create a new version for the specified agent. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -4484,7 +4325,9 @@ def create_version_from_manifest( @distributed_trace def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.AgentVersionDetails: - """Retrieves a specific version of an agent. + """Get an agent version. + + Retrieves the specified version of an agent by its agent name and version identifier. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -4554,7 +4397,9 @@ def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _mo def delete_version( self, agent_name: str, agent_version: str, *, force: Optional[bool] = None, **kwargs: Any ) -> _models.DeleteAgentVersionResponse: - """Deletes a specific version of an agent. For hosted agents, if the version has active sessions, + """Delete an agent version. + + Deletes a specific version of an agent. For hosted agents, if the version has active sessions, the request is rejected with HTTP 409 unless ``force`` is set to true. When force is true, all sessions associated with this version are cascade-deleted. @@ -4639,7 +4484,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentVersionDetails"]: - """Returns the list of versions of an agent. + """List agent versions. + + Returns a paged collection of versions for the specified agent. :param agent_name: The name of the agent to retrieve versions for. Required. :type agent_name: str @@ -4745,6 +4592,8 @@ def __init__(self, *args, **kwargs) -> None: def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: """Get an evaluation rule. + Retrieves the specified evaluation rule and its configuration. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping @@ -4806,6 +4655,8 @@ def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete an evaluation rule. + Removes the specified evaluation rule from the project. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :return: None @@ -4856,6 +4707,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4874,6 +4727,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4892,6 +4747,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Required. @@ -4910,6 +4767,8 @@ def create_or_update( ) -> _models.EvaluationRule: """Create or update an evaluation rule. + Creates a new evaluation rule, or replaces the existing rule when the identifier matches. + :param id: Unique identifier for the evaluation rule. Required. :type id: str :param evaluation_rule: Evaluation rule resource. Is one of the following types: @@ -4989,7 +4848,10 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. + """List evaluation rules. + + Returns the evaluation rules configured for the project, optionally filtered by action type, + agent name, or enabled state. :keyword action_type: Filter by the type of evaluation rule. Known values are: "continuousEvaluation" and "humanEvaluationPreview". Default value is None. @@ -5105,7 +4967,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def _get(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, without populating connection credentials. + """Get a connection. + + Retrieves the specified connection and its configuration details without including credential + values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -5171,7 +5036,9 @@ def _get(self, name: str, **kwargs: Any) -> _models.Connection: @distributed_trace def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + """Get a connection with credentials. + + Retrieves the specified connection together with its credential values. :param name: The friendly name of the connection, provided by the user. Required. :type name: str @@ -5243,13 +5110,16 @@ def list( default_connection: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Connection"]: - """List all connections in the project, without populating connection credentials. + """List connections. - :keyword connection_type: List connections of this specific type. Known values are: + Returns the connections available in the current project, optionally filtered by type or + default status. + + :keyword connection_type: Lists connections of this specific type. Known values are: "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool_Preview". Default value is None. :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List connections that are default connections. Default value is + :keyword default_connection: Lists connections that are default connections. Default value is None. :paramtype default_connection: bool :return: An iterator like instance of Connection @@ -5358,7 +5228,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List all versions of the given DatasetVersion. + """List versions. + + List all versions of the given DatasetVersion. :param name: The name of the resource. Required. :type name: str @@ -5449,7 +5321,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + """List latest versions. + + List the latest version of each DatasetVersion. :return: An iterator like instance of DatasetVersion :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] @@ -5537,7 +5411,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + """Get a version. + + Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -5602,7 +5478,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the DatasetVersion. The service returns 204 No Content if the + """Delete a version. + + Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. :param name: The name of the resource. Required. @@ -5662,7 +5540,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5688,7 +5568,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5714,7 +5596,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5734,7 +5618,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + """Create or update a version. + + Create a new or update an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -5819,7 +5705,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5845,7 +5733,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5871,7 +5761,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5895,7 +5787,9 @@ def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified dataset version. :param name: The name of the resource. Required. :type name: str @@ -5973,7 +5867,9 @@ def pending_upload( @distributed_trace def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + """Get dataset credentials. + + Gets the SAS credential to access the storage account associated with a Dataset version. :param name: The name of the resource. Required. :type name: str @@ -6055,7 +5951,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + """Get a deployment. + + Gets a deployed model. :param name: Name of the deployment. Required. :type name: str @@ -6128,7 +6026,10 @@ def list( deployment_type: Optional[Union[str, _models.DeploymentType]] = None, **kwargs: Any ) -> ItemPaged["_models.Deployment"]: - """List all deployed models in the project. + """List deployments. + + Returns the deployed models available in the current project, optionally filtered by publisher, + model name, or deployment type. :keyword model_publisher: Model publisher to filter models by. Default value is None. :paramtype model_publisher: str @@ -6245,7 +6146,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List all versions of the given Index. + """List versions. + + List all versions of the given Index. :param name: The name of the resource. Required. :type name: str @@ -6336,7 +6239,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List the latest version of each Index. + """List latest versions. + + List the latest version of each Index. :return: An iterator like instance of Index :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] @@ -6424,7 +6329,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """Get the specific version of the Index. The service returns 404 Not Found error if the Index + """Get a version. + + Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. :param name: The name of the resource. Required. @@ -6489,7 +6396,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the Index. The service returns 204 No Content if the Index was + """Delete a version. + + Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. :param name: The name of the resource. Required. @@ -6549,7 +6458,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6569,7 +6480,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6595,7 +6508,9 @@ def create_or_update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6615,7 +6530,9 @@ def create_or_update( def create_or_update( self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + """Create or update a version. + + Create a new or update an existing Index with the given version id. :param name: The name of the resource. Required. :type name: str @@ -6691,7 +6608,7 @@ def create_or_update( return deserialized # type: ignore -class BetaAgentsOperations: # pylint: disable=too-many-public-methods +class BetaAgentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -6718,7 +6635,9 @@ def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6738,7 +6657,9 @@ def patch_agent_details( def patch_agent_details( self, agent_name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6756,7 +6677,9 @@ def patch_agent_details( def patch_agent_details( self, agent_name: str, body: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6780,7 +6703,9 @@ def patch_agent_details( agent_card: Optional[_models.AgentCard] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates an agent endpoint. + """Update an agent endpoint. + + Applies a merge-patch update to the specified agent endpoint configuration. :param agent_name: The name of the agent to retrieve. Required. :type agent_name: str @@ -6871,7 +6796,12 @@ def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -6894,7 +6824,12 @@ def create_version_from_code( def create_version_from_code( self, agent_name: str, content: JSON, *, code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -6922,7 +6857,12 @@ def create_version_from_code( code_zip_sha256: str, **kwargs: Any ) -> _models.AgentVersionDetails: - """create_version_from_code. + """Create an agent version from code. + + Creates a new agent version from code. Uploads the code zip and creates a new version for an + existing agent. The SHA-256 hex digest of the zip is provided in the ``x-ms-code-zip-sha256`` + header for integrity and dedup. The request body is multipart/form-data with a JSON metadata + part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB. :param agent_name: The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. @@ -7004,7 +6944,9 @@ def create_version_from_code( @distributed_trace def download_code(self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any) -> Iterator[bytes]: - """Download the code zip for a code-based hosted agent. + """Download agent code. + + Downloads the code zip for a code-based hosted agent. Returns the previously-uploaded zip (``application/zip``). If ``agent_version`` is supplied, returns that version's code zip; otherwise @@ -7090,7 +7032,9 @@ def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7122,7 +7066,9 @@ def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7151,7 +7097,9 @@ def create_session( content_type: str = "application/json", **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7181,7 +7129,9 @@ def create_session( agent_session_id: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Creates a new session for an agent endpoint. The endpoint resolves the backing agent version + """Create a session. + + Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from ``version_indicator`` and enforces session ownership using the provided isolation key for session-mutating operations. @@ -7276,7 +7226,9 @@ def create_session( def get_session( self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.AgentSessionResource: - """Retrieves a session by ID. + """Get a session. + + Retrieves the details of a hosted agent session by agent name and session identifier. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7350,7 +7302,9 @@ def get_session( def delete_session( # pylint: disable=inconsistent-return-statements self, agent_name: str, session_id: str, *, user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not + """Delete a session. + + Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist. :param agent_name: The name of the agent. Required. @@ -7412,7 +7366,10 @@ def delete_session( # pylint: disable=inconsistent-return-statements def stop_session( # pylint: disable=inconsistent-return-statements self, agent_name: str, session_id: str, **kwargs: Any ) -> None: - """Stops a session. Returns 204 No Content when the stop succeeds. + """Stop a session. + + Terminates the specified hosted agent session and returns 204 No Content when the request + succeeds. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7476,7 +7433,9 @@ def list_sessions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentSessionResource"]: - """Returns a list of sessions for the specified agent. + """List sessions for an agent. + + Returns a paged collection of sessions associated with the specified agent endpoint. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7568,7 +7527,9 @@ def get_next(_continuation_token=None): def get_session_log_stream( self, agent_name: str, agent_version: str, session_id: str, **kwargs: Any ) -> _models.SessionLogEvent: - """Streams console logs (stdout / stderr) for a specific hosted agent session + """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: @@ -7676,8 +7637,10 @@ def _upload_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> _models.SessionFileWriteResult: - """Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads - exceeding this limit return 413 Payload Too Large. + """Upload a session file. + + Uploads binary file content to the specified path in the session sandbox. The service stores + the file relative to the session home directory and rejects payloads larger than 50 MB. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7768,7 +7731,10 @@ def download_session_file( user_isolation_key: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: - """Download a file from the session sandbox as a binary stream. + """Download a session file. + + Downloads the file at the specified sandbox path as a binary stream. The path is resolved + relative to the session home directory. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7852,9 +7818,11 @@ def list_session_files( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SessionDirectoryEntry"]: - """List files and directories at a given path in the session sandbox. Returns only the immediate - children of the specified directory (non-recursive). If path is not provided, lists the session - home directory. + """List session files. + + Returns files and directories at the specified path in the session sandbox. The response + includes only the immediate children of the target directory and defaults to the session home + directory when no path is supplied. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -7960,8 +7928,10 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements user_isolation_key: Optional[str] = None, **kwargs: Any ) -> None: - """Delete a file or directory from the session sandbox. If ``recursive`` is false (default) and - the target is a non-empty directory, the API returns 409 Conflict. + """Delete a session file. + + Deletes the specified file or directory from the session sandbox. When ``recursive`` is false, + deleting a non-empty directory returns 409 Conflict. :param agent_name: The name of the agent. Required. :type agent_name: str @@ -8029,7 +7999,7 @@ def delete_session_file( # pylint: disable=inconsistent-return-statements @overload def create_optimization_job( self, - inputs: _models.OptimizationJobInputs, + job: _models.OptimizationJob, *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -8040,8 +8010,8 @@ def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs + :param job: The job to create. Required. + :type job: ~azure.ai.projects.models.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 @@ -8055,15 +8025,15 @@ def create_optimization_job( @overload def create_optimization_job( - self, inputs: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any + self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: JSON + :param job: The job to create. Required. + :type job: JSON :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 @@ -8078,7 +8048,7 @@ def create_optimization_job( @overload def create_optimization_job( self, - inputs: IO[bytes], + job: IO[bytes], *, operation_id: Optional[str] = None, content_type: str = "application/json", @@ -8089,8 +8059,8 @@ def create_optimization_job( Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Required. - :type inputs: IO[bytes] + :param job: The job to create. Required. + :type job: 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 @@ -8104,20 +8074,16 @@ def create_optimization_job( @distributed_trace def create_optimization_job( - self, - inputs: Union[_models.OptimizationJobInputs, JSON, IO[bytes]], - *, - operation_id: Optional[str] = None, - **kwargs: Any + self, job: Union[_models.OptimizationJob, JSON, IO[bytes]], *, operation_id: Optional[str] = None, **kwargs: Any ) -> _models.OptimizationJob: """Creates an agent optimization job. Create an optimization job. Returns 201 with the queued job. Honours ``Operation-Id`` for idempotent retry. - :param inputs: The optimization job inputs. Is one of the following types: - OptimizationJobInputs, JSON, IO[bytes] Required. - :type inputs: ~azure.ai.projects.models.OptimizationJobInputs or JSON or IO[bytes] + :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] :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 @@ -8141,10 +8107,10 @@ def create_optimization_job( content_type = content_type or "application/json" _content = None - if isinstance(inputs, (IOBase, bytes)): - _content = inputs + if isinstance(job, (IOBase, bytes)): + _content = job else: - _content = json.dumps(inputs, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(job, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_agents_create_optimization_job_request( operation_id=operation_id, @@ -8198,7 +8164,7 @@ def create_optimization_job( def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: """Get info about an agent optimization job. - Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + Get an optimization job by id. :param job_id: The ID of the job. Required. :type job_id: str @@ -8238,7 +8204,7 @@ def get_optimization_job(self, job_id: str, **kwargs: Any) -> _models.Optimizati response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -8274,7 +8240,7 @@ def list_optimization_jobs( status: Optional[Union[str, _models.JobStatus]] = None, agent_name: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.OptimizationJob"]: + ) -> ItemPaged["_models.OptimizationJobListItem"]: """Returns a list of agent optimization jobs. List optimization jobs. Supports cursor pagination and optional status / agent_name filters. @@ -8298,14 +8264,14 @@ def list_optimization_jobs( :paramtype status: str or ~azure.ai.projects.models.JobStatus :keyword agent_name: Filter to jobs targeting this agent name. Default value is None. :paramtype agent_name: str - :return: An iterator like instance of OptimizationJob - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJob] + :return: An iterator like instance of OptimizationJobListItem + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationJobListItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.OptimizationJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.OptimizationJobListItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8337,7 +8303,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.OptimizationJob], + List[_models.OptimizationJobListItem], deserialized.get("data", []), ) if cls: @@ -8363,460 +8329,19 @@ def get_next(_continuation_token=None): return pipeline_response - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: - """Cancels an agent optimization job. - - Request cancellation. Idempotent on terminal states. - - :param job_id: The ID of the job to cancel. Required. - :type job_id: str - :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.OptimizationJob - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - - _request = build_beta_agents_cancel_optimization_job_request( - job_id=job_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OptimizationJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_optimization_job( # pylint: disable=inconsistent-return-statements - self, job_id: str, *, force: Optional[bool] = None, **kwargs: Any - ) -> None: - """Deletes an agent optimization job. - - Delete the job and its candidate artifacts. Cancels first if non-terminal. - - :param job_id: The ID of the job to delete. Required. - :type job_id: str - :keyword force: When true, force-delete even if the job is in a non-terminal state. Default - value is None. - :paramtype force: bool - :return: None - :rtype: None - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_beta_agents_delete_optimization_job_request( - job_id=job_id, - force=force, - api_version=self._config.api_version, - 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) - - _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 [204]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) - - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: - """Get a candidate file. + def cancel_optimization_job(self, job_id: str, **kwargs: Any) -> _models.OptimizationJob: + """Cancels an agent optimization job. - Stream a specific file from the candidate's blob directory. + Request cancellation of a running or queued job. Returns an error if the job is already in a + terminal state. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to cancel. Required. :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] + :return: OptimizationJob. The OptimizationJob is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.OptimizationJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8830,12 +8355,10 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.OptimizationJob] = kwargs.pop("cls", None) - _request = build_beta_agents_get_candidate_file_request( + _request = build_beta_agents_cancel_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - path=path, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8846,7 +8369,7 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", True) + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -8866,122 +8389,28 @@ def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwa ) raise HttpResponseError(response=response, model=error) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OptimizationJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. + def delete_optimization_job( # pylint: disable=inconsistent-return-statements + self, job_id: str, **kwargs: Any + ) -> None: + """Deletes an agent optimization job. - Promotes a candidate, recording the deployment timestamp and target agent version. + Delete the job and its candidate artifacts. Cancels first if non-terminal. - :param job_id: The optimization job id. Required. + :param job_id: The ID of the job to delete. Required. :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8992,25 +8421,14 @@ def promote_candidate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_beta_agents_promote_candidate_request( + _request = build_beta_agents_delete_optimization_job_request( job_id=job_id, - candidate_id=candidate_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9019,20 +8437,14 @@ def promote_candidate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ApiErrorResponse, @@ -9040,15 +8452,8 @@ def promote_candidate( ) raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore class BetaEvaluationTaxonomiesOperations: @@ -9070,7 +8475,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: - """Get an evaluation run by name. + """Get an evaluation taxonomy. + + Retrieves the specified evaluation taxonomy. :param name: The name of the resource. Required. :type name: str @@ -9135,6 +8542,9 @@ def list( ) -> ItemPaged["_models.EvaluationTaxonomy"]: """List evaluation taxonomies. + Returns the evaluation taxonomies available in the project, optionally filtered by input name + or input type. + :keyword input_name: Filter by the evaluation input name. Default value is None. :paramtype input_name: str :keyword input_type: Filter by taxonomy input type. Default value is None. @@ -9227,7 +8637,9 @@ def get_next(next_link=None): @distributed_trace def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an evaluation taxonomy by name. + """Delete an evaluation taxonomy. + + Removes the specified evaluation taxonomy from the project. :param name: The name of the resource. Required. :type name: str @@ -9279,6 +8691,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9297,6 +8711,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9315,6 +8731,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9333,6 +8751,8 @@ def create( ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. + Creates or replaces the specified evaluation taxonomy with the provided definition. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -9409,6 +8829,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9427,6 +8849,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9445,6 +8869,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Required. @@ -9463,6 +8889,8 @@ def update( ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. + Update an evaluation taxonomy. + :param name: The name of the evaluation taxonomy. Required. :type name: str :param taxonomy: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, @@ -9560,7 +8988,9 @@ def list_versions( limit: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. + """List evaluator versions. + + Returns the available versions for the specified evaluator. :param name: The name of the resource. Required. :type name: str @@ -9666,7 +9096,9 @@ def list( limit: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + """List latest evaluator versions. + + Lists the latest version of each evaluator. :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default @@ -9763,8 +9195,9 @@ def get_next(next_link=None): @distributed_trace def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + """Get an evaluator version. + + Retrieves the specified evaluator version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -9830,8 +9263,9 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Evaluat def delete_version( # pylint: disable=inconsistent-return-statements self, name: str, version: str, **kwargs: Any ) -> None: - """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. + """Delete an evaluator version. + + Removes the specified evaluator version. Returns 204 whether the version existed or not. :param name: The name of the resource. Required. :type name: str @@ -9889,7 +9323,9 @@ def create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9907,7 +9343,9 @@ def create_version( def create_version( self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9925,7 +9363,9 @@ def create_version( def create_version( self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -9943,7 +9383,9 @@ def create_version( def create_version( self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + """Create an evaluator version. + + Creates a new evaluator version with an auto-incremented version identifier. :param name: The name of the resource. Required. :type name: str @@ -10025,7 +9467,9 @@ def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10045,7 +9489,9 @@ def update_version( def update_version( self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10071,7 +9517,9 @@ def update_version( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10095,7 +9543,9 @@ def update_version( evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + """Update an evaluator version. + + Updates the specified evaluator version in place. :param name: The name of the resource. Required. :type name: str @@ -10180,7 +9630,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10206,7 +9659,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10232,7 +9688,10 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10256,7 +9715,10 @@ def pending_upload( pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of an evaluator for a specific version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified evaluator + version. :param name: Required. :type name: str @@ -10346,7 +9808,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10372,7 +9837,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10398,7 +9866,10 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10422,7 +9893,10 @@ def get_credentials( credential_request: Union[_models.EvaluatorCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with an Evaluator version. + """Get evaluator credentials. + + Retrieves SAS credentials for accessing the storage account associated with the specified + evaluator version. :param name: Required. :type name: str @@ -10511,7 +9985,7 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10533,7 +10007,7 @@ def create_generation_job( def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10560,7 +10034,7 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10586,7 +10060,7 @@ def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.EvaluatorGenerationJob: - """Creates an evaluator generation job. + """Create an evaluator generation job. Creates an evaluator generation job. The service generates rubric-based evaluator definitions from the provided source materials asynchronously. @@ -10672,7 +10146,7 @@ def create_generation_job( @distributed_trace def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Get info about an evaluator generation job. + """Get an evaluator generation job. Gets the details of an evaluator generation job by its ID. @@ -10749,9 +10223,11 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorGenerationJob"]: - """Returns a list of evaluator generation jobs. + """List evaluator generation jobs. - Returns a list of evaluator generation jobs. + Returns a list of evaluator generation jobs. The List API has up to a few seconds of + propagation delay, so a recently created job may not appear immediately; use the Get evaluator + generation job API with the job ID to retrieve a specific job without delay. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -10834,7 +10310,7 @@ def get_next(_continuation_token=None): @distributed_trace def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.EvaluatorGenerationJob: - """Cancels an evaluator generation job. + """Cancel an evaluator generation job. Cancels an evaluator generation job by its ID. @@ -10903,7 +10379,9 @@ def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.Evaluator def delete_generation_job( # pylint: disable=inconsistent-return-statements self, job_id: str, **kwargs: Any ) -> None: - """Deletes an evaluator generation job by its ID. Deletes the job record only; the generated + """Delete an evaluator generation job. + + Deletes an evaluator generation job by its ID. Deletes the job record only; the generated evaluator (if any) is preserved. :param job_id: The ID of the job to delete. Required. @@ -10976,7 +10454,9 @@ def __init__(self, *args, **kwargs) -> None: def generate( self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -10991,7 +10471,9 @@ def generate( @overload def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -11006,7 +10488,9 @@ def generate(self, insight: JSON, *, content_type: str = "application/json", **k @overload def generate(self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + """Generate insights. + + Generates an insights report from the provided evaluation configuration. :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. @@ -11021,7 +10505,9 @@ 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: - """Generate Insights. + """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. @@ -11096,7 +10582,9 @@ def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: A @distributed_trace def get(self, insight_id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: - """Get a specific insight by Id. + """Get an insight. + + Retrieves the specified insight report and its results. :param insight_id: The unique identifier for the insights report. Required. :type insight_id: str @@ -11174,7 +10662,9 @@ def list( include_coordinates: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + """List insights. + + Returns insights in reverse chronological order, with the most recent entries first. :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". Default value is None. @@ -11312,6 +10802,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -11335,6 +10827,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11351,6 +10845,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + Creates a memory store resource with the provided configuration. + :param body: Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -11374,6 +10870,8 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. + 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] :keyword name: The name of the memory store. Required. @@ -11472,6 +10970,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -11493,6 +10993,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -11511,6 +11013,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :param name: The name of the memory store to update. Required. :type name: str :param body: Required. @@ -11535,6 +11039,8 @@ def update( ) -> _models.MemoryStoreDetails: """Update a memory store. + Updates the specified memory store with the supplied configuration changes. + :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. @@ -11618,7 +11124,9 @@ def update( @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + """Get a memory store. + + Retrieves the specified memory store and its current configuration. :param name: The name of the memory store to retrieve. Required. :type name: str @@ -11690,7 +11198,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + """List memory stores. + + Returns the memory stores available to the caller. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -11775,6 +11285,8 @@ def get_next(_continuation_token=None): def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: """Delete a memory store. + Deletes the specified memory store. + :param name: The name of the memory store to delete. Required. :type name: str :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping @@ -11869,7 +11381,9 @@ def _search_memories( options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + """Search memories. + + Searches the specified memory store for memories relevant to the provided conversation context. :param name: The name of the memory store to search. Required. :type name: str @@ -12077,7 +11591,10 @@ def _begin_update_memories( update_delay: Optional[int] = None, **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + """Update memories. + + Starts an update that writes conversation memories into the specified memory store. The + operation returns a long-running status location for polling the update result. :param name: The name of the memory store to update. Required. :type name: str @@ -12167,7 +11684,9 @@ def get_long_running_output(pipeline_response): def delete_scope( self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12187,7 +11706,9 @@ def delete_scope( def delete_scope( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12206,7 +11727,9 @@ def delete_scope( def delete_scope( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12225,7 +11748,9 @@ def delete_scope( def delete_scope( self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + """Delete memories by scope. + + Deletes all memories in the specified memory store that are associated with the provided scope. :param name: The name of the memory store. Required. :type name: str @@ -12320,7 +11845,9 @@ def create_memory( content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12344,7 +11871,9 @@ def create_memory( def create_memory( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12362,7 +11891,9 @@ def create_memory( def create_memory( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12387,7 +11918,9 @@ def create_memory( kind: Union[str, _models.MemoryItemKind] = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Create a memory item in a memory store. + """Create a memory item. + + Creates a memory item in the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12483,7 +12016,9 @@ def create_memory( def update_memory( self, name: str, memory_id: str, *, content: str, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12503,7 +12038,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12523,7 +12060,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12543,7 +12082,9 @@ def update_memory( def update_memory( self, name: str, memory_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, content: str = _Unset, **kwargs: Any ) -> _models.MemoryItem: - """Update a memory item in a memory store. + """Update a memory item. + + Updates the specified memory item in the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12630,7 +12171,9 @@ def update_memory( @distributed_trace def get_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.MemoryItem: - """Retrieve a memory item from a memory store. + """Get a memory item. + + Retrieves the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -12709,7 +12252,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12754,7 +12299,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12798,7 +12345,9 @@ def list_memories( content_type: str = "application/json", **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12842,7 +12391,9 @@ def list_memories( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.MemoryItem"]: - """List all memory items in a memory store. + """List memory items. + + Returns memory items from the specified memory store. :param name: The name of the memory store. Required. :type name: str @@ -12959,7 +12510,9 @@ def get_next(_continuation_token=None): @distributed_trace def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: - """Delete a memory item from a memory store. + """Delete a memory item. + + Deletes the specified memory item from the memory store. :param name: The name of the memory store. Required. :type name: str @@ -13045,7 +12598,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.ModelVersion"]: - """List all versions of the given ModelVersion. + """List versions. + + List all versions of the given ModelVersion. :param name: The name of the resource. Required. :type name: str @@ -13136,7 +12691,9 @@ def get_next(next_link=None): @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.ModelVersion"]: - """List the latest version of each ModelVersion. + """List latest versions. + + List the latest version of each ModelVersion. :return: An iterator like instance of ModelVersion :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.ModelVersion] @@ -13224,8 +12781,9 @@ def get_next(next_link=None): @distributed_trace def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: - """Get the specific version of the ModelVersion. The service returns 404 Not Found error if the - ModelVersion does not exist. + """Get a model version. + + Retrieves the specified model version, returning 404 if it does not exist. :param name: The name of the resource. Required. :type name: str @@ -13289,7 +12847,9 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.ModelVersion: @distributed_trace def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion + """Delete a model version. + + Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. :param name: The name of the resource. Required. @@ -13349,7 +12909,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13376,7 +12938,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13403,7 +12967,9 @@ def update( content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13428,7 +12994,9 @@ def update( model_version_update: Union[_models.UpdateModelVersionRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelVersion: - """Update an existing ModelVersion with the given version id. + """Update a model version. + + Update an existing ModelVersion with the given version id. :param name: The name of the resource. Required. :type name: str @@ -13515,8 +13083,10 @@ def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13536,8 +13106,10 @@ def pending_create_version( def pending_create_version( self, name: str, version: str, model_version: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13563,8 +13135,10 @@ def pending_create_version( content_type: str = "application/json", **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13584,8 +13158,10 @@ def pending_create_version( def pending_create_version( self, name: str, version: str, model_version: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any ) -> _models.CreateAsyncResponse: - """Creates a model version asynchronously with blob content validation. Returns 202 Accepted with - a Location header for polling. + """Create a model version async. + + Creates a model version asynchronously with blob content validation. Returns 202 Accepted with + a location header for polling the operation status. :param name: Name of the model. Required. :type name: str @@ -13673,7 +13249,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13700,7 +13278,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13727,7 +13307,9 @@ def pending_upload( content_type: str = "application/json", **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13752,7 +13334,9 @@ def pending_upload( pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.ModelPendingUploadResponse: - """Start or retrieve a pending upload for a model version. + """Start a pending upload. + + Initiates a new pending upload or retrieves an existing one for the specified model version. :param name: Name of the model. Required. :type name: str @@ -13839,7 +13423,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13865,7 +13451,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13891,7 +13479,9 @@ def get_credentials( content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -13915,7 +13505,9 @@ def get_credentials( credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any ) -> _models.DatasetCredential: - """Get credentials for a model version asset. + """Get model asset credentials. + + Retrieves temporary credentials for accessing the storage backing the specified model version. :param name: Name of the model. Required. :type name: str @@ -14010,7 +13602,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.RedTeam: - """Get a redteam by name. + """Get a redteam. + + Retrieves the specified redteam and its configuration. :param name: Identifier of the red team run. Required. :type name: str @@ -14071,7 +13665,9 @@ def get(self, name: str, **kwargs: Any) -> _models.RedTeam: @distributed_trace def list(self, **kwargs: Any) -> ItemPaged["_models.RedTeam"]: - """List a redteam by name. + """List redteams. + + Returns the redteams available in the current project. :return: An iterator like instance of RedTeam :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RedTeam] @@ -14161,7 +13757,9 @@ def get_next(next_link=None): def create( self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: - """Creates a redteam run. + """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: ~azure.ai.projects.models.RedTeam @@ -14175,7 +13773,9 @@ def create( @overload def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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 @@ -14189,7 +13789,9 @@ def create(self, red_team: JSON, *, content_type: str = "application/json", **kw @overload def create(self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + """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: IO[bytes] @@ -14203,7 +13805,9 @@ 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: - """Creates a redteam run. + """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. @@ -14308,6 +13912,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -14333,6 +13939,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14351,6 +13959,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14377,6 +13987,8 @@ def create_or_update( ) -> _models.Routine: """Create or update a routine. + Creates a new routine or replaces an existing routine with the supplied definition. + :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. @@ -14464,7 +14076,9 @@ def create_or_update( @distributed_trace def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: - """Retrieve a routine. + """Get a routine. + + Retrieves the specified routine and its current configuration. :param routine_name: The unique name of the routine. Required. :type routine_name: str @@ -14531,6 +14145,8 @@ def get(self, routine_name: str, **kwargs: Any) -> _models.Routine: def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Enable a routine. + Enables the specified routine so it can be dispatched. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -14596,6 +14212,8 @@ def enable(self, routine_name: str, **kwargs: Any) -> _models.Routine: def disable(self, routine_name: str, **kwargs: Any) -> _models.Routine: """Disable a routine. + Disables the specified routine so it no longer runs. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: Routine. The Routine is compatible with MutableMapping @@ -14663,6 +14281,8 @@ def list( ) -> ItemPaged["_models.Routine"]: """List routines. + Returns the routines available in the current project. + :keyword limit: The maximum number of routines to return. Default value is None. :paramtype limit: int :keyword before: Unsupported. Reserved for future backward pagination support. Default value is @@ -14740,6 +14360,8 @@ def get_next(_continuation_token=None): def delete(self, routine_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a routine. + Deletes the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :return: None @@ -14801,6 +14423,8 @@ def list_runs( ) -> ItemPaged["_models.RoutineRun"]: """List prior runs for a routine. + Returns prior runs recorded for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword filter: An optional MLflow search-runs filter expression applied within the routine's @@ -14892,6 +14516,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -14911,6 +14537,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14929,6 +14557,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :param routine_name: The unique name of the routine. Required. :type routine_name: str :param body: Required. @@ -14952,6 +14582,8 @@ def dispatch( ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. + Queues an asynchronous dispatch for the specified routine. + :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. @@ -15053,6 +14685,8 @@ def __init__(self, *args, **kwargs) -> None: def delete(self, schedule_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a schedule. + Deletes the specified schedule resource. + :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str :return: None @@ -15099,7 +14733,9 @@ def delete(self, schedule_id: str, **kwargs: Any) -> None: # pylint: disable=in @distributed_trace def get(self, schedule_id: str, **kwargs: Any) -> _models.Schedule: - """Get a schedule by id. + """Get a schedule. + + Retrieves the specified schedule resource. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15166,7 +14802,9 @@ def list( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.Schedule"]: - """List all schedules. + """List schedules. + + Returns schedules that match the supplied type and enabled filters. :keyword type: Filter by the type of schedule. Known values are: "Evaluation" and "Insight". Default value is None. @@ -15263,7 +14901,9 @@ def get_next(next_link=None): def create_or_update( self, schedule_id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15281,7 +14921,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15299,7 +14941,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15317,7 +14961,9 @@ def create_or_update( def create_or_update( self, schedule_id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update operation template. + """Create or update a schedule. + + Creates a new schedule or updates an existing schedule with the supplied definition. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15391,7 +15037,9 @@ def create_or_update( @distributed_trace def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: - """Get a schedule run by id. + """Get a schedule run. + + Retrieves the specified run for a schedule. :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str @@ -15466,7 +15114,9 @@ def list_runs( enabled: Optional[bool] = None, **kwargs: Any ) -> ItemPaged["_models.ScheduleRun"]: - """List all schedule runs. + """List schedule runs. + + Returns schedule runs that match the supplied filters. :param schedule_id: Identifier of the schedule. Required. :type schedule_id: str @@ -15593,7 +15243,9 @@ def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15623,7 +15275,9 @@ def create_version( def create_version( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15642,7 +15296,9 @@ def create_version( def create_version( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15670,7 +15326,9 @@ def create_version( policies: Optional[_models.ToolboxPolicies] = None, **kwargs: Any ) -> _models.ToolboxVersionObject: - """Create a new version of a toolbox. If the toolbox does not exist, it will be created. + """Create a new version of a toolbox. + + Creates a new toolbox version, provisioning the toolbox itself if it does not already exist. :param name: The name of the toolbox. If the toolbox does not exist, it will be created. Required. @@ -15774,6 +15432,8 @@ def create_version( def get(self, name: str, **kwargs: Any) -> _models.ToolboxObject: """Retrieve a toolbox. + Retrieves the specified toolbox and its current configuration. + :param name: The name of the toolbox to retrieve. Required. :type name: str :return: ToolboxObject. The ToolboxObject is compatible with MutableMapping @@ -15844,7 +15504,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.ToolboxObject"]: - """List all toolboxes. + """List toolboxes. + + Returns the toolboxes available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -15935,7 +15597,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.ToolboxVersionObject"]: - """List all versions of a toolbox. + """List toolbox versions. + + Returns the available versions for the specified toolbox. :param name: The name of the toolbox to list versions for. Required. :type name: str @@ -16023,6 +15687,8 @@ def get_next(_continuation_token=None): def get_version(self, name: str, version: str, **kwargs: Any) -> _models.ToolboxVersionObject: """Retrieve a specific version of a toolbox. + Retrieves the specified version of a toolbox by name and version identifier. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -16093,6 +15759,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :keyword default_version: The version identifier that the toolbox should point to. When set, @@ -16112,6 +15780,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -16130,6 +15800,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :param name: The name of the toolbox to update. Required. :type name: str :param body: Required. @@ -16148,6 +15820,8 @@ def update( ) -> _models.ToolboxObject: """Update a toolbox to point to a specific version. + Updates the toolbox's default version pointer to the specified version. + :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. @@ -16231,7 +15905,9 @@ def update( @distributed_trace def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a toolbox and all its versions. + """Delete a toolbox. + + Removes the specified toolbox along with all of its versions. :param name: The name of the toolbox to delete. Required. :type name: str @@ -16287,6 +15963,8 @@ def delete_version( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a specific version of a toolbox. + Removes the specified version of a toolbox. + :param name: The name of the toolbox. Required. :type name: str :param version: The version identifier to delete. Required. @@ -16358,7 +16036,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, name: str, **kwargs: Any) -> _models.SkillDetails: - """Retrieves a skill. + """Retrieve a skill. + + Retrieves the specified skill and its current configuration. :param name: The unique name of the skill. Required. :type name: str @@ -16430,7 +16110,9 @@ def list( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SkillDetails"]: - """Returns the list of all skills. + """List skills. + + Returns the skills available in the current project. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the @@ -16517,6 +16199,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :keyword default_version: The version identifier that the skill should point to. When set, the @@ -16536,6 +16220,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -16554,6 +16240,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :param name: The name of the skill to update. Required. :type name: str :param body: Required. @@ -16572,6 +16260,8 @@ def update( ) -> _models.SkillDetails: """Update a skill. + Modifies the specified skill's configuration. + :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. @@ -16655,7 +16345,9 @@ def update( @distributed_trace def delete(self, name: str, **kwargs: Any) -> _models.DeleteSkillResult: - """Deletes a skill. + """Delete a skill. + + Removes the specified skill and its associated versions. :param name: The unique name of the skill. Required. :type name: str @@ -16728,7 +16420,9 @@ def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16749,7 +16443,9 @@ def create( def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16767,7 +16463,9 @@ def create( def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16791,7 +16489,9 @@ def create( default: Optional[bool] = None, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill. If the skill does not exist, it will be created. + """Create a new version of a skill. + + Creates a new version of a skill. If the skill does not exist, it will be created. :param name: The name of the skill. If the skill does not exist, it will be created. Required. :type name: str @@ -16878,7 +16578,9 @@ def create( def create_from_files( self, name: str, content: _models.CreateSkillVersionFromFilesBody, **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16891,7 +16593,9 @@ def create_from_files( @overload def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16906,7 +16610,9 @@ def create_from_files(self, name: str, content: JSON, **kwargs: Any) -> _models. def create_from_files( self, name: str, content: Union[_models.CreateSkillVersionFromFilesBody, JSON], **kwargs: Any ) -> _models.SkillVersion: - """Creates a new version of a skill from uploaded files via multipart form data. + """Create a skill version from uploaded files. + + Creates a new version of a skill from uploaded files via multipart form data. :param name: The name of the skill. Required. :type name: str @@ -16987,7 +16693,9 @@ def list_versions( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SkillVersion"]: - """List all versions of a skill. + """List skill versions. + + Returns the available versions for the specified skill. :param name: The name of the skill to list versions for. Required. :type name: str @@ -17075,6 +16783,8 @@ def get_next(_continuation_token=None): def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVersion: """Retrieve a specific version of a skill. + Retrieves the specified version of a skill by name and version identifier. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to retrieve. Required. @@ -17143,6 +16853,8 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.SkillVe def download(self, name: str, **kwargs: Any) -> Iterator[bytes]: """Download the zip content for the default version of a skill. + Downloads the zip content for the default version of a skill. + :param name: The name of the skill. Required. :type name: str :return: Iterator[bytes] @@ -17208,6 +16920,8 @@ def download(self, name: str, **kwargs: Any) -> Iterator[bytes]: def download_version(self, name: str, version: str, **kwargs: Any) -> Iterator[bytes]: """Download the zip content for a specific version of a skill. + Downloads the zip content for a specific version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version to download content for. Required. @@ -17276,6 +16990,8 @@ def download_version(self, name: str, version: str, **kwargs: Any) -> Iterator[b def delete_version(self, name: str, version: str, **kwargs: Any) -> _models.DeleteSkillVersionResult: """Delete a specific version of a skill. + Removes the specified version of a skill. + :param name: The name of the skill. Required. :type name: str :param version: The version identifier to delete. Required. @@ -17361,9 +17077,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Get info about a data generation job. + """Get a data generation job. - Gets the details of a data generation job by its ID. + Retrieves the specified data generation job and its current status. :param job_id: The ID of the job. Required. :type job_id: str @@ -17438,7 +17154,7 @@ def list_generation_jobs( before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.DataGenerationJob"]: - """Returns a list of data generation jobs. + """List data generation jobs. Returns a list of data generation jobs. @@ -17530,9 +17246,9 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: ~azure.ai.projects.models.DataGenerationJob @@ -17551,9 +17267,9 @@ def create_generation_job( def create_generation_job( self, job: JSON, *, operation_id: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: JSON @@ -17577,9 +17293,9 @@ def create_generation_job( content_type: str = "application/json", **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates a data generation job. + Submits a new data generation job for asynchronous execution. :param job: The job to create. Required. :type job: IO[bytes] @@ -17602,9 +17318,9 @@ def create_generation_job( operation_id: Optional[str] = None, **kwargs: Any ) -> _models.DataGenerationJob: - """Creates a data generation job. + """Create a data generation job. - Creates 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. @@ -17687,9 +17403,9 @@ def create_generation_job( @distributed_trace def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGenerationJob: - """Cancels a data generation job. + """Cancel a data generation job. - Cancels a data generation job by its ID. + Cancels the specified data generation job if it is still in progress. :param job_id: The ID of the job to cancel. Required. :type job_id: str @@ -17756,9 +17472,9 @@ def cancel_generation_job(self, job_id: str, **kwargs: Any) -> _models.DataGener def delete_generation_job( # pylint: disable=inconsistent-return-statements self, job_id: str, **kwargs: Any ) -> None: - """Deletes a data generation job. + """Delete a data generation job. - Deletes a data generation job by its ID. + Removes the specified data generation job and its associated output. :param job_id: The ID of the job to delete. Required. :type job_id: str diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 029f54360f28..1001de9c2f8e 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -70,24 +70,8 @@ REM Fix Sphinx docutils warnings in get_session_log_stream docstrings (sync + as REM The emitter wraps bullet/code-block lines with insufficient indentation. powershell -Command "$files='azure\ai\projects\operations\_operations.py','azure\ai\projects\aio\operations\_operations.py'; foreach ($f in $files) { $c=Get-Content $f -Raw; $c=$c -replace 'schema\r?\n\s+is not contractual and may include additional keys or change format\r?\n\s+over time [^\r\n]*clients should treat it as an opaque string\)', 'schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string)'; $c=$c -replace '(message\":\"Starting)\r?\n\s+(FoundryCBAgent server on port 8088\"})', '$1 $2'; $c=$c -replace '(message\":\"INFO: Application)\r?\n\s+(startup complete\.\"})', '$1 $2'; $c=$c -replace '(message\":\"Successfully)\r?\n\s+(connected to container\"})', '$1 $2'; $c=$c -replace '(message\":\"No logs since)\r?\n\s+(last 60 seconds\"})', '$1 $2'; Set-Content $f $c -NoNewline }" -REM Reorder loops in `prepare_multipart_form_data` and synthesize filenames for -REM bare bytes/str/IO file entries (azure\ai\projects\_utils\utils.py). -REM 1) The emitter generates the multipart-file loop before the data-field loop, -REM so JSON metadata parts end up after large binary file parts in the encoded -REM body. Some streaming server-side parsers (e.g. the Foundry hosted-agents -REM `create_agent_version_from_code` endpoint) require the small JSON metadata -REM parts to precede the binary file parts; otherwise they report the metadata -REM part as missing. -REM 2) When callers pass bare bytes (e.g. `Path("x.zip").read_bytes()`) for a -REM multipart file field, the part is emitted without a `filename=` in its -REM Content-Disposition, and servers (e.g. Foundry `create_from_files` for -REM skills) reject it with "At least one file must be uploaded". This rewrite -REM synthesizes a filename for bare bytes/str/IO entries (from `.name` when -REM available, otherwise a stable default) so the part is encoded as a file. -powershell -Command "$f='azure\ai\projects\_utils\utils.py'; $c=Get-Content $f -Raw; if ($c -notmatch '(?m)^import os\r?$') { $c=$c -replace '(?m)^import json\r?$', \"import json`r`nimport os\" }; if ($c -notmatch ':param field_name: The multipart form field name') { $c=$c -replace '(?s)def _normalize_multipart_file_entry\(.*?return \(filename, entry\)\r?\n\r?\n\r?\n', ''; $helper=(@('def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any:',' \"\"\"Ensure each multipart file entry carries a filename so that it is encoded',' as a file part (with ``filename=``) rather than a plain form field.','',' Servers commonly distinguish multipart file parts from form-data parts by',' the presence of ``filename=`` in the part''s ``Content-Disposition`` header.',' When callers pass bare bytes / str / IO objects (e.g.',' ``Path(\"x.zip\").read_bytes()``), the underlying HTTP client emits the part',' without a filename, which several Foundry endpoints reject with errors like',' \"At least one file must be uploaded\". This helper synthesizes a filename',' from the IO object''s ``name`` attribute when available, otherwise falls',' back to a stable default.','',' :param field_name: The multipart form field name, used as a fallback filename.',' :type field_name: str',' :param entry: The file entry to normalize. May be a tuple, bytes, str, or IO object.',' :type entry: any',' :param index: Position of the entry within its field''s list, used to disambiguate fallback filenames.',' :type index: int',' :return: A ``(filename, entry)`` tuple if ``entry`` was not already a tuple, otherwise ``entry`` unchanged.',' :rtype: any',' \"\"\"',' if isinstance(entry, tuple):',' return entry',' filename: Optional[str] = None',' name_attr = getattr(entry, \"name\", None)',' if isinstance(name_attr, str) and name_attr:',' filename = os.path.basename(name_attr)',' if not filename:',' filename = f\"{field_name}_{index}\" if index else field_name',' return (filename, entry)','','') -join [Environment]::NewLine); $c=$c -replace '(?m)^def prepare_multipart_form_data\(', ($helper + 'def prepare_multipart_form_data('); $pattern='(?s) files: list\[FileType\] = \[\]\r?\n.*? return files'; $new=(@(' files: list[FileType] = []','',' # Append data fields first so they appear before file parts in the encoded',' # multipart body. Some streaming server-side parsers (e.g. the Foundry',' # hosted-agents `create_agent_version_from_code` endpoint) require small',' # JSON metadata parts to precede large binary file parts; otherwise they',' # report the metadata part as missing.',' for data_field in data_fields:',' data_entry = body.get(data_field)',' if data_entry:',' files.append((data_field, str(serialize_multipart_data_entry(data_entry))))','',' for multipart_field in multipart_fields:',' multipart_entry = body.get(multipart_field)',' if isinstance(multipart_entry, list):',' for idx, e in enumerate(multipart_entry):',' files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx)))',' elif multipart_entry:',' files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0)))','',' return files') -join [Environment]::NewLine); $c=[regex]::Replace($c, $pattern, $new) }; Set-Content $f $c -NoNewline" - REM Finishing by running 'black' tool to format code. pip install black -black --config ../../../eng/black-pyproject.toml . || echo black not found, skipping formatting. +black --config ../../../eng/black-pyproject.toml . diff --git a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py index 70c218bc1e47..8aaa0adc7fcc 100644 --- a/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py +++ b/sdk/ai/azure-ai-projects/tests/foundry_features_header/foundry_features_header_test_base.py @@ -46,7 +46,7 @@ "toolboxes": "Toolboxes=V1Preview", "skills": "Skills=V1Preview", "datasets": "DataGenerationJobs=V1Preview", - "agents": "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V1Preview", + "agents": "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V2Preview", } # Methods on .beta sub-clients that are NOT simple one-HTTP-call wrappers and @@ -84,7 +84,7 @@ # The test id is derived automatically from method_name. pytest.param( "agents.create_version", - "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V1Preview", + "HostedAgents=V1Preview,WorkflowAgents=V1Preview,AgentEndpoints=V1Preview,CodeAgents=V1Preview,ExternalAgents=V1Preview,AgentsOptimization=V2Preview", ), pytest.param( "evaluation_rules.create_or_update", diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index fba1c89d1f07..85be5b4de248 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -23,7 +23,7 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/red-teams - specification/ai-foundry/data-plane/Foundry/src/routines - specification/ai-foundry/data-plane/Foundry/src/schedules - - specification/ai-foundry/data-plane/Foundry/src/servicepatterns.tsp + - specification/ai-foundry/data-plane/Foundry/src/sdk-common - specification/ai-foundry/data-plane/Foundry/src/skills - specification/ai-foundry/data-plane/Foundry/src/toolboxes - specification/ai-foundry/data-plane/Foundry/src/tools \ No newline at end of file From 114886919b1e65a43f0669472645935d64a48e74 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:58:39 -0700 Subject: [PATCH 28/40] Update change log and subclient report --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + sdk/ai/azure-ai-projects/docs/subclients.md | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index b5d5a54cfaaa..f2f0df63cdd1 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -5,6 +5,7 @@ ### Breaking Changes Breaking changes in beta methods: +* Agent Optimization methods `.beta.agents.*optimization*` were re-written. Updated from v1 to v2 preview, focusing on cleanup to better align with Foundry job guidelines and platform standards. The v1 surface accumulated unused candidate sub-resources, internal-detail properties, and custom operation patterns inconsistent with the Foundry platform. The v2 API removes redundant models and operations, adopts shared Foundry job patterns (`JobLike<>`, standard job verbs), and introduces typed discriminated unions for dataset inputs and evaluator references. * Method `.beta.agents.list_optimization_candidates` now returns `ItemPaged[OptimizationCandidate]` instead of `AgentsPagedResultOptimizationCandidate`. The `after` parameter has been removed (use continuation-token-based paging instead). ### Sample updates diff --git a/sdk/ai/azure-ai-projects/docs/subclients.md b/sdk/ai/azure-ai-projects/docs/subclients.md index 538c79bea5e4..e6e1523ad1e2 100644 --- a/sdk/ai/azure-ai-projects/docs/subclients.md +++ b/sdk/ai/azure-ai-projects/docs/subclients.md @@ -4,7 +4,7 @@ This document lists all sub-clients available on `AIProjectClient` and their pub ## Summary -There are a total of 140 unique public methods across all sub-clients. +There are a total of 134 unique public methods across all sub-clients. ### Top-level Sub-clients (stable operations) @@ -22,7 +22,7 @@ There are a total of 140 unique public methods across all sub-clients. | Subclient | Class Name | Methods Count | |-----------|------------|----------------| -| `beta.agents` | BetaAgentsOperations | 24 | +| `beta.agents` | BetaAgentsOperations | 18 | | `beta.datasets` | BetaDatasetsOperations | 5 | | `beta.evaluation_taxonomies` | BetaEvaluationTaxonomiesOperations | 5 | | `beta.evaluators` | BetaEvaluatorsOperations | 13 | @@ -89,19 +89,13 @@ Alphabetically sorted, with ".beta" sub-client at the end. If the method is a ne .beta.agents.delete_session_file .beta.agents.download_code .beta.agents.download_session_file -.beta.agents.get_candidate_file -.beta.agents.get_optimization_candidate -.beta.agents.get_optimization_candidate_config -.beta.agents.get_optimization_candidate_results .beta.agents.get_optimization_job .beta.agents.get_session .beta.agents.get_session_log_stream -.beta.agents.list_optimization_candidates .beta.agents.list_optimization_jobs .beta.agents.list_session_files .beta.agents.list_sessions .beta.agents.patch_agent_details -.beta.agents.promote_candidate .beta.agents.stop_session .beta.agents.upload_session_file* @@ -150,12 +144,12 @@ Alphabetically sorted, with ".beta" sub-client at the end. If the method is a ne .beta.memory_stores.update_memory .beta.models.create* -.beta.models.pending_create_version .beta.models.delete .beta.models.get .beta.models.get_credentials .beta.models.list .beta.models.list_versions +.beta.models.pending_create_version .beta.models.pending_upload .beta.models.update From 97d109740a5c0d711c98f5bd846472f02ff8f13e Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:53:27 -0700 Subject: [PATCH 29/40] restore tsp-location.yaml --- sdk/ai/azure-ai-projects/tsp-location.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 85be5b4de248..c2775b48d293 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,3 +1,4 @@ +<<<<<<< HEAD directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects commit: 1a46f23eb6ff991b777135f70d7d0782fc0fb324 repo: Azure/azure-rest-api-specs @@ -26,4 +27,10 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/sdk-common - specification/ai-foundry/data-plane/Foundry/src/skills - specification/ai-foundry/data-plane/Foundry/src/toolboxes - - specification/ai-foundry/data-plane/Foundry/src/tools \ No newline at end of file + - specification/ai-foundry/data-plane/Foundry/src/tools +======= +directory: specification/ai-foundry/data-plane/Foundry +commit: e041b5a178996b62fe86a267dc468df5c1677c54 +repo: Azure/azure-rest-api-specs +additionalDirectories: +>>>>>>> 88c333c5de (restore tsp-location.yaml) From 1d78c9990e5602cc95b03007c642e399ef6dec1f Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:34:26 -0700 Subject: [PATCH 30/40] [azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294) --- .../azure-ai-projects/apiview-properties.json | 4 + .../ai/projects/aio/operations/_operations.py | 566 ++++++++++++++++++ .../ai/projects/operations/_operations.py | 561 +++++++++++++++++ sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 4 files changed, 1132 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 38cbceeeaadd..21eef7f12035 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -481,5 +481,9 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, +<<<<<<< HEAD "CrossLanguageVersion": "9cf16cec0d0a" +======= + "CrossLanguageVersion": "3ae42dbde611" +>>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) } \ No newline at end of file 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 e278f6761204..2b9d4cb5398c 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 @@ -5028,6 +5028,572 @@ async def delete_optimization_job(self, job_id: str, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore +<<<<<<< HEAD +======= + @distributed_trace + def list_optimization_candidates( + self, + job_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.OptimizationCandidate"]: + """Returns a list of candidates for an optimization job. + + List candidates produced by a job. + + :param job_id: The optimization job id. Required. + :type job_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of OptimizationCandidate + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, AsyncList(list_of_elem) + + async def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _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 [200]: + 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) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_optimization_candidate( + self, job_id: str, candidate_id: str, **kwargs: Any + ) -> _models.CandidateMetadata: + """Get a candidate by id. + + Get a single candidate's metadata, manifest, and promotion info. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateMetadata + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_optimization_candidate_config( + self, job_id: str, candidate_id: str, **kwargs: Any + ) -> _models.CandidateDeployConfig: + """Get candidate deploy config. + + Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a + candidate. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateDeployConfig + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_config_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_optimization_candidate_results( + self, job_id: str, candidate_id: str, **kwargs: Any + ) -> _models.CandidateResults: + """Get candidate evaluation results. + + Get full per-task evaluation results for a candidate. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateResults. The CandidateResults is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateResults + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_results_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_candidate_file( + self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + """Get a candidate file. + + Stream a specific file from the candidate's blob directory. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. + :paramtype path: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_candidate_file_request( + job_id=job_id, + candidate_id=candidate_id, + path=path, + api_version=self._config.api_version, + 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", 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: _models.PromoteCandidateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Is one of the following types: + PromoteCandidateRequest, JSON, IO[bytes] Required. + :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :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.PromoteCandidateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(candidate_request, (IOBase, bytes)): + _content = candidate_request + else: + _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agents_promote_candidate_request( + job_id=job_id, + candidate_id=candidate_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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + +>>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) class BetaEvaluationTaxonomiesOperations: """ 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 09319efc0d67..4304aa91358c 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 @@ -8455,6 +8455,567 @@ def delete_optimization_job( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore +<<<<<<< HEAD +======= + @distributed_trace + def list_optimization_candidates( + self, + job_id: str, + *, + limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.OptimizationCandidate"]: + """Returns a list of candidates for an optimization job. + + List candidates produced by a job. + + :param job_id: The optimization job id. Required. + :type job_id: str + :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and + 100, and the + default is 20. Default value is None. + :paramtype limit: int + :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for + ascending order and``desc`` + for descending order. Known values are: "asc" and "desc". Default value is None. + :paramtype order: str or ~azure.ai.projects.models.PageOrder + :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your + place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + Default value is None. + :paramtype before: str + :return: An iterator like instance of OptimizationCandidate + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(_continuation_token=None): + + _request = build_beta_agents_list_optimization_candidates_request( + job_id=job_id, + limit=limit, + order=order, + after=_continuation_token, + before=before, + api_version=self._config.api_version, + 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) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OptimizationCandidate], + deserialized.get("data", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("last_id") or None, iter(list_of_elem) + + def get_next(_continuation_token=None): + _request = prepare_request(_continuation_token) + + _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 [200]: + 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) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: + """Get a candidate by id. + + Get a single candidate's metadata, manifest, and promotion info. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateMetadata + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateMetadata, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_optimization_candidate_config( + self, job_id: str, candidate_id: str, **kwargs: Any + ) -> _models.CandidateDeployConfig: + """Get candidate deploy config. + + Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a + candidate. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateDeployConfig + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_config_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_optimization_candidate_results( + self, job_id: str, candidate_id: str, **kwargs: Any + ) -> _models.CandidateResults: + """Get candidate evaluation results. + + Get full per-task evaluation results for a candidate. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :return: CandidateResults. The CandidateResults is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.CandidateResults + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_optimization_candidate_results_request( + job_id=job_id, + candidate_id=candidate_id, + api_version=self._config.api_version, + 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CandidateResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: + """Get a candidate file. + + Stream a specific file from the candidate's blob directory. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id. Required. + :type candidate_id: str + :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. + :paramtype path: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :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 = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_beta_agents_get_candidate_file_request( + job_id=job_id, + candidate_id=candidate_id, + path=path, + api_version=self._config.api_version, + 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", 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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: _models.PromoteCandidateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Required. + :type candidate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def promote_candidate( + self, + job_id: str, + candidate_id: str, + candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PromoteCandidateResponse: + """Promote a candidate. + + Promotes a candidate, recording the deployment timestamp and target agent version. + + :param job_id: The optimization job id. Required. + :type job_id: str + :param candidate_id: The candidate id to promote. Required. + :type candidate_id: str + :param candidate_request: Promotion details. Is one of the following types: + PromoteCandidateRequest, JSON, IO[bytes] Required. + :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] + :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.PromoteCandidateResponse + :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.PromoteCandidateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(candidate_request, (IOBase, bytes)): + _content = candidate_request + else: + _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_beta_agents_promote_candidate_request( + job_id=job_id, + candidate_id=candidate_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 [200]: + 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, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + +>>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) class BetaEvaluationTaxonomiesOperations: """ diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index c2775b48d293..438190a7b7f9 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -30,7 +30,7 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/tools ======= directory: specification/ai-foundry/data-plane/Foundry -commit: e041b5a178996b62fe86a267dc468df5c1677c54 +commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 repo: Azure/azure-rest-api-specs additionalDirectories: >>>>>>> 88c333c5de (restore tsp-location.yaml) From 9c44b947d27d31cdc4c370edcff6c904ef66fb4d Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:25:21 -0700 Subject: [PATCH 31/40] [azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318) --- eng/emitter-package-lock.json | 19 +++++++++++++++++++ eng/emitter-package.json | 4 ++++ .../azure-ai-projects/apiview-properties.json | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 1787807b517f..ee4bee70d489 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,11 @@ "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { +<<<<<<< HEAD "@azure-tools/openai-typespec": "1.20.0", +======= + "@azure-tools/openai-typespec": "1.19.0", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", @@ -30,9 +34,15 @@ } }, "node_modules/@azure-tools/openai-typespec": { +<<<<<<< HEAD "version": "1.20.0", "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", +======= + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", + "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "dev": true, "license": "MIT", "peerDependencies": { @@ -178,6 +188,7 @@ "@typespec/xml": "^0.82.0" } }, +<<<<<<< HEAD "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python": { "version": "0.30.1", "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.30.1.tgz", @@ -229,6 +240,14 @@ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "license": "MIT", "dependencies": { +======= + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index b4ee98d3d708..ffa3c893a95b 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -14,8 +14,12 @@ "@typespec/streams": "~0.82.0", "@typespec/xml": "~0.82.0", "@typespec/openapi3": "1.12.0", +<<<<<<< HEAD "@typespec/http-client-python": "^0.31.0", "@azure-tools/openai-typespec": "1.20.0", +======= + "@azure-tools/openai-typespec": "1.19.0", +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 21eef7f12035..cbfc1119940e 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -481,9 +481,13 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, +<<<<<<< HEAD <<<<<<< HEAD "CrossLanguageVersion": "9cf16cec0d0a" ======= "CrossLanguageVersion": "3ae42dbde611" >>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) +======= + "CrossLanguageVersion": "ca205130211f" +>>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) } \ No newline at end of file From a7c53a855b04fbd5741231638601a6d5814602b1 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 5 Jun 2026 09:27:07 -0700 Subject: [PATCH 32/40] Update Python tsp-location.yaml to match recent TypeSpec client.tsp file move (#47361) --- sdk/ai/azure-ai-projects/tsp-location.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 438190a7b7f9..52fc108fa8f3 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,3 @@ -<<<<<<< HEAD directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects commit: 1a46f23eb6ff991b777135f70d7d0782fc0fb324 repo: Azure/azure-rest-api-specs @@ -28,9 +27,3 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/skills - specification/ai-foundry/data-plane/Foundry/src/toolboxes - specification/ai-foundry/data-plane/Foundry/src/tools -======= -directory: specification/ai-foundry/data-plane/Foundry -commit: 6aa89cf5b93d34e6eea85f12b95cd370ba9d58b1 -repo: Azure/azure-rest-api-specs -additionalDirectories: ->>>>>>> 88c333c5de (restore tsp-location.yaml) From 587153f782b6272e724dff88226d49c9c1a567ef Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 11:03:02 -0700 Subject: [PATCH 33/40] Add sample for dispatching routines with manual triggers (#47404) --- .../sample_routines_with_dispatch.py | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py new file mode 100644 index 000000000000..4b7db7a01602 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py @@ -0,0 +1,130 @@ +# pylint: disable=line-too-long,useless-suppression +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to create a Routine with a manual (custom) + trigger and fire it on demand via `dispatch(...)`, then record the + resulting run by polling `list_runs(...)` using the synchronous + AIProjectClient. + + The routine is bound to an existing hosted agent. Because the trigger is + a `CustomRoutineTrigger`, the routine never fires on its own; the sample + explicitly invokes it with `project_client.beta.routines.dispatch(...)` + passing an `InvokeAgentResponsesApiDispatchPayload` carrying the input + sent to the agent. The sample then polls the run history until a + terminal phase is reached (or a deadline elapses), printing each + observed transition. The routine is deleted at the end of the sample. + + Routines are currently a preview feature. In the Python SDK, you access + these operations via `project_client.beta.routines`. + +USAGE: + python sample_routines_with_dispatch.py + + Before running the sample: + + pip install "azure-ai-projects>=2.2.0" python-dotenv + + Set these environment variables with your own values: + 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) FOUNDRY_HOSTED_AGENT_NAME - The name of an existing Hosted Agent to invoke + when the routine is dispatched. +""" + +import json +import os +import time + +from dotenv import load_dotenv + +from azure.core.exceptions import ResourceNotFoundError +from azure.identity import DefaultAzureCredential + +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + CustomRoutineTrigger, + InvokeAgentResponsesApiDispatchPayload, + InvokeAgentResponsesApiRoutineAction, + RoutineRun, + RoutineRunPhase, +) + +load_dotenv() + +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +agent_name = os.environ["FOUNDRY_HOSTED_AGENT_NAME"] + + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, +): + + routine_name = "sample-routine-dispatch" + + try: + project_client.beta.routines.delete(routine_name) + print(f"Routine `{routine_name}` deleted") + except ResourceNotFoundError: + pass + + created = project_client.beta.routines.create_or_update( + routine_name, + description="Routine used by the dispatch sample.", + enabled=True, + triggers={ + "manual": CustomRoutineTrigger( + provider="sample-provider", + event_name="sample-event", + parameters={}, + ), + }, + action=InvokeAgentResponsesApiRoutineAction(agent_name=agent_name), + ) + print(f"Created routine: {created.name} enabled={created.enabled}") + + dispatch_result = project_client.beta.routines.dispatch( + routine_name, + payload=InvokeAgentResponsesApiDispatchPayload( + input="Say hello from a manually dispatched routine.", + ), + ) + print(f"Dispatched routine: dispatch_id={dispatch_result.dispatch_id} task_id={dispatch_result.task_id}") + + seen_phases: dict[str, RoutineRunPhase] = {} + final_run: RoutineRun | None = None + + deadline = time.monotonic() + 180 + while time.monotonic() < deadline: + runs = list(project_client.beta.routines.list_runs(routine_name, limit=20, order="desc")) + for run in runs: + if seen_phases.get(run.id) == run.phase: + continue + seen_phases[run.id] = run.phase # type: ignore[assignment] + print( + f" - run_id={run.id} phase={run.phase} status={run.status} " + f"trigger_type={run.trigger_type} triggered_at={run.triggered_at} ended_at={run.ended_at}" + ) + if str(run.status).lower() == "finished": + final_run = run + + if final_run is not None: + break + time.sleep(5) + + if final_run: + print("Final run:") + print(json.dumps(final_run.as_dict(), indent=2, default=str)) + # Note: retrieving the response body produced by a routine-dispatched + # run via `openai_client.responses.retrieve(final_run.response_id)` is + # not yet supported by the service for this scenario. + else: + print("Dispatch did not produce a terminal run within the deadline.") + + project_client.beta.routines.delete(routine_name) + print("Routine deleted") From 344248d5e6f5bc4bc5c3b335687154aeb34becd1 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 9 Jun 2026 13:49:42 -0700 Subject: [PATCH 34/40] restore packages --- eng/emitter-package-lock.json | 13 +++++++++++++ eng/emitter-package.json | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index ee4bee70d489..380b978415e9 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,11 +9,15 @@ "@azure-tools/typespec-python": "0.63.0" }, "devDependencies": { +<<<<<<< HEAD <<<<<<< HEAD "@azure-tools/openai-typespec": "1.20.0", ======= "@azure-tools/openai-typespec": "1.19.0", >>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) +======= + "@azure-tools/openai-typespec": "1.20.0", +>>>>>>> 8c5e21f58f (restore packages) "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", @@ -34,6 +38,7 @@ } }, "node_modules/@azure-tools/openai-typespec": { +<<<<<<< HEAD <<<<<<< HEAD "version": "1.20.0", "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", @@ -43,6 +48,11 @@ "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", >>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) +======= + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", + "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", +>>>>>>> 8c5e21f58f (restore packages) "dev": true, "license": "MIT", "peerDependencies": { @@ -189,6 +199,9 @@ } }, <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 8c5e21f58f (restore packages) "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python": { "version": "0.30.1", "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.30.1.tgz", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index ffa3c893a95b..12a6ce18f93f 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -14,12 +14,17 @@ "@typespec/streams": "~0.82.0", "@typespec/xml": "~0.82.0", "@typespec/openapi3": "1.12.0", +<<<<<<< HEAD <<<<<<< HEAD "@typespec/http-client-python": "^0.31.0", "@azure-tools/openai-typespec": "1.20.0", ======= "@azure-tools/openai-typespec": "1.19.0", >>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) +======= + "@typespec/http-client-python": "^0.31.0", + "@azure-tools/openai-typespec": "1.20.0", +>>>>>>> 8c5e21f58f (restore packages) "@azure-tools/typespec-autorest": "~0.68.0", "@azure-tools/typespec-azure-core": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "~0.68.0", From 324e4f62e8a97aed4aaa994adc2a3965bf98f479 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 9 Jun 2026 19:58:39 -0700 Subject: [PATCH 35/40] sample update routines (#47423) * sample update routines * Add test for routines samples and update sample skipping logic --- .../sample_routines_with_dispatch.py | 130 ------------------ 1 file changed, 130 deletions(-) delete mode 100644 sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py deleted file mode 100644 index 4b7db7a01602..000000000000 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_routines_with_dispatch.py +++ /dev/null @@ -1,130 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - -""" -DESCRIPTION: - This sample demonstrates how to create a Routine with a manual (custom) - trigger and fire it on demand via `dispatch(...)`, then record the - resulting run by polling `list_runs(...)` using the synchronous - AIProjectClient. - - The routine is bound to an existing hosted agent. Because the trigger is - a `CustomRoutineTrigger`, the routine never fires on its own; the sample - explicitly invokes it with `project_client.beta.routines.dispatch(...)` - passing an `InvokeAgentResponsesApiDispatchPayload` carrying the input - sent to the agent. The sample then polls the run history until a - terminal phase is reached (or a deadline elapses), printing each - observed transition. The routine is deleted at the end of the sample. - - Routines are currently a preview feature. In the Python SDK, you access - these operations via `project_client.beta.routines`. - -USAGE: - python sample_routines_with_dispatch.py - - Before running the sample: - - pip install "azure-ai-projects>=2.2.0" python-dotenv - - Set these environment variables with your own values: - 1) FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview - page of your Microsoft Foundry portal. - 2) FOUNDRY_HOSTED_AGENT_NAME - The name of an existing Hosted Agent to invoke - when the routine is dispatched. -""" - -import json -import os -import time - -from dotenv import load_dotenv - -from azure.core.exceptions import ResourceNotFoundError -from azure.identity import DefaultAzureCredential - -from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import ( - CustomRoutineTrigger, - InvokeAgentResponsesApiDispatchPayload, - InvokeAgentResponsesApiRoutineAction, - RoutineRun, - RoutineRunPhase, -) - -load_dotenv() - -endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] -agent_name = os.environ["FOUNDRY_HOSTED_AGENT_NAME"] - - -with ( - DefaultAzureCredential() as credential, - AIProjectClient(endpoint=endpoint, credential=credential, allow_preview=True) as project_client, -): - - routine_name = "sample-routine-dispatch" - - try: - project_client.beta.routines.delete(routine_name) - print(f"Routine `{routine_name}` deleted") - except ResourceNotFoundError: - pass - - created = project_client.beta.routines.create_or_update( - routine_name, - description="Routine used by the dispatch sample.", - enabled=True, - triggers={ - "manual": CustomRoutineTrigger( - provider="sample-provider", - event_name="sample-event", - parameters={}, - ), - }, - action=InvokeAgentResponsesApiRoutineAction(agent_name=agent_name), - ) - print(f"Created routine: {created.name} enabled={created.enabled}") - - dispatch_result = project_client.beta.routines.dispatch( - routine_name, - payload=InvokeAgentResponsesApiDispatchPayload( - input="Say hello from a manually dispatched routine.", - ), - ) - print(f"Dispatched routine: dispatch_id={dispatch_result.dispatch_id} task_id={dispatch_result.task_id}") - - seen_phases: dict[str, RoutineRunPhase] = {} - final_run: RoutineRun | None = None - - deadline = time.monotonic() + 180 - while time.monotonic() < deadline: - runs = list(project_client.beta.routines.list_runs(routine_name, limit=20, order="desc")) - for run in runs: - if seen_phases.get(run.id) == run.phase: - continue - seen_phases[run.id] = run.phase # type: ignore[assignment] - print( - f" - run_id={run.id} phase={run.phase} status={run.status} " - f"trigger_type={run.trigger_type} triggered_at={run.triggered_at} ended_at={run.ended_at}" - ) - if str(run.status).lower() == "finished": - final_run = run - - if final_run is not None: - break - time.sleep(5) - - if final_run: - print("Final run:") - print(json.dumps(final_run.as_dict(), indent=2, default=str)) - # Note: retrieving the response body produced by a routine-dispatched - # run via `openai_client.responses.retrieve(final_run.response_id)` is - # not yet supported by the service for this scenario. - else: - print("Dispatch did not produce a terminal run within the deadline.") - - project_client.beta.routines.delete(routine_name) - print("Routine deleted") From f8e030b5152eb0bb32e00d3fb2f11f554982a1c7 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 12 Jun 2026 15:57:46 -0700 Subject: [PATCH 36/40] Emit from latest TypeSpec, including new Agent Optimization methods (#47482) --- sdk/ai/azure-ai-projects/apiview-properties.json | 4 ++++ .../azure/ai/projects/aio/operations/_operations.py | 3 +++ .../azure/ai/projects/operations/_operations.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index cbfc1119940e..600e3cf11cca 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -482,6 +482,7 @@ "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD "CrossLanguageVersion": "9cf16cec0d0a" ======= @@ -490,4 +491,7 @@ ======= "CrossLanguageVersion": "ca205130211f" >>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) +======= + "CrossLanguageVersion": "9cf16cec0d0a" +>>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) } \ No newline at end of file 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 2b9d4cb5398c..ead83bf80860 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 @@ -5028,6 +5028,7 @@ async def delete_optimization_job(self, job_id: str, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore +<<<<<<< HEAD <<<<<<< HEAD ======= @distributed_trace @@ -5594,6 +5595,8 @@ async def promote_candidate( return deserialized # type: ignore >>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) +======= +>>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) class BetaEvaluationTaxonomiesOperations: """ 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 4304aa91358c..f35e38282aeb 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 @@ -8455,6 +8455,7 @@ def delete_optimization_job( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore +<<<<<<< HEAD <<<<<<< HEAD ======= @distributed_trace @@ -9016,6 +9017,8 @@ def promote_candidate( return deserialized # type: ignore >>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) +======= +>>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) class BetaEvaluationTaxonomiesOperations: """ From 31f3e088f11e7a04da873aa6f3939f8ae34e3a39 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:18:30 -0700 Subject: [PATCH 37/40] Fix merge --- eng/emitter-package-lock.json | 488 +++++++++++++--------------------- eng/emitter-package.json | 43 ++- 2 files changed, 199 insertions(+), 332 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 380b978415e9..8ada17490f1b 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -6,53 +6,33 @@ "": { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.63.0" + "@azure-tools/typespec-python": "0.63.1" }, "devDependencies": { -<<<<<<< HEAD -<<<<<<< HEAD "@azure-tools/openai-typespec": "1.20.0", -======= - "@azure-tools/openai-typespec": "1.19.0", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) -======= - "@azure-tools/openai-typespec": "1.20.0", ->>>>>>> 8c5e21f58f (restore packages) - "@azure-tools/typespec-autorest": "~0.68.0", - "@azure-tools/typespec-azure-core": "~0.68.0", - "@azure-tools/typespec-azure-resource-manager": "~0.68.0", - "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.4", + "@azure-tools/typespec-autorest": "~0.69.0", + "@azure-tools/typespec-azure-core": "~0.69.0", + "@azure-tools/typespec-azure-resource-manager": "~0.69.0", + "@azure-tools/typespec-azure-rulesets": "~0.69.0", + "@azure-tools/typespec-client-generator-core": "~0.69.0", "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "^1.12.0", - "@typespec/events": "~0.82.0", - "@typespec/http": "^1.12.0", - "@typespec/http-client-python": "^0.31.0", - "@typespec/openapi": "^1.12.0", - "@typespec/openapi3": "1.12.0", - "@typespec/rest": "~0.82.0", - "@typespec/sse": "~0.82.0", - "@typespec/streams": "~0.82.0", - "@typespec/versioning": "~0.82.0", - "@typespec/xml": "~0.82.0" + "@typespec/compiler": "^1.13.0", + "@typespec/events": "~0.83.0", + "@typespec/http": "^1.13.0", + "@typespec/http-client-python": "^0.31.1", + "@typespec/openapi": "^1.13.0", + "@typespec/openapi3": "1.13.0", + "@typespec/rest": "~0.83.0", + "@typespec/sse": "~0.83.0", + "@typespec/streams": "~0.83.0", + "@typespec/versioning": "~0.83.0", + "@typespec/xml": "~0.83.0" } }, "node_modules/@azure-tools/openai-typespec": { -<<<<<<< HEAD -<<<<<<< HEAD - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", - "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", -======= - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.19.0.tgz", - "integrity": "sha512-RzUTgxjZ/FgYihbHxQVKagzziJOeRb1myrA/nSLZ0xr2RNXgqz7rTercoxu2/nk6zFjnvahI8bhD+No0rIA2iA==", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) -======= "version": "1.20.0", "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", "integrity": "sha512-VSSLReGSpPdRl7XizD+W/D4LLsoGekQAwI3mKWNT7bxVsOQJAGtfVXie8pYB4shJf6QxRxHo7h59/g4easkz+Q==", ->>>>>>> 8c5e21f58f (restore packages) "dev": true, "license": "MIT", "peerDependencies": { @@ -61,23 +41,23 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.68.0.tgz", - "integrity": "sha512-ywcB68x0jOuplKg1u9ZpjOamHbIEEgAaMuXTP72cvWXE7q1eGLCN1DQx1Uk5ME8VLJKAX6cMOMHK4hcmg9tvuw==", + "version": "0.69.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.0.tgz", + "integrity": "sha512-6lOOe3NWfLI8M5NGLM1ZzIFRe34gVPj2GXzti9ag6o3fVpC6eMUfacv1sU4zmz9dkpKTdOUXNO5qm3DvqPRC8Q==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.68.0", - "@azure-tools/typespec-azure-resource-manager": "^0.68.0", - "@azure-tools/typespec-client-generator-core": "^0.68.0", - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": "^0.82.0", - "@typespec/versioning": "^0.82.0", - "@typespec/xml": "^0.82.0" + "@azure-tools/typespec-azure-core": "^0.69.0", + "@azure-tools/typespec-azure-resource-manager": "^0.69.0", + "@azure-tools/typespec-client-generator-core": "^0.69.0", + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/rest": "^0.83.0", + "@typespec/versioning": "^0.83.0", + "@typespec/xml": "^0.83.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -86,23 +66,23 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.68.0.tgz", - "integrity": "sha512-p0qUkRZav5fdQvGe2gSCvlgsvpM0y9xVhgH2GpXi5ZzpYfNGzxd8oZr8VOCP8mjMVfGQ3AtnowbmrHALEZgz7Q==", + "version": "0.69.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", + "integrity": "sha512-UNdPb/DgMvXqwWk9hb54QOAumCJ6u6GGy+bj3RIIT1Sht6FR9rIn8AQ/UQ7WtrhbJBoqvQo5dxtS565a9/VRZw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0", - "@typespec/rest": "^0.82.0" + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0", + "@typespec/rest": "^0.83.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.68.0.tgz", - "integrity": "sha512-1zgXpOb/fGfB7SrFqawKasSOTIi9cZPWyK8V3RHyNWFZVQclEMGBzSvBHi6an4AEChqcjCSMh5MEr4BSujW4Ew==", + "version": "0.69.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.0.tgz", + "integrity": "sha512-q/kdsGhVpvn2wb3OedxFHg7hp+al3FynUAPsz2gwqJx62z6UGOEJhtYCWP3osatVgxvKRhhh8uYl5mHRMDFi3g==", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -112,33 +92,33 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.68.0", - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": "^0.82.0", - "@typespec/versioning": "^0.82.0" + "@azure-tools/typespec-azure-core": "^0.69.0", + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/rest": "^0.83.0", + "@typespec/versioning": "^0.83.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.68.0.tgz", - "integrity": "sha512-cXZ3jiDNqJgpBQLguNgXjvAsvYo7VwtlQxFMzTr96gpoAiuBViH+3eOhVd5HA4H96NgAWSddTMHXZJZzcsnE5A==", + "version": "0.69.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.0.tgz", + "integrity": "sha512-+7KThtfHupWBDSwDR9rRHNmBb15gxACH8iPOOohRr1J28Gu25YWlz1G00r62X9VUBFLZTxYc4rQ2QCxPFT0uFw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.68.0", - "@azure-tools/typespec-azure-resource-manager": "^0.68.0", - "@azure-tools/typespec-client-generator-core": "^0.68.0", - "@typespec/compiler": "^1.12.0" + "@azure-tools/typespec-azure-core": "^0.69.0", + "@azure-tools/typespec-azure-resource-manager": "^0.69.0", + "@azure-tools/typespec-client-generator-core": "^0.69.0", + "@typespec/compiler": "^1.13.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.68.4", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.68.4.tgz", - "integrity": "sha512-p32EXsrSC9giZUNdsQ2gmvDENFIEW2E0zto3FmjBZ3OeB5wCw1ZAZ+KnO0rsoKFovBvHSsQatNCKJvM/x89AgA==", + "version": "0.69.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.0.tgz", + "integrity": "sha512-ro8zzOeiN/74r0wM19R77gzLtbfjIFgKgr1Rusii/vhCfJIoVC7IcqLxhbJl0RVkjyhRFKt4GCRAw4iurnrDnw==", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -149,16 +129,16 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.68.0", - "@typespec/compiler": "^1.12.0", - "@typespec/events": "^0.82.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": "^0.82.0", - "@typespec/sse": "^0.82.0", - "@typespec/streams": "^0.82.0", - "@typespec/versioning": "^0.82.0", - "@typespec/xml": "^0.82.0" + "@azure-tools/typespec-azure-core": "^0.69.0", + "@typespec/compiler": "^1.13.0", + "@typespec/events": "^0.83.0", + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/rest": "^0.83.0", + "@typespec/sse": "^0.83.0", + "@typespec/streams": "^0.83.0", + "@typespec/versioning": "^0.83.0", + "@typespec/xml": "^0.83.0" } }, "node_modules/@azure-tools/typespec-liftr-base": { @@ -168,13 +148,13 @@ "dev": true }, "node_modules/@azure-tools/typespec-python": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.63.0.tgz", - "integrity": "sha512-8CSHcHhI1egOE9BabVD3P8pjkYEt38vF85bA//ZEMOwgTVn0OCpOeuJN/uCy3uEYNSQUSOVKin35H2m04xupJQ==", + "version": "0.63.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-python/-/typespec-python-0.63.1.tgz", + "integrity": "sha512-+hRzFg+pE4nGu0kko8TFcwW7Wc9irQe1QNhfu5jJj8OmMbk4idYXWKh+yo+25HUJ54Eu6L4/vgX8RzYGAfJogQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@typespec/http-client-python": "^0.30.0", + "@typespec/http-client-python": "^0.31.1", "semver": "^7.7.4", "tsx": "^4.21.0" }, @@ -182,69 +162,20 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": "^0.68.0", - "@azure-tools/typespec-azure-core": "^0.68.0", - "@azure-tools/typespec-azure-resource-manager": "^0.68.0", - "@azure-tools/typespec-azure-rulesets": "^0.68.0", - "@azure-tools/typespec-client-generator-core": "^0.68.2", - "@typespec/compiler": "^1.12.0", - "@typespec/events": "^0.82.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": "^0.82.0", - "@typespec/sse": "^0.82.0", - "@typespec/streams": "^0.82.0", - "@typespec/versioning": "^0.82.0", - "@typespec/xml": "^0.82.0" - } - }, -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> 8c5e21f58f (restore packages) - "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.30.1.tgz", - "integrity": "sha512-fo78R2GhPjUntPwZGDHxZ/ddRQZgLRSCzO3F+u8hPrHPzmBXA0rMkeS2WKCWYmT/wcFDPAojjH9pMUl27dLQ0w==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "js-yaml": "~4.1.0", - "marked": "^15.0.6", - "pyodide": "0.26.2", - "semver": "~7.6.2", - "tsx": "^4.21.0" - }, - "engines": { - "node": ">=22.0.0" - }, - "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.68.2 <1.0.0", - "@typespec/compiler": "^1.12.0", - "@typespec/events": ">=0.82.0 <1.0.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": ">=0.82.0 <1.0.0", - "@typespec/sse": ">=0.82.0 <1.0.0", - "@typespec/streams": ">=0.82.0 <1.0.0", - "@typespec/versioning": ">=0.82.0 <1.0.0", - "@typespec/xml": ">=0.82.0 <1.0.0" - } - }, - "node_modules/@azure-tools/typespec-python/node_modules/@typespec/http-client-python/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "@azure-tools/typespec-autorest": "^0.69.0", + "@azure-tools/typespec-azure-core": "^0.69.0", + "@azure-tools/typespec-azure-resource-manager": "^0.69.0", + "@azure-tools/typespec-azure-rulesets": "^0.69.0", + "@azure-tools/typespec-client-generator-core": "^0.69.0", + "@typespec/compiler": "^1.13.0", + "@typespec/events": "^0.83.0", + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/rest": "^0.83.0", + "@typespec/sse": "^0.83.0", + "@typespec/streams": "^0.83.0", + "@typespec/versioning": "^0.83.0", + "@typespec/xml": "^0.83.0" } }, "node_modules/@babel/code-frame": { @@ -253,14 +184,6 @@ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "license": "MIT", "dependencies": { -======= - "node_modules/@babel/code-frame": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", - "license": "MIT", - "dependencies": { ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" @@ -1035,9 +958,9 @@ } }, "node_modules/@scalar/helpers": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.1.tgz", - "integrity": "sha512-yuiuBCadP5bjAnIv23QvifVN/NaMi9xBF6b8Wdk4QOzwzLPJmp699MAdf33J0A5i2qKcvnu32iz/VkEJmQRe5g==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.8.2.tgz", + "integrity": "sha512-qNbqUjSB3S4Gr4A0oANcm5G1Ip+EqBxICYKhe9YzmnaBpbmW6shxqpiivApTvvuDf+uIhR3uMwWyVQbYcGLsxA==", "dev": true, "license": "MIT", "engines": { @@ -1045,13 +968,13 @@ } }, "node_modules/@scalar/json-magic": { - "version": "0.12.15", - "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.15.tgz", - "integrity": "sha512-ZYgdYZ0jSZXQeyhG2lJ20FjzvKsaDRXk4bPguF/Ytl2nGBh9a6RIIr9NvVy4zAD67a/ahm+xipXlfoR1KtB5fg==", + "version": "0.12.16", + "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.16.tgz", + "integrity": "sha512-w8cDbZhHCzmIblWx92IVWoAXsbI4Fz3m++jiBANTSO1hgphF6UqEPQiCt3wnMPaxaanjMQxjS/iBk1UGXR2EGA==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.8.1", + "@scalar/helpers": "0.8.2", "pathe": "^2.0.3", "yaml": "^2.8.3" }, @@ -1060,66 +983,31 @@ } }, "node_modules/@scalar/openapi-parser": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.25.12.tgz", - "integrity": "sha512-1hajBAbc7cbEcsSZEQxaPXZyCjMf6h6hObV+SO32jkC6rrxinPXQIucDu9HTu/jm/FaaMnNhc8/XDWz5/E49cQ==", + "version": "0.28.7", + "resolved": "https://registry.npmjs.org/@scalar/openapi-parser/-/openapi-parser-0.28.7.tgz", + "integrity": "sha512-E6beEdTsJxUStxOmY1knQvSNJq6LTiXOsRX2WTrfmU6d/kiATn6IKkAU0kXtAZkaYCGU4UCEmBFHCMmNKn0JLA==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.5.2", - "@scalar/json-magic": "0.12.8", - "@scalar/openapi-types": "0.8.0", - "@scalar/openapi-upgrader": "0.2.6", + "@scalar/helpers": "0.8.2", + "@scalar/json-magic": "0.12.16", + "@scalar/openapi-types": "0.9.1", + "@scalar/openapi-upgrader": "0.2.9", "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^3.0.1", "jsonpointer": "^5.0.1", "leven": "^4.0.0", - "yaml": "^2.8.0" - }, - "engines": { - "node": ">=22" - } - }, - "node_modules/@scalar/openapi-parser/node_modules/@scalar/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@scalar/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-Pi1GAl8jO6ungmGj2sjDfCfqiBNrKW6HXDZmminV94ybGU/KtRLOqHwd0n9FIhY3j0RYGpGC0VCuniCICfQPHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=22" - } - }, - "node_modules/@scalar/openapi-parser/node_modules/@scalar/json-magic": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/@scalar/json-magic/-/json-magic-0.12.8.tgz", - "integrity": "sha512-a559iO8tmFeA90JJAAM3U5x1Asf3mr0Z8uDC1PmyLTDjdSOfajP7EY9VzNoXE2cM48ilf9qrjmkbw/d4VCFjQw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@scalar/helpers": "0.5.2", - "pathe": "^2.0.3", - "yaml": "^2.8.0" + "yaml": "^2.8.3" }, "engines": { "node": ">=22" } }, - "node_modules/@scalar/openapi-parser/node_modules/@scalar/openapi-types": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.8.0.tgz", - "integrity": "sha512-WmaxVSfvY5K/TwcG2B2TU1WOe1As1uc2s7myswtP6dBlcjU3hM08SApxv/jmyGaCE8t4gO5BBhmHY4pDUfmr2g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=22" - } - }, "node_modules/@scalar/openapi-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.7.0.tgz", - "integrity": "sha512-kN0PwlJW0de4bwQ4ib+mBHzKJUvBCyR/gwU4zLEq6SCbj+GfgYUh+2a0/yl1WYVUiSkkwFsHjfmQ8KjhR3HK0Q==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.9.1.tgz", + "integrity": "sha512-gkGhSkxSzADaBiNg+ZAbJuwj+ZUmzP2Pg9CWZ7ZP+0fck2WjPeDDM7aAbouAm0aQQMF9xBjSPXSA9a/qTHYaTw==", "dev": true, "license": "MIT", "engines": { @@ -1127,28 +1015,18 @@ } }, "node_modules/@scalar/openapi-upgrader": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.6.tgz", - "integrity": "sha512-pvEmfSCDNYR4+lygidUqfo+shzyp4OSh9+UgK110rzA8Oot6WbJBM03Fuq3M255G7G6R9iXyfsebB7MBUocPkw==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.9.tgz", + "integrity": "sha512-D5b0rGLLZgmkO9mdW2j/ND1KBlH1u3RCpr87HPxv9P9ZSr6PtM5iLqFOJq0ACiaHjY2mikCrxgDmnUEhTzRpHQ==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/openapi-types": "0.8.0" + "@scalar/openapi-types": "0.9.1" }, "engines": { "node": ">=22" } }, - "node_modules/@scalar/openapi-upgrader/node_modules/@scalar/openapi-types": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@scalar/openapi-types/-/openapi-types-0.8.0.tgz", - "integrity": "sha512-WmaxVSfvY5K/TwcG2B2TU1WOe1As1uc2s7myswtP6dBlcjU3hM08SApxv/jmyGaCE8t4gO5BBhmHY4pDUfmr2g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=22" - } - }, "node_modules/@typespec/asset-emitter": { "version": "0.79.1", "resolved": "https://registry.npmjs.org/@typespec/asset-emitter/-/asset-emitter-0.79.1.tgz", @@ -1163,9 +1041,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.12.0.tgz", - "integrity": "sha512-hKCkHEEDdCpXFyOU8ln+TzBBwonFMbkeUV0zIc+vBETyO8p/Upui3XvEyLOyB4CpKUReHzGeGm3gcFjNc73ygg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.13.0.tgz", + "integrity": "sha512-DonoHiyAMx0UjSmssqTrFtya+v97wny1aHcTLU5QF2wFzLATtcwUU9hbPC+eXhepuTunMOCHf8yk3pEsH6PZYA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.0", @@ -1194,28 +1072,28 @@ } }, "node_modules/@typespec/events": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.82.0.tgz", - "integrity": "sha512-4gxwWndMVmYF6e5ETrwW6b77h1DsSc2ZiIbNo98XePaynD6yz/ooHKKtNKacjC2gmWhfRz1ArPioYn0YHvQkxw==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.83.0.tgz", + "integrity": "sha512-3EP1EIjdLgwStgd2rGWaF/QqY7YRAt+DIYnnYG2VsdPwa8s2t6K6eJ9YJDXveeHImAkHs+cpFuwxnjKMl4hOyw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0" + "@typespec/compiler": "^1.13.0" } }, "node_modules/@typespec/http": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.12.0.tgz", - "integrity": "sha512-3Bb1M6VSuEVPWOecXj3h3I/ddMpb9cmKRQQq34oq7LatiK4fwVBp+EdWbqzEzaRUGHm9mZtqsMsxZf5FndT8dg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.13.0.tgz", + "integrity": "sha512-tf8XFddU6g1MZSAVCLC/0Xa4fNfUO0CcHe6PWpmC3bvUojxMnpRcERI2DdoRJ+aycB9Q+Z8wN8bJO3up6u+sCw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/streams": "^0.82.0" + "@typespec/compiler": "^1.13.0", + "@typespec/streams": "^0.83.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -1224,10 +1102,9 @@ } }, "node_modules/@typespec/http-client-python": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.31.0.tgz", - "integrity": "sha512-cG7ky7WMRfEeSp6YadVwHwgFSFLNFN82LTQziu6doNxQ0UipAIaobIELfVT5D/PDIz/Pa3w9mNG9CWF08uO7qA==", - "dev": true, + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.31.1.tgz", + "integrity": "sha512-69lB3EzV/eVprES14ud6hDf6EgIuPu/Q/lhkCEzDZ9qNH5Q7ntScSweWDp71uoT56vpyl2rr41Zjb+FixQhS2g==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1241,27 +1118,26 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.68.4 <1.0.0", - "@typespec/compiler": "^1.12.0", - "@typespec/events": ">=0.82.0 <1.0.0", - "@typespec/http": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/rest": ">=0.82.0 <1.0.0", - "@typespec/sse": ">=0.82.0 <1.0.0", - "@typespec/streams": ">=0.82.0 <1.0.0", - "@typespec/versioning": ">=0.82.0 <1.0.0", - "@typespec/xml": ">=0.82.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.69.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.69.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.69.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.69.0 <1.0.0", + "@typespec/compiler": "^1.13.0", + "@typespec/events": ">=0.83.0 <1.0.0", + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/rest": ">=0.83.0 <1.0.0", + "@typespec/sse": ">=0.83.0 <1.0.0", + "@typespec/streams": ">=0.83.0 <1.0.0", + "@typespec/versioning": ">=0.83.0 <1.0.0", + "@typespec/xml": ">=0.83.0 <1.0.0" } }, "node_modules/@typespec/http-client-python/node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1271,28 +1147,28 @@ } }, "node_modules/@typespec/openapi": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.12.0.tgz", - "integrity": "sha512-XtkCMPpzXFfuIzmx/BQrCMUCCk7d37lkqZe5ubJmvJ02Fr7yvAbofrgtNUZ1BbFe3TBBUS2nB3E3mjT3tE4zCQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.13.0.tgz", + "integrity": "sha512-omPc9n+LM2WvjYwnIf31RCxmG17fFUOVLBRsWg4T1mbcsNCj4grnNP7Lwt+irIZCiKtmLKxq3ViE7jYixCkZ3g==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0" + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0" } }, "node_modules/@typespec/openapi3": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-1.12.0.tgz", - "integrity": "sha512-r2CechzwGyr+BtLo7ApoaaTsrYybaE0gsGCLVWbkfH9Fs2KTu0ilpMKGxXjhKRS6cWHMkGGuB3hM0OJjFyFydw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-1.13.0.tgz", + "integrity": "sha512-G6ayl30kXYVhJvL2/zFwtTdWnCt6N6jZWxs8rAwYiFlZfaG8R/dzjRgcap9Dr0v+6AyWmRwooxRKM3TLi5R/mg==", "dev": true, "license": "MIT", "dependencies": { - "@scalar/json-magic": "^0.12.5", - "@scalar/openapi-parser": "^0.25.8", - "@scalar/openapi-types": "^0.7.0", + "@scalar/json-magic": "^0.12.15", + "@scalar/openapi-parser": "^0.28.6", + "@scalar/openapi-types": "^0.9.1", "@typespec/asset-emitter": "^0.79.1", "yaml": "^2.8.3" }, @@ -1303,14 +1179,14 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/events": "^0.82.0", - "@typespec/http": "^1.12.0", - "@typespec/json-schema": "^1.12.0", - "@typespec/openapi": "^1.12.0", - "@typespec/sse": "^0.82.0", - "@typespec/streams": "^0.82.0", - "@typespec/versioning": "^0.82.0" + "@typespec/compiler": "^1.13.0", + "@typespec/events": "^0.83.0", + "@typespec/http": "^1.13.0", + "@typespec/json-schema": "^1.13.0", + "@typespec/openapi": "^1.13.0", + "@typespec/sse": "^0.83.0", + "@typespec/streams": "^0.83.0", + "@typespec/versioning": "^0.83.0" }, "peerDependenciesMeta": { "@typespec/events": { @@ -1334,67 +1210,67 @@ } }, "node_modules/@typespec/rest": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.82.0.tgz", - "integrity": "sha512-cKjKEd8lgE3EdU9b5xXLoSdKBcifITOhHS2n9LPbEG9w6APfWDWGdtUe4UKV3wxWq9HlT143wpECW7IjrPhjnA==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.83.0.tgz", + "integrity": "sha512-WMEwEe1kdaOdZ0c+ct5BVmTSBXkrPniUYDWCz3K52T4in2dNc7J6YGP6tL8bXgQz5B0CsP0VNO12N+UysQDsLw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0" + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0" } }, "node_modules/@typespec/sse": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.82.0.tgz", - "integrity": "sha512-4jBByfLsS7yQAIqmbLkfrw4XoPm9kOqawvW5gVXmKtnMMDYR0RmfBhsnAXBqhUXGbnFq0bDJGEw3GX+6k3mKnA==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.83.0.tgz", + "integrity": "sha512-04WNaju2rwBbcF5pG+HrKQtdcrmSGuTVziLHNA9XOqj1qM7Uon3+wo2g+ZZ3Z6tngfqQoTCPyDcRHqZtGRdNuw==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/events": "^0.82.0", - "@typespec/http": "^1.12.0", - "@typespec/streams": "^0.82.0" + "@typespec/compiler": "^1.13.0", + "@typespec/events": "^0.83.0", + "@typespec/http": "^1.13.0", + "@typespec/streams": "^0.83.0" } }, "node_modules/@typespec/streams": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.82.0.tgz", - "integrity": "sha512-cr/6h6VV/6OJeG8RNcSd0SDes5iEXiuGUcKGrMN6wF8qKTTrY2hXNhfqCCn3lamDOg00wbi7ke+laz6pHWN3tg==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.83.0.tgz", + "integrity": "sha512-wbO6sdH1Uf+UwjxxsWdHQkjJ3wwiYsAKI+L66qnDYVXAFe02sUdMKd0mxH5o9ipGXE52MZ+yvZ52vHAD+g3RFQ==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0" + "@typespec/compiler": "^1.13.0" } }, "node_modules/@typespec/versioning": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.82.0.tgz", - "integrity": "sha512-s8giuYQTQPniy2YxNfKXYpAU2Vm4L74TdOsbFWe0tG+jnOy/9tt7kKTH4QF1sB8nRvmjv8h31EoHtZYOPe1GvA==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.83.0.tgz", + "integrity": "sha512-nE66ta0ixpHB6FQpSzqnj8QnVfgFsxeK/4Xv+DxYx2nB/w18f6VjkF+hW+A/zs1tZIYvBZVbCNa/Rcr8zM6fhg==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0" + "@typespec/compiler": "^1.13.0" } }, "node_modules/@typespec/xml": { - "version": "0.82.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.82.0.tgz", - "integrity": "sha512-/Bwlt7HwSltojSbalkh7hGRh/lB5aMJllnb7gAAf3xRPMlnmu5VJqDFFcbZKqDvkwgGXZX/xHo458c4kott5Ug==", + "version": "0.83.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.83.0.tgz", + "integrity": "sha512-2/dtAD8jGPkIdwpQ1G1P+5+qdMPeafQiIKCd8NdAnOo0w9OZ59Io52jINm9HdN8+FcbOrqK8+B2N9rlPRj7PqA==", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.12.0" + "@typespec/compiler": "^1.13.0" } }, "node_modules/ajv": { @@ -1833,9 +1709,9 @@ } }, "node_modules/prettier": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", - "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", + "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -1875,9 +1751,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", - "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 12a6ce18f93f..6d4440af96a1 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,35 +1,26 @@ { "name": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-python": "0.63.0" + "@azure-tools/typespec-python": "0.63.1" }, "devDependencies": { - "@typespec/compiler": "^1.12.0", - "@typespec/http": "^1.12.0", - "@typespec/rest": "~0.82.0", - "@typespec/versioning": "~0.82.0", - "@typespec/openapi": "^1.12.0", - "@typespec/events": "~0.82.0", - "@typespec/sse": "~0.82.0", - "@typespec/streams": "~0.82.0", - "@typespec/xml": "~0.82.0", - "@typespec/openapi3": "1.12.0", -<<<<<<< HEAD -<<<<<<< HEAD - "@typespec/http-client-python": "^0.31.0", + "@typespec/compiler": "^1.13.0", + "@typespec/http": "^1.13.0", + "@typespec/rest": "~0.83.0", + "@typespec/versioning": "~0.83.0", + "@typespec/openapi": "^1.13.0", + "@typespec/events": "~0.83.0", + "@typespec/sse": "~0.83.0", + "@typespec/streams": "~0.83.0", + "@typespec/xml": "~0.83.0", + "@typespec/openapi3": "1.13.0", + "@typespec/http-client-python": "^0.31.1", "@azure-tools/openai-typespec": "1.20.0", -======= - "@azure-tools/openai-typespec": "1.19.0", ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) -======= - "@typespec/http-client-python": "^0.31.0", - "@azure-tools/openai-typespec": "1.20.0", ->>>>>>> 8c5e21f58f (restore packages) - "@azure-tools/typespec-autorest": "~0.68.0", - "@azure-tools/typespec-azure-core": "~0.68.0", - "@azure-tools/typespec-azure-resource-manager": "~0.68.0", - "@azure-tools/typespec-azure-rulesets": "~0.68.0", - "@azure-tools/typespec-client-generator-core": "~0.68.4", + "@azure-tools/typespec-autorest": "~0.69.0", + "@azure-tools/typespec-azure-core": "~0.69.0", + "@azure-tools/typespec-azure-resource-manager": "~0.69.0", + "@azure-tools/typespec-azure-rulesets": "~0.69.0", + "@azure-tools/typespec-client-generator-core": "~0.69.0", "@azure-tools/typespec-liftr-base": "0.14.0" } } From 2fa9d4b04fd113de1b0ece3a3dcd39170c710987 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 15 Jun 2026 08:52:56 -0700 Subject: [PATCH 38/40] [azure-ai-projects] Emit SDK from TypeSpec (feature/foundry-release e67cdc6) (#47502) --- .../azure-ai-projects/apiview-properties.json | 14 +- .../ai/projects/aio/operations/_operations.py | 569 ------------------ .../azure/ai/projects/models/_models.py | 2 +- .../ai/projects/operations/_operations.py | 564 ----------------- sdk/ai/azure-ai-projects/tsp-location.yaml | 2 +- 5 files changed, 3 insertions(+), 1148 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 600e3cf11cca..37f1180762a5 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -481,17 +481,5 @@ "azure.ai.projects.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion", "azure.ai.projects.aio.operations.IndexesOperations.create_or_update": "Azure.AI.Projects.Indexes.createOrUpdateVersion" }, -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - "CrossLanguageVersion": "9cf16cec0d0a" -======= - "CrossLanguageVersion": "3ae42dbde611" ->>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) -======= - "CrossLanguageVersion": "ca205130211f" ->>>>>>> 04139a93e3 ([azure-ai-projects] Emit SDK from TypeSpec, using latest OpenAI TypeSpec package (#47318)) -======= - "CrossLanguageVersion": "9cf16cec0d0a" ->>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) + "CrossLanguageVersion": "0ee459332041" } \ No newline at end of file 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 ead83bf80860..e278f6761204 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 @@ -5028,575 +5028,6 @@ async def delete_optimization_job(self, job_id: str, **kwargs: Any) -> None: if cls: return cls(pipeline_response, None, {}) # type: ignore -<<<<<<< HEAD -<<<<<<< HEAD -======= - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, AsyncList(list_of_elem) - - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_optimization_candidate( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_candidate_file( - self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - """Get a candidate file. - - Stream a specific file from the candidate's blob directory. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: AsyncIterator[bytes] - :rtype: AsyncIterator[bytes] - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_candidate_file_request( - job_id=job_id, - candidate_id=candidate_id, - path=path, - api_version=self._config.api_version, - 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", 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_agents_promote_candidate_request( - job_id=job_id, - candidate_id=candidate_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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - ->>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) -======= ->>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) class BetaEvaluationTaxonomiesOperations: """ 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 8c31b279e262..f5f7d8f14d09 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 @@ -13618,7 +13618,7 @@ class TimerRoutineTrigger(RoutineTrigger, discriminator="timer"): type: Literal[RoutineTriggerType.TIMER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The trigger type. Required. A one-shot timer trigger.""" at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" ) """The UTC date and time at which the timer fires.""" 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 f35e38282aeb..09319efc0d67 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 @@ -8455,570 +8455,6 @@ def delete_optimization_job( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore -<<<<<<< HEAD -<<<<<<< HEAD -======= - @distributed_trace - def list_optimization_candidates( - self, - job_id: str, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.OptimizationCandidate"]: - """Returns a list of candidates for an optimization job. - - List candidates produced by a job. - - :param job_id: The optimization job id. Required. - :type job_id: str - :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and - 100, and the - default is 20. Default value is None. - :paramtype limit: int - :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for - ascending order and``desc`` - for descending order. Known values are: "asc" and "desc". Default value is None. - :paramtype order: str or ~azure.ai.projects.models.PageOrder - :keyword before: A cursor for use in pagination. ``before`` is an object ID that defines your - place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Default value is None. - :paramtype before: str - :return: An iterator like instance of OptimizationCandidate - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.OptimizationCandidate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OptimizationCandidate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(_continuation_token=None): - - _request = build_beta_agents_list_optimization_candidates_request( - job_id=job_id, - limit=limit, - order=order, - after=_continuation_token, - before=before, - api_version=self._config.api_version, - 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) - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OptimizationCandidate], - deserialized.get("data", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("last_id") or None, iter(list_of_elem) - - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) - - _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 [200]: - 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) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_optimization_candidate(self, job_id: str, candidate_id: str, **kwargs: Any) -> _models.CandidateMetadata: - """Get a candidate by id. - - Get a single candidate's metadata, manifest, and promotion info. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateMetadata. The CandidateMetadata is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateMetadata - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateMetadata] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateMetadata, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_config( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateDeployConfig: - """Get candidate deploy config. - - Get the candidate's deploy config JSON. Used to compose ``agents.create_version(...)`` from a - candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateDeployConfig. The CandidateDeployConfig is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateDeployConfig - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateDeployConfig] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_config_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateDeployConfig, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_optimization_candidate_results( - self, job_id: str, candidate_id: str, **kwargs: Any - ) -> _models.CandidateResults: - """Get candidate evaluation results. - - Get full per-task evaluation results for a candidate. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :return: CandidateResults. The CandidateResults is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.CandidateResults - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.CandidateResults] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_optimization_candidate_results_request( - job_id=job_id, - candidate_id=candidate_id, - api_version=self._config.api_version, - 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CandidateResults, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_candidate_file(self, job_id: str, candidate_id: str, *, path: str, **kwargs: Any) -> Iterator[bytes]: - """Get a candidate file. - - Stream a specific file from the candidate's blob directory. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id. Required. - :type candidate_id: str - :keyword path: Relative path of the file to download (e.g. 'files/examples.jsonl'). Required. - :paramtype path: str - :return: Iterator[bytes] - :rtype: Iterator[bytes] - :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 = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_beta_agents_get_candidate_file_request( - job_id=job_id, - candidate_id=candidate_id, - path=path, - api_version=self._config.api_version, - 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", 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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: _models.PromoteCandidateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Required. - :type candidate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def promote_candidate( - self, - job_id: str, - candidate_id: str, - candidate_request: Union[_models.PromoteCandidateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.PromoteCandidateResponse: - """Promote a candidate. - - Promotes a candidate, recording the deployment timestamp and target agent version. - - :param job_id: The optimization job id. Required. - :type job_id: str - :param candidate_id: The candidate id to promote. Required. - :type candidate_id: str - :param candidate_request: Promotion details. Is one of the following types: - PromoteCandidateRequest, JSON, IO[bytes] Required. - :type candidate_request: ~azure.ai.projects.models.PromoteCandidateRequest or JSON or IO[bytes] - :return: PromoteCandidateResponse. The PromoteCandidateResponse is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.PromoteCandidateResponse - :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.PromoteCandidateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(candidate_request, (IOBase, bytes)): - _content = candidate_request - else: - _content = json.dumps(candidate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_agents_promote_candidate_request( - job_id=job_id, - candidate_id=candidate_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 [200]: - 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, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PromoteCandidateResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - ->>>>>>> 5fce783a23 ([azure-ai-projects] Emit SDK from TypeSpec (commit 6aa89cf) (#47294)) -======= ->>>>>>> 5757d1c726 (Emit from latest TypeSpec, including new Agent Optimization methods (#47482)) class BetaEvaluationTaxonomiesOperations: """ diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 52fc108fa8f3..99ceb36cff7f 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 1a46f23eb6ff991b777135f70d7d0782fc0fb324 +commit: e67cdc6ec1f508a0384b8a9f89f7a367f5ca4fe1 repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents From bdcc0a8e36c9a5564aa1d5346c1c255040042da6 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 15 Jun 2026 10:44:26 -0700 Subject: [PATCH 39/40] Add api.md for API consistency check --- sdk/ai/azure-ai-projects/api.md | 11399 ++++++++++++++++++++++++++++++ 1 file changed, 11399 insertions(+) create mode 100644 sdk/ai/azure-ai-projects/api.md diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md new file mode 100644 index 000000000000..509f48f2ee4f --- /dev/null +++ b/sdk/ai/azure-ai-projects/api.md @@ -0,0 +1,11399 @@ +```py +# Package is parsed using apiview-stub-generator(version:0.3.28), Python version: 3.14.3 + + +namespace azure.ai.projects + + class azure.ai.projects.AIProjectClient(AIProjectClientGenerated): implements ContextManager + agents: AgentsOperations + beta: BetaOperations + connections: ConnectionsOperations + datasets: DatasetsOperations + deployments: DeploymentsOperations + evaluation_rules: EvaluationRulesOperations + indexes: IndexesOperations + + def __init__( + self, + endpoint: str, + credential: TokenCredential, + *, + allow_preview: bool = False, + api_version: str = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + @distributed_trace + def get_openai_client( + self, + *, + agent_name: Optional[str] = ..., + **kwargs: Any + ) -> OpenAI: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.ai.projects.aio + + class azure.ai.projects.aio.AIProjectClient(AIProjectClientGenerated): implements AsyncContextManager + agents: AgentsOperations + beta: BetaOperations + connections: ConnectionsOperations + datasets: DatasetsOperations + deployments: DeploymentsOperations + evaluation_rules: EvaluationRulesOperations + indexes: IndexesOperations + + def __init__( + self, + endpoint: str, + credential: AsyncTokenCredential, + *, + allow_preview: bool = False, + api_version: str = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + @distributed_trace + def get_openai_client( + self, + *, + agent_name: Optional[str] = ..., + **kwargs: Any + ) -> AsyncOpenAI: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.ai.projects.aio.operations + + class azure.ai.projects.aio.operations.AgentsOperations(GeneratedAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: AgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version_from_manifest( + self, + agent_name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + manifest_id: str, + metadata: Optional[dict[str, str]] = ..., + parameter_values: dict[str, Any], + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version_from_manifest( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version_from_manifest( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace_async + async def delete( + self, + agent_name: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentResponse: ... + + @distributed_trace_async + async def delete_version( + self, + agent_name: str, + agent_version: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentVersionResponse: ... + + @distributed_trace_async + async def get( + self, + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace_async + async def get_version( + self, + agent_name: str, + agent_version: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + kind: Optional[Union[str, AgentKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AgentDetails]: ... + + @distributed_trace + def list_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AgentVersionDetails]: ... + + + class azure.ai.projects.aio.operations.BetaAgentsOperations(GeneratedBetaAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def cancel_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + async def create_optimization_job( + self, + job: OptimizationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + async def create_optimization_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + async def create_optimization_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + async def create_session( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + version_indicator: VersionIndicator, + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + async def create_session( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + async def create_session( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + async def create_version_from_code( + self, + agent_name: str, + content: CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + async def create_version_from_code( + self, + agent_name: str, + content: JSON, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace_async + async def delete_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_session( + self, + agent_name: str, + session_id: str, + *, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_session_file( + self, + agent_name: str, + agent_session_id: str, + *, + path: str, + recursive: Optional[bool] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def download_code( + self, + agent_name: str, + *, + agent_version: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def download_session_file( + self, + agent_name: str, + agent_session_id: str, + *, + path: str, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> OptimizationJob: ... + + @distributed_trace_async + async def get_session( + self, + agent_name: str, + session_id: str, + *, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @distributed_trace_async + async def get_session_log_stream( + self, + agent_name: str, + agent_version: str, + session_id: str, + **kwargs: Any + ) -> SessionLogEvent: ... + + @distributed_trace + def list_optimization_jobs( + self, + *, + agent_name: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[OptimizationJobListItem]: ... + + @distributed_trace + def list_session_files( + self, + agent_name: str, + agent_session_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + path: Optional[str] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[SessionDirectoryEntry]: ... + + @distributed_trace + def list_sessions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[AgentSessionResource]: ... + + @overload + async def patch_agent_details( + self, + agent_name: str, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + async def patch_agent_details( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + async def patch_agent_details( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace_async + async def stop_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def upload_session_file( + self, + agent_name: str, + session_id: str, + content_or_file_path: bytes | str, + *, + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + + class azure.ai.projects.aio.operations.BetaDatasetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: DataGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace_async + async def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[DataGenerationJob]: ... + + + class azure.ai.projects.aio.operations.BetaEvaluationTaxonomiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + async def create( + self, + name: str, + taxonomy: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + async def create( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace + def list( + self, + *, + input_name: Optional[str] = ..., + input_type: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluationTaxonomy]: ... + + @overload + async def update( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + async def update( + self, + name: str, + taxonomy: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + async def update( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + + class azure.ai.projects.aio.operations.BetaEvaluatorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: EvaluatorGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + async def create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + async def create_version( + self, + name: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + async def create_version( + self, + name: str, + evaluator_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + async def create_version( + self, + name: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace_async + async def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: EvaluatorCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace_async + async def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @distributed_trace_async + async def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def list( + self, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluatorVersion]: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluatorGenerationJob]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluatorVersion]: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + + class azure.ai.projects.aio.operations.BetaInsightsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def generate( + self, + insight: Insight, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + async def generate( + self, + insight: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + async def generate( + self, + insight: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @distributed_trace_async + async def get( + self, + insight_id: str, + *, + include_coordinates: Optional[bool] = ..., + **kwargs: Any + ) -> Insight: ... + + @distributed_trace + def list( + self, + *, + agent_name: Optional[str] = ..., + eval_id: Optional[str] = ..., + include_coordinates: Optional[bool] = ..., + run_id: Optional[str] = ..., + type: Optional[Union[str, InsightType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Insight]: ... + + + class azure.ai.projects.aio.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_update_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + previous_update_id: Optional[str] = ..., + scope: str, + update_delay: Optional[int] = ..., + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + @overload + async def begin_update_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + @overload + async def begin_update_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + @overload + async def create( + self, + *, + content_type: str = "application/json", + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def create( + self, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def create( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def create_memory( + self, + name: str, + *, + content: str, + content_type: str = "application/json", + kind: Union[str, MemoryItemKind], + scope: str, + **kwargs: Any + ) -> MemoryItem: ... + + @overload + async def create_memory( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + async def create_memory( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteMemoryStoreResult: ... + + @distributed_trace_async + async def delete_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> DeleteMemoryResult: ... + + @overload + async def delete_scope( + self, + name: str, + *, + content_type: str = "application/json", + scope: str, + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + async def delete_scope( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + async def delete_scope( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @distributed_trace_async + async def get_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[MemoryStoreDetails]: ... + + @overload + def list_memories( + self, + name: str, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + scope: str, + **kwargs: Any + ) -> AsyncItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: JSON, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: IO[bytes], + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[MemoryItem]: ... + + @overload + async def search_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + options: Optional[MemorySearchOptions] = ..., + previous_search_id: Optional[str] = ..., + scope: str, + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + async def search_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + async def search_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + async def update( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + async def update_memory( + self, + name: str, + memory_id: str, + *, + content: str, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + async def update_memory( + self, + name: str, + memory_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + async def update_memory( + self, + name: str, + memory_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + + class azure.ai.projects.aio.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + *, + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[True] = True, + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> ModelVersion: ... + + @overload + async def create( + self, + *, + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[False], + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> ModelVersion: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: ModelCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + async def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[ModelVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> AsyncItemPaged[ModelVersion]: ... + + @overload + async def pending_create_version( + self, + name: str, + version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + async def pending_create_version( + self, + name: str, + version: str, + model_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + async def pending_create_version( + self, + name: str, + version: str, + model_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: ModelPendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + async def update( + self, + name: str, + version: str, + model_version_update: UpdateModelVersionRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + async def update( + self, + name: str, + version: str, + model_version_update: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + async def update( + self, + name: str, + version: str, + model_version_update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + + class azure.ai.projects.aio.operations.BetaOperations(GeneratedBetaOperations): + agents: BetaAgentsOperations + datasets: BetaDatasetsOperations + evaluation_taxonomies: BetaEvaluationTaxonomiesOperations + evaluators: BetaEvaluatorsOperations + insights: BetaInsightsOperations + memory_stores: BetaMemoryStoresOperations + models: BetaModelsOperations + red_teams: BetaRedTeamsOperations + routines: BetaRoutinesOperations + schedules: BetaSchedulesOperations + skills: BetaSkillsOperations + toolboxes: BetaToolboxesOperations + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.aio.operations.BetaRedTeamsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + red_team: RedTeam, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + async def create( + self, + red_team: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + async def create( + self, + red_team: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[RedTeam]: ... + + + class azure.ai.projects.aio.operations.BetaRoutinesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + routine_name: str, + *, + action: Optional[RoutineAction] = ..., + content_type: str = "application/json", + description: Optional[str] = ..., + enabled: Optional[bool] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + **kwargs: Any + ) -> Routine: ... + + @overload + async def create_or_update( + self, + routine_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @overload + async def create_or_update( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @distributed_trace_async + async def delete( + self, + routine_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def disable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @overload + async def dispatch( + self, + routine_name: str, + *, + content_type: str = "application/json", + payload: Optional[RoutineDispatchPayload] = ..., + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + async def dispatch( + self, + routine_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + async def dispatch( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @distributed_trace_async + async def enable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace_async + async def get( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Routine]: ... + + @distributed_trace + def list_runs( + self, + routine_name: str, + *, + before: Optional[str] = ..., + filter: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[RoutineRun]: ... + + + class azure.ai.projects.aio.operations.BetaSchedulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + schedule_id: str, + schedule: Schedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + async def create_or_update( + self, + schedule_id: str, + schedule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + async def create_or_update( + self, + schedule_id: str, + schedule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace_async + async def delete( + self, + schedule_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + schedule_id: str, + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace_async + async def get_run( + self, + schedule_id: str, + run_id: str, + **kwargs: Any + ) -> ScheduleRun: ... + + @distributed_trace + def list( + self, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Schedule]: ... + + @distributed_trace + def list_runs( + self, + schedule_id: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ScheduleRun]: ... + + + class azure.ai.projects.aio.operations.BetaSkillsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + name: str, + *, + content_type: str = "application/json", + default: Optional[bool] = ..., + inline_content: Optional[SkillInlineContent] = ..., + **kwargs: Any + ) -> SkillVersion: ... + + @overload + async def create( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + async def create( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + async def create_from_files( + self, + name: str, + content: CreateSkillVersionFromFilesBody, + **kwargs: Any + ) -> SkillVersion: ... + + @overload + async def create_from_files( + self, + name: str, + content: JSON, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteSkillResult: ... + + @distributed_trace_async + async def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> DeleteSkillVersionResult: ... + + @distributed_trace_async + async def download( + self, + name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def download_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> SkillDetails: ... + + @distributed_trace_async + async def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[SkillDetails]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[SkillVersion]: ... + + @overload + async def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> SkillDetails: ... + + @overload + async def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + @overload + async def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + + class azure.ai.projects.aio.operations.BetaToolboxesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_version( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[List[ToolboxSkill]] = ..., + tools: List[Tool], + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + async def create_version( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + async def create_version( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace_async + async def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @distributed_trace_async + async def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ToolboxObject]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[ToolboxVersionObject]: ... + + @overload + async def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + async def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + async def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + + class azure.ai.projects.aio.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace_async + async def get_default( + self, + connection_type: Union[str, ConnectionType], + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, ConnectionType]] = ..., + default_connection: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Connection]: ... + + + class azure.ai.projects.aio.operations.DatasetsOperations(DatasetsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace_async + async def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace_async + async def get_credentials( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[DatasetVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> AsyncItemPaged[DatasetVersion]: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + async def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @distributed_trace_async + async def upload_file( + self, + *, + connection_name: Optional[str] = ..., + file_path: str, + name: str, + version: str, + **kwargs: Any + ) -> FileDatasetVersion: ... + + @distributed_trace_async + async def upload_folder( + self, + *, + connection_name: Optional[str] = ..., + file_pattern: Optional[Pattern] = ..., + folder: str, + name: str, + version: str, + **kwargs: Any + ) -> FolderDatasetVersion: ... + + + class azure.ai.projects.aio.operations.DeploymentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> Deployment: ... + + @distributed_trace + def list( + self, + *, + deployment_type: Optional[Union[str, DeploymentType]] = ..., + model_name: Optional[str] = ..., + model_publisher: Optional[str] = ..., + **kwargs: Any + ) -> AsyncItemPaged[Deployment]: ... + + + class azure.ai.projects.aio.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + id: str, + evaluation_rule: EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + async def create_or_update( + self, + id: str, + evaluation_rule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + async def create_or_update( + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace_async + async def delete( + self, + id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + id: str, + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace + def list( + self, + *, + action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., + agent_name: Optional[str] = ..., + enabled: Optional[bool] = ..., + **kwargs: Any + ) -> AsyncItemPaged[EvaluationRule]: ... + + + class azure.ai.projects.aio.operations.IndexesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + index: Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + index: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + async def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @distributed_trace_async + async def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> Index: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Index]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> AsyncItemPaged[Index]: ... + + + class azure.ai.projects.aio.operations.TelemetryOperations: + + def __init__(self, outer_instance: AIProjectClient) -> None: ... + + @distributed_trace_async + async def get_application_insights_connection_string(self) -> str: ... + + +namespace azure.ai.projects.models + + class azure.ai.projects.models.A2APreviewTool(Tool, discriminator='a2a_preview'): + agent_card_path: Optional[str] + base_url: Optional[str] + description: Optional[str] + name: Optional[str] + project_connection_id: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.A2A_PREVIEW] + + @overload + def __init__( + self, + *, + agent_card_path: Optional[str] = ..., + base_url: Optional[str] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AISearchIndexResource(_Model): + filter: Optional[str] + index_asset_id: Optional[str] + index_name: Optional[str] + project_connection_id: Optional[str] + query_type: Optional[Union[str, AzureAISearchQueryType]] + top_k: Optional[int] + + @overload + def __init__( + self, + *, + filter: Optional[str] = ..., + index_asset_id: Optional[str] = ..., + index_name: Optional[str] = ..., + project_connection_id: Optional[str] = ..., + query_type: Optional[Union[str, AzureAISearchQueryType]] = ..., + top_k: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentBlueprintReference(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentBlueprintReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED_AGENT_IDENTITY_BLUEPRINT = "ManagedAgentIdentityBlueprint" + + + class azure.ai.projects.models.AgentCard(_Model): + description: Optional[str] + skills: list[AgentCardSkill] + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + skills: list[AgentCardSkill], + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentCardSkill(_Model): + description: Optional[str] + examples: Optional[list[str]] + id: str + name: str + tags: Optional[list[str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + examples: Optional[list[str]] = ..., + id: str, + name: str, + tags: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentClusterInsightRequest(InsightRequest, discriminator='AgentClusterInsight'): + agent_name: str + model_configuration: Optional[InsightModelConfiguration] + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + + @overload + def __init__( + self, + *, + agent_name: str, + model_configuration: Optional[InsightModelConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentClusterInsightResult(InsightResult, discriminator='AgentClusterInsight'): + cluster_insight: ClusterInsightResult + type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] + + @overload + def __init__( + self, + *, + cluster_insight: ClusterInsightResult + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentDataGenerationJobSource(DataGenerationJobSource, discriminator='agent'): + agent_name: str + agent_version: Optional[str] + description: str + type: Literal[DataGenerationJobSourceType.AGENT] + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: Optional[str] = ..., + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentDefinition(_Model): + kind: str + rai_config: Optional[RaiConfig] + + @overload + def __init__( + self, + *, + kind: str, + rai_config: Optional[RaiConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentDetails(_Model): + agent_card: Optional[AgentCard] + agent_endpoint: Optional[AgentEndpointConfig] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + id: str + instance_identity: Optional[AgentIdentity] + name: str + object: Literal[AgentObjectType.AGENT] + versions: AgentObjectVersions + + @overload + def __init__( + self, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + id: str, + name: str, + object: Literal[AgentObjectType.AGENT], + versions: AgentObjectVersions + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentEndpointAuthorizationScheme(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentEndpointAuthorizationSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOT_SERVICE = "BotService" + BOT_SERVICE_RBAC = "BotServiceRbac" + ENTRA = "Entra" + + + class azure.ai.projects.models.AgentEndpointConfig(_Model): + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] + protocols: Optional[list[Union[str, AgentEndpointProtocol]]] + version_selector: Optional[VersionSelector] + + @overload + def __init__( + self, + *, + authorization_schemes: Optional[list[AgentEndpointAuthorizationScheme]] = ..., + protocols: Optional[list[Union[str, AgentEndpointProtocol]]] = ..., + version_selector: Optional[VersionSelector] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentEndpointProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A = "a2a" + ACTIVITY = "activity" + INVOCATIONS = "invocations" + INVOCATIONS_WS = "invocations_ws" + MCP = "mcp" + RESPONSES = "responses" + + + class azure.ai.projects.models.AgentEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='agent'): + agent_name: str + agent_version: Optional[str] + description: Optional[str] + type: Literal[EvaluatorGenerationJobSourceType.AGENT] + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: Optional[str] = ..., + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentIdentity(_Model): + client_id: str + principal_id: str + + @overload + def __init__( + self, + *, + client_id: str, + principal_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "external" + HOSTED = "hosted" + PROMPT = "prompt" + WORKFLOW = "workflow" + + + class azure.ai.projects.models.AgentObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + AGENT_CONTAINER = "agent.container" + AGENT_DELETED = "agent.deleted" + AGENT_VERSION = "agent.version" + AGENT_VERSION_DELETED = "agent.version.deleted" + + + class azure.ai.projects.models.AgentObjectVersions(_Model): + latest: AgentVersionDetails + + @overload + def __init__( + self, + *, + latest: AgentVersionDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A = "a2a" + ACTIVITY_PROTOCOL = "activity_protocol" + INVOCATIONS = "invocations" + INVOCATIONS_WS = "invocations_ws" + MCP = "mcp" + RESPONSES = "responses" + + + class azure.ai.projects.models.AgentSessionResource(_Model): + agent_session_id: str + created_at: datetime + expires_at: datetime + last_accessed_at: datetime + status: Union[str, AgentSessionStatus] + version_indicator: VersionIndicator + + @overload + def __init__( + self, + *, + agent_session_id: str, + status: Union[str, AgentSessionStatus], + version_indicator: VersionIndicator + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentSessionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + EXPIRED = "expired" + FAILED = "failed" + IDLE = "idle" + UPDATING = "updating" + + + class azure.ai.projects.models.AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator='agent'): + risk_categories: list[Union[str, RiskCategory]] + target: EvaluationTarget + type: Literal[EvaluationTaxonomyInputType.AGENT] + + @overload + def __init__( + self, + *, + risk_categories: list[Union[str, RiskCategory]], + target: EvaluationTarget + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentVersionDetails(_Model): + agent_guid: Optional[str] + blueprint: Optional[AgentIdentity] + blueprint_reference: Optional[AgentBlueprintReference] + created_at: datetime + definition: AgentDefinition + description: Optional[str] + id: str + instance_identity: Optional[AgentIdentity] + metadata: dict[str, str] + name: str + object: Literal[AgentObjectType.AGENT_VERSION] + status: Optional[Union[str, AgentVersionStatus]] + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + definition: AgentDefinition, + description: Optional[str] = ..., + id: str, + metadata: dict[str, str], + name: str, + object: Literal[AgentObjectType.AGENT_VERSION], + status: Optional[Union[str, AgentVersionStatus]] = ..., + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AgentVersionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "active" + CREATING = "creating" + DELETED = "deleted" + DELETING = "deleting" + FAILED = "failed" + + + class azure.ai.projects.models.AgenticIdentityPreviewCredentials(BaseCredentials, discriminator='AgenticIdentityToken_Preview'): + type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ApiError(_Model): + additional_info: Optional[dict[str, Any]] + code: str + debug_info: Optional[dict[str, Any]] + details: Optional[list[ApiError]] + message: str + param: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + additional_info: Optional[dict[str, Any]] = ..., + code: str, + debug_info: Optional[dict[str, Any]] = ..., + details: Optional[list[ApiError]] = ..., + message: str, + param: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ApiErrorResponse(_Model): + error: ApiError + + @overload + def __init__( + self, + *, + error: ApiError + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ApiKeyCredentials(BaseCredentials, discriminator='ApiKey'): + api_key: Optional[str] + type: Literal[CredentialType.API_KEY] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ApplyPatchToolParam(Tool, discriminator='apply_patch'): + type: Literal[ToolType.APPLY_PATCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] + + @overload + def __init__( + self, + *, + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ArtifactProfile(_Model): + category: Union[str, FoundryModelArtifactProfileCategory] + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] + + @overload + def __init__( + self, + *, + category: Union[str, FoundryModelArtifactProfileCategory], + signals: Optional[list[Union[str, FoundryModelArtifactProfileSignal]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AsyncUpdateMemoriesLROPoller(AsyncLROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> AsyncUpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSI_ATTACK = "ansi_attack" + ASCII_ART = "ascii_art" + ASCII_SMUGGLER = "ascii_smuggler" + ATBASH = "atbash" + BASE64 = "base64" + BASELINE = "baseline" + BINARY = "binary" + CAESAR = "caesar" + CHARACTER_SPACE = "character_space" + CHARACTER_SWAP = "character_swap" + CRESCENDO = "crescendo" + DIACRITIC = "diacritic" + DIFFICULT = "difficult" + EASY = "easy" + FLIP = "flip" + INDIRECT_JAILBREAK = "indirect_jailbreak" + JAILBREAK = "jailbreak" + LEETSPEAK = "leetspeak" + MODERATE = "moderate" + MORSE = "morse" + MULTI_TURN = "multi_turn" + ROT13 = "rot13" + STRING_JOIN = "string_join" + SUFFIX_APPEND = "suffix_append" + TENSE = "tense" + UNICODE_CONFUSABLE = "unicode_confusable" + UNICODE_SUBSTITUTION = "unicode_substitution" + URL = "url" + + + class azure.ai.projects.models.AutoCodeInterpreterToolParam(_Model): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + type: Literal["auto"] + + @overload + def __init__( + self, + *, + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAIAgentTarget(EvaluationTarget, discriminator='azure_ai_agent'): + name: str + tool_descriptions: Optional[list[ToolDescription]] + tools: Optional[list[Tool]] + type: Literal["azure_ai_agent"] + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + tool_descriptions: Optional[list[ToolDescription]] = ..., + tools: Optional[list[Tool]] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAIAgentTargetParam(TypedDict, total=False): + key "name": Required[str] + key "tool_descriptions": List[ToolDescriptionParam] + key "type": Required[Literal["azure_ai_agent"]] + key "version": str + + + class azure.ai.projects.models.AzureAIBenchmarkPreviewEvalRunDataSource(TypedDict, total=False): + key "input_messages": InputMessagesItemReference + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_benchmark_preview"]] + + + class azure.ai.projects.models.AzureAIDataSourceConfig(TypedDict, total=False): + key "scenario": Required[str] + key "type": Required[Literal["azure_ai_source"]] + + + class azure.ai.projects.models.AzureAIModelTarget(EvaluationTarget, discriminator='azure_ai_model'): + model: Optional[str] + sampling_params: Optional[ModelSamplingParams] + type: Literal["azure_ai_model"] + + @overload + def __init__( + self, + *, + model: Optional[str] = ..., + sampling_params: Optional[ModelSamplingParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAIModelTargetParam(TypedDict, total=False): + key "model": str + key "sampling_params": ModelSamplingConfigParam + key "type": Required[Literal["azure_ai_model"]] + + + class azure.ai.projects.models.AzureAIResponsesEvalRunDataSource(TypedDict, total=False): + key "event_configuration_id": str + key "item_generation_params": Required[ResponseRetrievalItemGenerationParams] + key "max_runs_hourly": int + key "type": Required[Literal["azure_ai_responses"]] + + + class azure.ai.projects.models.AzureAISearchIndex(Index, discriminator='AzureSearch'): + connection_name: str + description: str + field_mapping: Optional[FieldMapping] + id: str + index_name: str + name: str + tags: dict[str, str] + type: Literal[IndexType.AZURE_SEARCH] + version: str + + @overload + def __init__( + self, + *, + connection_name: str, + description: Optional[str] = ..., + field_mapping: Optional[FieldMapping] = ..., + index_name: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC = "semantic" + SIMPLE = "simple" + VECTOR = "vector" + VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" + VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" + + + class azure.ai.projects.models.AzureAISearchTool(Tool, discriminator='azure_ai_search'): + azure_ai_search: AzureAISearchToolResource + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.AZURE_AI_SEARCH] + + @overload + def __init__( + self, + *, + azure_ai_search: AzureAISearchToolResource, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureAISearchToolResource(_Model): + indexes: list[AISearchIndexResource] + + @overload + def __init__( + self, + *, + indexes: list[AISearchIndexResource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureFunctionBinding(_Model): + storage_queue: AzureFunctionStorageQueue + type: Literal["storage_queue"] + + @overload + def __init__( + self, + *, + storage_queue: AzureFunctionStorageQueue + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureFunctionDefinition(_Model): + function: AzureFunctionDefinitionFunction + input_binding: AzureFunctionBinding + output_binding: AzureFunctionBinding + + @overload + def __init__( + self, + *, + function: AzureFunctionDefinitionFunction, + input_binding: AzureFunctionBinding, + output_binding: AzureFunctionBinding + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureFunctionStorageQueue(_Model): + queue_name: str + queue_service_endpoint: str + + @overload + def __init__( + self, + *, + queue_name: str, + queue_service_endpoint: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureFunctionTool(Tool, discriminator='azure_function'): + azure_function: AzureFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.AZURE_FUNCTION] + + @overload + def __init__( + self, + *, + azure_function: AzureFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.AzureOpenAIModelConfiguration(RedTeamTargetConfig, discriminator='AzureOpenAIModel'): + model_deployment_name: str + type: Literal["AzureOpenAIModel"] + + @overload + def __init__( + self, + *, + model_deployment_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BaseCredentials(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingCustomSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + instance_name: str + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] + + @overload + def __init__( + self, + *, + count: Optional[int] = ..., + freshness: Optional[str] = ..., + instance_name: str, + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingCustomSearchPreviewTool(Tool, discriminator='bing_custom_search_preview'): + bing_custom_search_preview: BingCustomSearchToolParameters + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] + + @overload + def __init__( + self, + *, + bing_custom_search_preview: BingCustomSearchToolParameters, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingCustomSearchToolParameters(_Model): + search_configurations: list[BingCustomSearchConfiguration] + + @overload + def __init__( + self, + *, + search_configurations: list[BingCustomSearchConfiguration] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingGroundingSearchConfiguration(_Model): + count: Optional[int] + freshness: Optional[str] + market: Optional[str] + project_connection_id: str + set_lang: Optional[str] + + @overload + def __init__( + self, + *, + count: Optional[int] = ..., + freshness: Optional[str] = ..., + market: Optional[str] = ..., + project_connection_id: str, + set_lang: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingGroundingSearchToolParameters(_Model): + search_configurations: list[BingGroundingSearchConfiguration] + + @overload + def __init__( + self, + *, + search_configurations: list[BingGroundingSearchConfiguration] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BingGroundingTool(Tool, discriminator='bing_grounding'): + bing_grounding: BingGroundingSearchToolParameters + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.BING_GROUNDING] + + @overload + def __init__( + self, + *, + bing_grounding: BingGroundingSearchToolParameters, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BlobReference(_Model): + blob_uri: str + credential: BlobReferenceSasCredential + storage_account_arm_id: str + + @overload + def __init__( + self, + *, + blob_uri: str, + credential: BlobReferenceSasCredential, + storage_account_arm_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BlobReferenceSasCredential(_Model): + sas_uri: str + type: Literal["SAS"] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.BotServiceAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotService'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BotServiceRbacAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='BotServiceRbac'): + type: Literal[AgentEndpointAuthorizationSchemeType.BOT_SERVICE_RBAC] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BrowserAutomationPreviewTool(Tool, discriminator='browser_automation_preview'): + browser_automation_preview: BrowserAutomationToolParameters + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.BROWSER_AUTOMATION_PREVIEW] + + @overload + def __init__( + self, + *, + browser_automation_preview: BrowserAutomationToolParameters, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BrowserAutomationToolConnectionParameters(_Model): + project_connection_id: str + + @overload + def __init__( + self, + *, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.BrowserAutomationToolParameters(_Model): + connection: BrowserAutomationToolConnectionParameters + + @overload + def __init__( + self, + *, + connection: BrowserAutomationToolConnectionParameters + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CaptureStructuredOutputsTool(Tool, discriminator='capture_structured_outputs'): + description: Optional[str] + name: Optional[str] + outputs: StructuredOutputDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CAPTURE_STRUCTURED_OUTPUTS] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + outputs: StructuredOutputDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ChartCoordinate(_Model): + size: int + x: int + y: int + + @overload + def __init__( + self, + *, + size: int, + x: int, + y: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ChatSummaryMemoryItem(MemoryItem, discriminator='chat_summary'): + content: str + kind: Literal[MemoryItemKind.CHAT_SUMMARY] + memory_id: str + scope: str + updated_at: datetime + + @overload + def __init__( + self, + *, + content: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ClusterInsightResult(_Model): + clusters: list[InsightCluster] + coordinates: Optional[dict[str, ChartCoordinate]] + summary: InsightSummary + + @overload + def __init__( + self, + *, + clusters: list[InsightCluster], + coordinates: Optional[dict[str, ChartCoordinate]] = ..., + summary: InsightSummary + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ClusterTokenUsage(_Model): + input_token_usage: int + output_token_usage: int + total_token_usage: int + + @overload + def __init__( + self, + *, + input_token_usage: int, + output_token_usage: int, + total_token_usage: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='code'): + blob_uri: Optional[str] + code_text: Optional[str] + data_schema: dict[str, any] + entry_point: Optional[str] + image_tag: Optional[str] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + type: Literal[EvaluatorDefinitionType.CODE] + + @overload + def __init__( + self, + *, + blob_uri: Optional[str] = ..., + code_text: Optional[str] = ..., + data_schema: Optional[dict[str, Any]] = ..., + entry_point: Optional[str] = ..., + image_tag: Optional[str] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CodeConfiguration(_Model): + content_hash: Optional[str] + dependency_resolution: Union[str, CodeDependencyResolution] + entry_point: list[str] + runtime: str + + @overload + def __init__( + self, + *, + dependency_resolution: Union[str, CodeDependencyResolution], + entry_point: list[str], + runtime: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CodeDependencyResolution(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUNDLED = "bundled" + REMOTE_BUILD = "remote_build" + + + class azure.ai.projects.models.CodeInterpreterTool(Tool, discriminator='code_interpreter'): + container: Optional[Union[str, AutoCodeInterpreterToolParam]] + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.CODE_INTERPRETER] + + @overload + def __init__( + self, + *, + container: Optional[Union[str, AutoCodeInterpreterToolParam]] = ..., + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ComparisonFilter(_Model): + key: str + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"] + value: Union[str, float, bool, list[Union[str, float]]] + + @overload + def __init__( + self, + *, + key: str, + type: Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"], + value: Union[str, float, bool, list[Union[str, float]]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CompoundFilter(_Model): + filters: list[Union[ComparisonFilter, Any]] + type: Literal["and", "or"] + + @overload + def __init__( + self, + *, + filters: list[Union[ComparisonFilter, Any]], + type: Literal["and", "or"] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROWSER = "browser" + LINUX = "linux" + MAC = "mac" + UBUNTU = "ubuntu" + WINDOWS = "windows" + + + class azure.ai.projects.models.ComputerTool(Tool, discriminator='computer'): + type: Literal[ToolType.COMPUTER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ComputerUsePreviewTool(Tool, discriminator='computer_use_preview'): + display_height: int + display_width: int + environment: Union[str, ComputerEnvironment] + type: Literal[ToolType.COMPUTER_USE_PREVIEW] + + @overload + def __init__( + self, + *, + display_height: int, + display_width: int, + environment: Union[str, ComputerEnvironment] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Connection(_Model): + credentials: BaseCredentials + id: str + is_default: bool + metadata: dict[str, str] + name: str + target: str + type: Union[str, ConnectionType] + + + class azure.ai.projects.models.ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + API_KEY = "ApiKey" + APPLICATION_CONFIGURATION = "AppConfig" + APPLICATION_INSIGHTS = "AppInsights" + AZURE_AI_SEARCH = "CognitiveSearch" + AZURE_BLOB_STORAGE = "AzureBlob" + AZURE_OPEN_AI = "AzureOpenAI" + AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" + COSMOS_DB = "CosmosDB" + CUSTOM = "CustomKeys" + REMOTE_TOOL = "RemoteTool_Preview" + + + class azure.ai.projects.models.ContainerAutoParam(FunctionShellToolParamEnvironment, discriminator='container_auto'): + file_ids: Optional[list[str]] + memory_limit: Optional[Union[str, ContainerMemoryLimit]] + network_policy: Optional[ContainerNetworkPolicyParam] + skills: Optional[list[ContainerSkill]] + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_AUTO] + + @overload + def __init__( + self, + *, + file_ids: Optional[list[str]] = ..., + memory_limit: Optional[Union[str, ContainerMemoryLimit]] = ..., + network_policy: Optional[ContainerNetworkPolicyParam] = ..., + skills: Optional[list[ContainerSkill]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerConfiguration(_Model): + image: str + + @overload + def __init__( + self, + *, + image: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_16GB = "16g" + MEMORY_1GB = "1g" + MEMORY_4GB = "4g" + MEMORY_64GB = "64g" + + + class azure.ai.projects.models.ContainerNetworkPolicyAllowlistParam(ContainerNetworkPolicyParam, discriminator='allowlist'): + allowed_domains: list[str] + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] + type: Literal[ContainerNetworkPolicyParamType.ALLOWLIST] + + @overload + def __init__( + self, + *, + allowed_domains: list[str], + domain_secrets: Optional[list[ContainerNetworkPolicyDomainSecretParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyDisabledParam(ContainerNetworkPolicyParam, discriminator='disabled'): + type: Literal[ContainerNetworkPolicyParamType.DISABLED] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyDomainSecretParam(_Model): + domain: str + name: str + value: str + + @overload + def __init__( + self, + *, + domain: str, + name: str, + value: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyParam(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerNetworkPolicyParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWLIST = "allowlist" + DISABLED = "disabled" + + + class azure.ai.projects.models.ContainerSkill(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ContainerSkillType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + SKILL_REFERENCE = "skill_reference" + + + class azure.ai.projects.models.ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator='continuousEvaluation'): + eval_id: str + max_hourly_runs: Optional[int] + sampling_rate: Optional[float] + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] + + @overload + def __init__( + self, + *, + eval_id: str, + max_hourly_runs: Optional[int] = ..., + sampling_rate: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CosmosDBIndex(Index, discriminator='CosmosDBNoSqlVectorStore'): + connection_name: str + container_name: str + database_name: str + description: str + embedding_configuration: EmbeddingConfiguration + field_mapping: FieldMapping + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.COSMOS_DB] + version: str + + @overload + def __init__( + self, + *, + connection_name: str, + container_name: str, + database_name: str, + description: Optional[str] = ..., + embedding_configuration: EmbeddingConfiguration, + field_mapping: FieldMapping, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateAgentVersionFromCodeContent(_Model): + code: Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]] + metadata: CreateAgentVersionFromCodeMetadata + + @overload + def __init__( + self, + *, + code: FileType, + metadata: CreateAgentVersionFromCodeMetadata + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateAgentVersionFromCodeMetadata(_Model): + definition: HostedAgentDefinition + description: Optional[str] + metadata: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + definition: HostedAgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateAsyncResponse(_Model): + location: Optional[str] + operation_result: Optional[str] + + @overload + def __init__( + self, + *, + location: Optional[str] = ..., + operation_result: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CreateSkillVersionFromFilesBody(_Model): + default: Optional[bool] + files: list[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + + @overload + def __init__( + self, + *, + default: Optional[bool] = ..., + files: list[FileType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" + API_KEY = "ApiKey" + CUSTOM = "CustomKeys" + ENTRA_ID = "AAD" + NONE = "None" + SAS = "SAS" + + + class azure.ai.projects.models.CronTrigger(Trigger, discriminator='Cron'): + end_time: Optional[datetime] + expression: str + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.CRON] + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + expression: str, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomCredential(CustomCredentialGenerated, discriminator='CustomKeys'): + credential_keys: Dict[str, str] + type: Union[str, CredentialType] + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.models.CustomGrammarFormatParam(CustomToolParamFormat, discriminator='grammar'): + definition: str + syntax: Union[str, GrammarSyntax1] + type: Literal[CustomToolParamFormatType.GRAMMAR] + + @overload + def __init__( + self, + *, + definition: str, + syntax: Union[str, GrammarSyntax1] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomRoutineTrigger(RoutineTrigger, discriminator='custom'): + event_name: Optional[str] + parameters: dict[str, Any] + provider: str + type: Literal[RoutineTriggerType.CUSTOM] + + @overload + def __init__( + self, + *, + event_name: Optional[str] = ..., + parameters: dict[str, Any], + provider: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomTextFormatParam(CustomToolParamFormat, discriminator='text'): + type: Literal[CustomToolParamFormatType.TEXT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomToolParam(Tool, discriminator='custom'): + defer_loading: Optional[bool] + description: Optional[str] + format: Optional[CustomToolParamFormat] + name: str + type: Literal[ToolType.CUSTOM] + + @overload + def __init__( + self, + *, + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + format: Optional[CustomToolParamFormat] = ..., + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomToolParamFormat(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRAMMAR = "grammar" + TEXT = "text" + + + class azure.ai.projects.models.DailyRecurrenceSchedule(RecurrenceSchedule, discriminator='Daily'): + hours: list[int] + type: Literal[RecurrenceType.DAILY] + + @overload + def __init__( + self, + *, + hours: list[int] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + inputs: Optional[DataGenerationJobInputs] + result: Optional[DataGenerationJobResult] + status: Union[str, JobStatus] + + @overload + def __init__( + self, + *, + inputs: Optional[DataGenerationJobInputs] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobInputs(_Model): + name: str + options: DataGenerationJobOptions + output_options: Optional[DataGenerationJobOutputOptions] + scenario: Union[str, DataGenerationJobScenario] + sources: list[DataGenerationJobSource] + + @overload + def __init__( + self, + *, + name: str, + options: DataGenerationJobOptions, + output_options: Optional[DataGenerationJobOutputOptions] = ..., + scenario: Union[str, DataGenerationJobScenario], + sources: list[DataGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobOptions(_Model): + max_samples: int + model_options: Optional[DataGenerationModelOptions] + train_split: Optional[float] + type: str + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobOutput(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobOutputOptions(_Model): + description: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATASET = "dataset" + FILE = "file" + + + class azure.ai.projects.models.DataGenerationJobResult(_Model): + generated_samples: int + outputs: Optional[list[DataGenerationJobOutput]] + token_usage: Optional[DataGenerationTokenUsage] + + @overload + def __init__( + self, + *, + generated_samples: int, + outputs: Optional[list[DataGenerationJobOutput]] = ..., + token_usage: Optional[DataGenerationTokenUsage] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobScenario(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "evaluation" + REINFORCEMENT_FINETUNING = "reinforcement_finetuning" + SUPERVISED_FINETUNING = "supervised_finetuning" + + + class azure.ai.projects.models.DataGenerationJobSource(_Model): + description: Optional[str] + type: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + FILE = "file" + PROMPT = "prompt" + TRACES = "traces" + + + class azure.ai.projects.models.DataGenerationJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SIMPLE_QNA = "simple_qna" + TOOL_USE = "tool_use" + TRACES = "traces" + + + class azure.ai.projects.models.DataGenerationModelOptions(_Model): + model: str + + @overload + def __init__( + self, + *, + model: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DataGenerationTokenUsage(_Model): + completion_tokens: int + prompt_tokens: int + total_tokens: int + + + class azure.ai.projects.models.DatasetCredential(_Model): + blob_reference: BlobReference + + @overload + def __init__( + self, + *, + blob_reference: BlobReference + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DatasetDataGenerationJobOutput(DataGenerationJobOutput, discriminator='dataset'): + description: Optional[str] + id: Optional[str] + name: Optional[str] + tags: Optional[dict[str, str]] + type: Literal[DataGenerationJobOutputType.DATASET] + version: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DatasetEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='dataset'): + description: Optional[str] + name: str + type: Literal[EvaluatorGenerationJobSourceType.DATASET] + version: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DatasetReference(_Model): + name: str + version: str + + @overload + def __init__( + self, + *, + name: str, + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + URI_FILE = "uri_file" + URI_FOLDER = "uri_folder" + + + class azure.ai.projects.models.DatasetVersion(_Model): + connection_name: Optional[str] + data_uri: str + description: Optional[str] + id: Optional[str] + is_reference: Optional[bool] + name: str + tags: Optional[dict[str, str]] + type: str + version: str + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FRIDAY = "Friday" + MONDAY = "Monday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" + THURSDAY = "Thursday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + + + class azure.ai.projects.models.DeleteAgentResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_DELETED] + + @overload + def __init__( + self, + *, + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_DELETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeleteAgentVersionResponse(_Model): + deleted: bool + name: str + object: Literal[AgentObjectType.AGENT_VERSION_DELETED] + version: str + + @overload + def __init__( + self, + *, + deleted: bool, + name: str, + object: Literal[AgentObjectType.AGENT_VERSION_DELETED], + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeleteMemoryResult(_Model): + deleted: bool + memory_id: str + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + + @overload + def __init__( + self, + *, + deleted: bool, + memory_id: str, + object: Literal[MemoryStoreObjectType.MEMORY_DELETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeleteMemoryStoreResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + + @overload + def __init__( + self, + *, + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_DELETED] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeleteSkillResult(_Model): + deleted: bool + id: str + name: str + + @overload + def __init__( + self, + *, + deleted: bool, + id: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeleteSkillVersionResult(_Model): + deleted: bool + id: str + name: str + version: str + + @overload + def __init__( + self, + *, + deleted: bool, + id: str, + name: str, + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Deployment(_Model): + name: str + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MODEL_DEPLOYMENT = "ModelDeployment" + + + class azure.ai.projects.models.Dimension(_Model): + always_applicable: Optional[bool] + description: str + id: str + weight: int + + @overload + def __init__( + self, + *, + always_applicable: Optional[bool] = ..., + description: str, + id: str, + weight: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.DispatchRoutineResult(_Model): + action_correlation_id: Optional[str] + dispatch_id: Optional[str] + task_id: Optional[str] + + @overload + def __init__( + self, + *, + action_correlation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + task_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EmbeddingConfiguration(_Model): + embedding_field: str + model_deployment_name: str + + @overload + def __init__( + self, + *, + embedding_field: str, + model_deployment_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EmptyModelParam(_Model): + + + class azure.ai.projects.models.EntraAuthorizationScheme(AgentEndpointAuthorizationScheme, discriminator='Entra'): + isolation_key_source: Optional[IsolationKeySource] + type: Literal[AgentEndpointAuthorizationSchemeType.ENTRA] + + @overload + def __init__( + self, + *, + isolation_key_source: Optional[IsolationKeySource] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EntraIDCredentials(BaseCredentials, discriminator='AAD'): + type: Literal[CredentialType.ENTRA_ID] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EntraIsolationKeySource(IsolationKeySource, discriminator='Entra'): + kind: Literal[IsolationKeySourceKind.ENTRA] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvalCsvFileIdSource(TypedDict, total=False): + key "id": Required[str] + key "type": Required[Literal["file_id"]] + + + class azure.ai.projects.models.EvalCsvRunDataSource(TypedDict, total=False): + key "source": Required[EvalCsvFileIdSource] + key "type": Required[Literal["csv"]] + + + class azure.ai.projects.models.EvalResult(_Model): + name: str + passed: bool + score: float + type: str + + @overload + def __init__( + self, + *, + name: str, + passed: bool, + score: float, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvalRunResultCompareItem(_Model): + delta_estimate: float + p_value: float + treatment_effect: Union[str, TreatmentEffectType] + treatment_run_id: str + treatment_run_summary: EvalRunResultSummary + + @overload + def __init__( + self, + *, + delta_estimate: float, + p_value: float, + treatment_effect: Union[str, TreatmentEffectType], + treatment_run_id: str, + treatment_run_summary: EvalRunResultSummary + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvalRunResultComparison(_Model): + baseline_run_summary: EvalRunResultSummary + compare_items: list[EvalRunResultCompareItem] + evaluator: str + metric: str + testing_criteria: str + + @overload + def __init__( + self, + *, + baseline_run_summary: EvalRunResultSummary, + compare_items: list[EvalRunResultCompareItem], + evaluator: str, + metric: str, + testing_criteria: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvalRunResultSummary(_Model): + average: float + run_id: str + sample_count: int + standard_deviation: float + + @overload + def __init__( + self, + *, + average: float, + run_id: str, + sample_count: int, + standard_deviation: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationComparisonInsightRequest(InsightRequest, discriminator='EvaluationComparison'): + baseline_run_id: str + eval_id: str + treatment_run_ids: list[str] + type: Literal[InsightType.EVALUATION_COMPARISON] + + @overload + def __init__( + self, + *, + baseline_run_id: str, + eval_id: str, + treatment_run_ids: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationComparisonInsightResult(InsightResult, discriminator='EvaluationComparison'): + comparisons: list[EvalRunResultComparison] + method: str + type: Literal[InsightType.EVALUATION_COMPARISON] + + @overload + def __init__( + self, + *, + comparisons: list[EvalRunResultComparison], + method: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION = "conversation" + TURN = "turn" + + + class azure.ai.projects.models.EvaluationResultSample(InsightSample, discriminator='EvaluationResultSample'): + correlation_info: dict[str, any] + evaluation_result: EvalResult + features: dict[str, any] + id: str + type: Literal[SampleType.EVALUATION_RESULT_SAMPLE] + + @overload + def __init__( + self, + *, + correlation_info: dict[str, Any], + evaluation_result: EvalResult, + features: dict[str, Any], + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationRule(_Model): + action: EvaluationRuleAction + description: Optional[str] + display_name: Optional[str] + enabled: bool + event_type: Union[str, EvaluationRuleEventType] + filter: Optional[EvaluationRuleFilter] + id: str + system_data: dict[str, str] + + @overload + def __init__( + self, + *, + action: EvaluationRuleAction, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + enabled: bool, + event_type: Union[str, EvaluationRuleEventType], + filter: Optional[EvaluationRuleFilter] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationRuleAction(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTINUOUS_EVALUATION = "continuousEvaluation" + HUMAN_EVALUATION_PREVIEW = "humanEvaluationPreview" + + + class azure.ai.projects.models.EvaluationRuleEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANUAL = "manual" + RESPONSE_COMPLETED = "responseCompleted" + + + class azure.ai.projects.models.EvaluationRuleFilter(_Model): + agent_name: str + + @overload + def __init__( + self, + *, + agent_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationRunClusterInsightRequest(InsightRequest, discriminator='EvaluationRunClusterInsight'): + eval_id: str + model_configuration: Optional[InsightModelConfiguration] + run_ids: list[str] + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + + @overload + def __init__( + self, + *, + eval_id: str, + model_configuration: Optional[InsightModelConfiguration] = ..., + run_ids: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationRunClusterInsightResult(InsightResult, discriminator='EvaluationRunClusterInsight'): + cluster_insight: ClusterInsightResult + type: Literal[InsightType.EVALUATION_RUN_CLUSTER_INSIGHT] + + @overload + def __init__( + self, + *, + cluster_insight: ClusterInsightResult + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationScheduleTask(ScheduleTask, discriminator='Evaluation'): + configuration: dict[str, str] + eval_id: str + eval_run: dict[str, Any] + type: Literal[ScheduleTaskType.EVALUATION] + + @overload + def __init__( + self, + *, + configuration: Optional[dict[str, str]] = ..., + eval_id: str, + eval_run: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationTarget(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationTaxonomy(_Model): + description: Optional[str] + id: Optional[str] + name: str + properties: Optional[dict[str, str]] + tags: Optional[dict[str, str]] + taxonomy_categories: Optional[list[TaxonomyCategory]] + taxonomy_input: EvaluationTaxonomyInput + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + taxonomy_categories: Optional[list[TaxonomyCategory]] = ..., + taxonomy_input: EvaluationTaxonomyInput + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationTaxonomyInput(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + POLICY = "policy" + + + class azure.ai.projects.models.EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENTS = "agents" + QUALITY = "quality" + SAFETY = "safety" + + + class azure.ai.projects.models.EvaluatorCredentialRequest(_Model): + blob_uri: str + + @overload + def __init__( + self, + *, + blob_uri: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorDefinition(_Model): + data_schema: Optional[dict[str, Any]] + init_parameters: Optional[dict[str, Any]] + metrics: Optional[dict[str, EvaluatorMetric]] + type: str + + @overload + def __init__( + self, + *, + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE = "code" + OPENAI_GRADERS = "openai_graders" + PROMPT = "prompt" + PROMPT_AND_CODE = "prompt_and_code" + RUBRIC = "rubric" + SERVICE = "service" + + + class azure.ai.projects.models.EvaluatorGenerationArtifacts(_Model): + dataset: DatasetReference + kinds: list[str] + + @overload + def __init__( + self, + *, + dataset: DatasetReference, + kinds: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorGenerationInputs(_Model): + evaluator_description: Optional[str] + evaluator_display_name: Optional[str] + evaluator_name: str + model: str + sources: list[EvaluatorGenerationJobSource] + + @overload + def __init__( + self, + *, + evaluator_description: Optional[str] = ..., + evaluator_display_name: Optional[str] = ..., + evaluator_name: str, + model: str, + sources: list[EvaluatorGenerationJobSource] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorGenerationJob(_Model): + created_at: datetime + error: Optional[ApiError] + finished_at: Optional[datetime] + id: str + inputs: Optional[EvaluatorGenerationInputs] + result: Optional[EvaluatorVersion] + status: Union[str, JobStatus] + usage: Optional[EvaluatorGenerationTokenUsage] + + @overload + def __init__( + self, + *, + inputs: Optional[EvaluatorGenerationInputs] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorGenerationJobSource(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorGenerationJobSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT = "agent" + DATASET = "dataset" + PROMPT = "prompt" + TRACES = "traces" + + + class azure.ai.projects.models.EvaluatorGenerationTokenUsage(_Model): + input_tokens: int + output_tokens: int + total_tokens: int + + @overload + def __init__( + self, + *, + input_tokens: int, + output_tokens: int, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorMetric(_Model): + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] + is_primary: Optional[bool] + max_value: Optional[float] + min_value: Optional[float] + threshold: Optional[float] + type: Optional[Union[str, EvaluatorMetricType]] + + @overload + def __init__( + self, + *, + desirable_direction: Optional[Union[str, EvaluatorMetricDirection]] = ..., + is_primary: Optional[bool] = ..., + max_value: Optional[float] = ..., + min_value: Optional[float] = ..., + threshold: Optional[float] = ..., + type: Optional[Union[str, EvaluatorMetricType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DECREASE = "decrease" + INCREASE = "increase" + NEUTRAL = "neutral" + + + class azure.ai.projects.models.EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOOLEAN = "boolean" + CONTINUOUS = "continuous" + ORDINAL = "ordinal" + + + class azure.ai.projects.models.EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUILT_IN = "builtin" + CUSTOM = "custom" + + + class azure.ai.projects.models.EvaluatorVersion(_Model): + categories: list[Union[str, EvaluatorCategory]] + created_at: datetime + created_by: str + definition: EvaluatorDefinition + description: Optional[str] + display_name: Optional[str] + evaluator_type: Union[str, EvaluatorType] + generation_artifacts: Optional[EvaluatorGenerationArtifacts] + id: Optional[str] + metadata: Optional[dict[str, str]] + modified_at: datetime + name: str + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] + tags: Optional[dict[str, str]] + version: str + + @overload + def __init__( + self, + *, + categories: list[Union[str, EvaluatorCategory]], + definition: EvaluatorDefinition, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + evaluator_type: Union[str, EvaluatorType], + metadata: Optional[dict[str, str]] = ..., + supported_evaluation_levels: Optional[list[Union[str, EvaluationLevel]]] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ExternalAgentDefinition(AgentDefinition, discriminator='external'): + kind: Literal[AgentKind.EXTERNAL] + otel_agent_id: Optional[str] + rai_config: RaiConfig + + @overload + def __init__( + self, + *, + otel_agent_id: Optional[str] = ..., + rai_config: Optional[RaiConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FabricDataAgentToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] + + @overload + def __init__( + self, + *, + project_connections: Optional[list[ToolProjectConnection]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FabricIQPreviewTool(Tool, discriminator='fabric_iq_preview'): + description: Optional[str] + name: Optional[str] + project_connection_id: str + require_approval: Optional[Union[MCPToolRequireApproval, str]] + server_label: Optional[str] + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.FABRIC_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + require_approval: Optional[Union[MCPToolRequireApproval, str]] = ..., + server_label: Optional[str] = ..., + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FieldMapping(_Model): + content_fields: list[str] + filepath_field: Optional[str] + metadata_fields: Optional[list[str]] + title_field: Optional[str] + url_field: Optional[str] + vector_fields: Optional[list[str]] + + @overload + def __init__( + self, + *, + content_fields: list[str], + filepath_field: Optional[str] = ..., + metadata_fields: Optional[list[str]] = ..., + title_field: Optional[str] = ..., + url_field: Optional[str] = ..., + vector_fields: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FileDataGenerationJobOutput(DataGenerationJobOutput, discriminator='file'): + filename: str + id: str + type: Literal[DataGenerationJobOutputType.FILE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FileDataGenerationJobSource(DataGenerationJobSource, discriminator='file'): + description: str + id: str + type: Literal[DataGenerationJobSourceType.FILE] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FileDatasetVersion(DatasetVersion, discriminator='uri_file'): + connection_name: str + data_uri: str + description: str + id: str + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FILE] + version: str + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FileSearchTool(Tool, discriminator='file_search'): + description: Optional[str] + filters: Optional[Filters] + max_num_results: Optional[int] + name: Optional[str] + ranking_options: Optional[RankingOptions] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.FILE_SEARCH] + vector_store_ids: list[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + filters: Optional[Filters] = ..., + max_num_results: Optional[int] = ..., + name: Optional[str] = ..., + ranking_options: Optional[RankingOptions] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + vector_store_ids: list[str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FixedRatioVersionSelectionRule(VersionSelectionRule, discriminator='FixedRatio'): + agent_version: str + traffic_percentage: int + type: Literal[VersionSelectorType.FIXED_RATIO] + + @overload + def __init__( + self, + *, + agent_version: str, + traffic_percentage: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FolderDatasetVersion(DatasetVersion, discriminator='uri_folder'): + connection_name: str + data_uri: str + description: str + id: str + is_reference: bool + name: str + tags: dict[str, str] + type: Literal[DatasetType.URI_FOLDER] + version: str + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + data_uri: str, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FoundryModelArtifactProfileCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_ONLY = "DataOnly" + RUNTIME_DEPENDENT = "RuntimeDependent" + UNKNOWN = "Unknown" + + + class azure.ai.projects.models.FoundryModelArtifactProfileSignal(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM_PYTHON_CODE = "CustomPythonCode" + DYNAMIC_OPS = "DynamicOps" + NATIVE_BINARY = "NativeBinary" + PICKLE_DESERIALIZATION = "PickleDeserialization" + UNKNOWN_FORMAT = "UnknownFormat" + + + class azure.ai.projects.models.FoundryModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOCAL_UPLOAD = "LocalUpload" + TRAINING_JOB = "TrainingJob" + + + class azure.ai.projects.models.FoundryModelWarning(_Model): + code: Optional[Union[str, FoundryModelWarningCode]] + message: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[Union[str, FoundryModelWarningCode]] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FoundryModelWarningCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RUNTIME_DEPENDENT_ARTIFACT = "RuntimeDependentArtifact" + UNCLASSIFIED_ARTIFACT = "UnclassifiedArtifact" + + + class azure.ai.projects.models.FoundryModelWeightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAFT_MODEL = "DraftModel" + FULL_WEIGHT = "FullWeight" + LO_RA = "LoRA" + + + class azure.ai.projects.models.FunctionShellToolParam(Tool, discriminator='shell'): + description: Optional[str] + environment: Optional[FunctionShellToolParamEnvironment] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.SHELL] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + environment: Optional[FunctionShellToolParamEnvironment] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FunctionShellToolParamEnvironment(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FunctionShellToolParamEnvironmentContainerReferenceParam(FunctionShellToolParamEnvironment, discriminator='container_reference'): + container_id: str + type: Literal[FunctionShellToolParamEnvironmentType.CONTAINER_REFERENCE] + + @overload + def __init__( + self, + *, + container_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FunctionShellToolParamEnvironmentLocalEnvironmentParam(FunctionShellToolParamEnvironment, discriminator='local'): + skills: Optional[list[LocalSkillParam]] + type: Literal[FunctionShellToolParamEnvironmentType.LOCAL] + + @overload + def __init__( + self, + *, + skills: Optional[list[LocalSkillParam]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FunctionShellToolParamEnvironmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_AUTO = "container_auto" + CONTAINER_REFERENCE = "container_reference" + LOCAL = "local" + + + class azure.ai.projects.models.FunctionTool(Tool, discriminator='function'): + defer_loading: Optional[bool] + description: Optional[str] + name: str + parameters: dict[str, Any] + strict: bool + type: Literal[ToolType.FUNCTION] + + @overload + def __init__( + self, + *, + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any], + strict: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.FunctionToolParam(_Model): + defer_loading: Optional[bool] + description: Optional[str] + name: str + parameters: Optional[EmptyModelParam] + strict: Optional[bool] + type: Literal["function"] + + @overload + def __init__( + self, + *, + defer_loading: Optional[bool] = ..., + description: Optional[str] = ..., + name: str, + parameters: Optional[EmptyModelParam] = ..., + strict: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.GitHubIssueEvent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLOSED = "closed" + OPENED = "opened" + + + class azure.ai.projects.models.GitHubIssueRoutineTrigger(RoutineTrigger, discriminator='github_issue'): + connection_id: str + issue_event: Union[str, GitHubIssueEvent] + owner: str + repository: str + type: Literal[RoutineTriggerType.GITHUB_ISSUE] + + @overload + def __init__( + self, + *, + connection_id: str, + issue_event: Union[str, GitHubIssueEvent], + owner: str, + repository: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LARK = "lark" + REGEX = "regex" + + + class azure.ai.projects.models.HeaderIsolationKeySource(IsolationKeySource, discriminator='Header'): + kind: Literal[IsolationKeySourceKind.HEADER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HeaderTelemetryEndpointAuth(TelemetryEndpointAuth, discriminator='header'): + header_name: str + secret_id: str + secret_key: str + type: Literal[TelemetryEndpointAuthType.HEADER] + + @overload + def __init__( + self, + *, + header_name: str, + secret_id: str, + secret_key: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HostedAgentDefinition(AgentDefinition, discriminator='hosted'): + code_configuration: Optional[CodeConfiguration] + container_configuration: Optional[ContainerConfiguration] + cpu: str + environment_variables: Optional[dict[str, str]] + kind: Literal[AgentKind.HOSTED] + memory: str + protocol_versions: Optional[list[ProtocolVersionRecord]] + rai_config: RaiConfig + telemetry_config: Optional[TelemetryConfig] + tools: Optional[list[Tool]] + + @overload + def __init__( + self, + *, + code_configuration: Optional[CodeConfiguration] = ..., + container_configuration: Optional[ContainerConfiguration] = ..., + cpu: str, + environment_variables: Optional[dict[str, str]] = ..., + memory: str, + protocol_versions: Optional[list[ProtocolVersionRecord]] = ..., + rai_config: Optional[RaiConfig] = ..., + telemetry_config: Optional[TelemetryConfig] = ..., + tools: Optional[list[Tool]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Hourly'): + type: Literal[RecurrenceType.HOURLY] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HumanEvaluationPreviewRuleAction(EvaluationRuleAction, discriminator='humanEvaluationPreview'): + template_id: str + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION_PREVIEW] + + @overload + def __init__( + self, + *, + template_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.HybridSearchOptions(_Model): + embedding_weight: float + text_weight: float + + @overload + def __init__( + self, + *, + embedding_weight: float, + text_weight: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ImageGenAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + EDIT = "edit" + GENERATE = "generate" + + + class azure.ai.projects.models.ImageGenTool(Tool, discriminator='image_generation'): + action: Optional[Union[str, ImageGenAction]] + background: Optional[Literal["transparent", "opaque", "auto"]] + description: Optional[str] + input_fidelity: Optional[Union[str, InputFidelity]] + input_image_mask: Optional[ImageGenToolInputImageMask] + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], Literal["gpt-image-5"], str]] + moderation: Optional[Literal["auto", "low"]] + name: Optional[str] + output_compression: Optional[int] + output_format: Optional[Literal["png", "webp", "jpeg"]] + partial_images: Optional[int] + quality: Optional[Literal["low", "medium", "high", "auto"]] + size: Optional[Union[Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"], str]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.IMAGE_GENERATION] + + @overload + def __init__( + self, + *, + action: Optional[Union[str, ImageGenAction]] = ..., + background: Optional[Literal[transparent, opaque, auto]] = ..., + description: Optional[str] = ..., + input_fidelity: Optional[Union[str, InputFidelity]] = ..., + input_image_mask: Optional[ImageGenToolInputImageMask] = ..., + model: Optional[Union[Literal[gpt-image-1], Literal[gpt-image-1-mini], Literal[gpt-image-5], str]] = ..., + moderation: Optional[Literal[auto, low]] = ..., + name: Optional[str] = ..., + output_compression: Optional[int] = ..., + output_format: Optional[Literal[png, webp, jpeg]] = ..., + partial_images: Optional[int] = ..., + quality: Optional[Literal[low, medium, high, auto]] = ..., + size: Optional[Union[Literal[1024x1024], Literal[1024x1536], Literal[1536x1024], Literal[auto], str]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ImageGenToolInputImageMask(_Model): + file_id: Optional[str] + image_url: Optional[str] + + @overload + def __init__( + self, + *, + file_id: Optional[str] = ..., + image_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Index(_Model): + description: Optional[str] + id: Optional[str] + name: str + tags: Optional[dict[str, str]] + type: str + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEARCH = "AzureSearch" + COSMOS_DB = "CosmosDBNoSqlVectorStore" + MANAGED_AZURE_SEARCH = "ManagedAzureSearch" + + + class azure.ai.projects.models.InlineSkillParam(ContainerSkill, discriminator='inline'): + description: str + name: str + source: InlineSkillSourceParam + type: Literal[ContainerSkillType.INLINE] + + @overload + def __init__( + self, + *, + description: str, + name: str, + source: InlineSkillSourceParam + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InlineSkillSourceParam(_Model): + data: str + media_type: Literal["application/zip"] + type: Literal["base64"] + + @overload + def __init__( + self, + *, + data: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + + + class azure.ai.projects.models.Insight(_Model): + display_name: str + insight_id: str + metadata: InsightsMetadata + request: InsightRequest + result: Optional[InsightResult] + state: Union[str, OperationState] + + @overload + def __init__( + self, + *, + display_name: str, + request: InsightRequest + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightCluster(_Model): + description: str + id: str + label: str + samples: Optional[list[InsightSample]] + sub_clusters: Optional[list[InsightCluster]] + suggestion: str + suggestion_title: str + weight: int + + @overload + def __init__( + self, + *, + description: str, + id: str, + label: str, + samples: Optional[list[InsightSample]] = ..., + sub_clusters: Optional[list[InsightCluster]] = ..., + suggestion: str, + suggestion_title: str, + weight: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightModelConfiguration(_Model): + model_deployment_name: str + + @overload + def __init__( + self, + *, + model_deployment_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightRequest(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightResult(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightSample(_Model): + correlation_info: dict[str, Any] + features: dict[str, Any] + id: str + type: str + + @overload + def __init__( + self, + *, + correlation_info: dict[str, Any], + features: dict[str, Any], + id: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightScheduleTask(ScheduleTask, discriminator='Insight'): + configuration: dict[str, str] + insight: Insight + type: Literal[ScheduleTaskType.INSIGHT] + + @overload + def __init__( + self, + *, + configuration: Optional[dict[str, str]] = ..., + insight: Insight + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightSummary(_Model): + method: str + sample_count: int + unique_cluster_count: int + unique_subcluster_count: int + usage: ClusterTokenUsage + + @overload + def __init__( + self, + *, + method: str, + sample_count: int, + unique_cluster_count: int, + unique_subcluster_count: int, + usage: ClusterTokenUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_CLUSTER_INSIGHT = "AgentClusterInsight" + EVALUATION_COMPARISON = "EvaluationComparison" + EVALUATION_RUN_CLUSTER_INSIGHT = "EvaluationRunClusterInsight" + + + class azure.ai.projects.models.InsightsMetadata(_Model): + completed_at: Optional[datetime] + created_at: datetime + + @overload + def __init__( + self, + *, + completed_at: Optional[datetime] = ..., + created_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_invocations_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API] + + @overload + def __init__( + self, + *, + input: Any + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction(RoutineAction, discriminator='invoke_agent_invocations_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + input: Optional[Any] + session_id: Optional[str] + type: Literal[RoutineActionType.INVOKE_AGENT_INVOCATIONS_API] + + @overload + def __init__( + self, + *, + agent_endpoint_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + input: Optional[Any] = ..., + session_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload(RoutineDispatchPayload, discriminator='invoke_agent_responses_api'): + input: Any + type: Literal[RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API] + + @overload + def __init__( + self, + *, + input: Any + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction(RoutineAction, discriminator='invoke_agent_responses_api'): + agent_endpoint_id: Optional[str] + agent_name: Optional[str] + conversation: Optional[str] + input: Optional[Any] + type: Literal[RoutineActionType.INVOKE_AGENT_RESPONSES_API] + + @overload + def __init__( + self, + *, + agent_endpoint_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + conversation: Optional[str] = ..., + input: Optional[Any] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.IsolationKeySource(_Model): + kind: str + + @overload + def __init__( + self, + *, + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.IsolationKeySourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ENTRA = "Entra" + HEADER = "Header" + + + class azure.ai.projects.models.JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUCCEEDED = "succeeded" + + + class azure.ai.projects.models.LocalShellToolParam(Tool, discriminator='local_shell'): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.LOCAL_SHELL] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LocalSkillParam(_Model): + description: str + name: str + path: str + + @overload + def __init__( + self, + *, + description: str, + name: str, + path: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.LoraConfig(_Model): + alpha: Optional[int] + dropout: Optional[float] + rank: Optional[int] + target_modules: Optional[list[str]] + + @overload + def __init__( + self, + *, + alpha: Optional[int] = ..., + dropout: Optional[float] = ..., + rank: Optional[int] = ..., + target_modules: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MCPTool(Tool, discriminator='mcp'): + allowed_tools: Optional[Union[list[str], MCPToolFilter]] + authorization: Optional[str] + connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint"]] + defer_loading: Optional[bool] + headers: Optional[dict[str, str]] + project_connection_id: Optional[str] + require_approval: Optional[Union[MCPToolRequireApproval, Literal["always"], Literal["never"]]] + server_description: Optional[str] + server_label: str + server_url: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.MCP] + + @overload + def __init__( + self, + *, + allowed_tools: Optional[Union[list[str], MCPToolFilter]] = ..., + authorization: Optional[str] = ..., + connector_id: Optional[Literal[connector_dropbox, connector_gmail, connector_googlecalendar, connector_googledrive, connector_microsoftteams, connector_outlookcalendar, connector_outlookemail, connector_sharepoint]] = ..., + defer_loading: Optional[bool] = ..., + headers: Optional[dict[str, str]] = ..., + project_connection_id: Optional[str] = ..., + require_approval: Optional[Union[MCPToolRequireApproval, Literal[always], Literal[never]]] = ..., + server_description: Optional[str] = ..., + server_label: str, + server_url: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MCPToolFilter(_Model): + read_only: Optional[bool] + tool_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + read_only: Optional[bool] = ..., + tool_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MCPToolRequireApproval(_Model): + always: Optional[MCPToolFilter] + never: Optional[MCPToolFilter] + + @overload + def __init__( + self, + *, + always: Optional[MCPToolFilter] = ..., + never: Optional[MCPToolFilter] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ManagedAgentIdentityBlueprintReference(AgentBlueprintReference, discriminator='ManagedAgentIdentityBlueprint'): + blueprint_id: str + type: Literal[AgentBlueprintReferenceType.MANAGED_AGENT_IDENTITY_BLUEPRINT] + + @overload + def __init__( + self, + *, + blueprint_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ManagedAzureAISearchIndex(Index, discriminator='ManagedAzureSearch'): + description: str + id: str + name: str + tags: dict[str, str] + type: Literal[IndexType.MANAGED_AZURE_SEARCH] + vector_store_id: str + version: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ..., + vector_store_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryItem(_Model): + content: str + kind: str + memory_id: str + scope: str + updated_at: datetime + + @overload + def __init__( + self, + *, + content: str, + kind: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHAT_SUMMARY = "chat_summary" + PROCEDURAL = "procedural" + USER_PROFILE = "user_profile" + + + class azure.ai.projects.models.MemoryOperation(_Model): + kind: Union[str, MemoryOperationKind] + memory_item: MemoryItem + + @overload + def __init__( + self, + *, + kind: Union[str, MemoryOperationKind], + memory_item: MemoryItem + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryOperationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "create" + DELETE = "delete" + UPDATE = "update" + + + class azure.ai.projects.models.MemorySearchItem(_Model): + memory_item: MemoryItem + + @overload + def __init__( + self, + *, + memory_item: MemoryItem + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemorySearchOptions(_Model): + max_memories: Optional[int] + + @overload + def __init__( + self, + *, + max_memories: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemorySearchPreviewTool(Tool, discriminator='memory_search_preview'): + description: Optional[str] + memory_store_name: str + name: Optional[str] + scope: str + search_options: Optional[MemorySearchOptions] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.MEMORY_SEARCH_PREVIEW] + update_delay: Optional[int] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + memory_store_name: str, + name: Optional[str] = ..., + scope: str, + search_options: Optional[MemorySearchOptions] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + update_delay: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator='default'): + chat_model: str + embedding_model: str + kind: Literal[MemoryStoreKind.DEFAULT] + options: Optional[MemoryStoreDefaultOptions] + + @overload + def __init__( + self, + *, + chat_model: str, + embedding_model: str, + options: Optional[MemoryStoreDefaultOptions] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreDefaultOptions(_Model): + chat_summary_enabled: bool + default_ttl_seconds: Optional[int] + procedural_memory_enabled: Optional[bool] + user_profile_details: Optional[str] + user_profile_enabled: bool + + @overload + def __init__( + self, + *, + chat_summary_enabled: bool, + default_ttl_seconds: Optional[int] = ..., + procedural_memory_enabled: Optional[bool] = ..., + user_profile_details: Optional[str] = ..., + user_profile_enabled: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreDefinition(_Model): + kind: str + + @overload + def __init__( + self, + *, + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreDeleteScopeResult(_Model): + deleted: bool + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED] + scope: str + + @overload + def __init__( + self, + *, + deleted: bool, + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE_SCOPE_DELETED], + scope: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreDetails(_Model): + created_at: datetime + definition: MemoryStoreDefinition + description: Optional[str] + id: str + metadata: Optional[dict[str, str]] + name: str + object: Literal[MemoryStoreObjectType.MEMORY_STORE] + updated_at: datetime + + @overload + def __init__( + self, + *, + created_at: datetime, + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + id: str, + metadata: Optional[dict[str, str]] = ..., + name: str, + object: Literal[MemoryStoreObjectType.MEMORY_STORE], + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + + + class azure.ai.projects.models.MemoryStoreObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MEMORY_DELETED = "memory_store.item.deleted" + MEMORY_STORE = "memory_store" + MEMORY_STORE_DELETED = "memory_store.deleted" + MEMORY_STORE_SCOPE_DELETED = "memory_store.scope.deleted" + + + class azure.ai.projects.models.MemoryStoreOperationUsage(_Model): + embedding_tokens: int + input_tokens: int + input_tokens_details: ResponseUsageInputTokensDetails + output_tokens: int + output_tokens_details: ResponseUsageOutputTokensDetails + total_tokens: int + + @overload + def __init__( + self, + *, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: ResponseUsageInputTokensDetails, + output_tokens: int, + output_tokens_details: ResponseUsageOutputTokensDetails, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreSearchResult(_Model): + memories: list[MemorySearchItem] + search_id: str + usage: MemoryStoreOperationUsage + + @overload + def __init__( + self, + *, + memories: list[MemorySearchItem], + search_id: str, + usage: MemoryStoreOperationUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreUpdateCompletedResult(_Model): + memory_operations: list[MemoryOperation] + usage: MemoryStoreOperationUsage + + @overload + def __init__( + self, + *, + memory_operations: list[MemoryOperation], + usage: MemoryStoreOperationUsage + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreUpdateResult(_Model): + error: Optional[ApiError] + result: Optional[MemoryStoreUpdateCompletedResult] + status: Union[str, MemoryStoreUpdateStatus] + superseded_by: Optional[str] + update_id: str + + @overload + def __init__( + self, + *, + error: Optional[ApiError] = ..., + result: Optional[MemoryStoreUpdateCompletedResult] = ..., + status: Union[str, MemoryStoreUpdateStatus], + superseded_by: Optional[str] = ..., + update_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + FAILED = "failed" + IN_PROGRESS = "in_progress" + QUEUED = "queued" + SUPERSEDED = "superseded" + + + class azure.ai.projects.models.MicrosoftFabricPreviewTool(Tool, discriminator='fabric_dataagent_preview'): + description: Optional[str] + fabric_dataagent_preview: FabricDataAgentToolParameters + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.FABRIC_DATAAGENT_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + fabric_dataagent_preview: FabricDataAgentToolParameters, + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelCredentialRequest(_Model): + blob_uri: str + + @overload + def __init__( + self, + *, + blob_uri: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelDeployment(Deployment, discriminator='ModelDeployment'): + capabilities: dict[str, str] + connection_name: Optional[str] + model_name: str + model_publisher: str + model_version: str + name: str + sku: ModelDeploymentSku + type: Literal[DeploymentType.MODEL_DEPLOYMENT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelDeploymentSku(_Model): + capacity: int + family: str + name: str + size: str + tier: str + + @overload + def __init__( + self, + *, + capacity: int, + family: str, + name: str, + size: str, + tier: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelPendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelPendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.TEMPORARY_BLOB_REFERENCE], + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelSamplingConfigParam(TypedDict, total=False): + key "max_completion_tokens": int + key "seed": int + key "temperature": float + key "top_p": float + + + class azure.ai.projects.models.ModelSamplingParams(_Model): + max_completion_tokens: Optional[int] + seed: Optional[int] + temperature: Optional[float] + top_p: Optional[float] + + @overload + def __init__( + self, + *, + max_completion_tokens: Optional[int] = ..., + seed: Optional[int] = ..., + temperature: Optional[float] = ..., + top_p: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelSourceData(_Model): + job_id: Optional[str] + source_type: Optional[Union[str, FoundryModelSourceType]] + + @overload + def __init__( + self, + *, + job_id: Optional[str] = ..., + source_type: Optional[Union[str, FoundryModelSourceType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ModelVersion(_Model): + artifact_profile: Optional[ArtifactProfile] + base_model: Optional[str] + blob_uri: str + description: Optional[str] + id: Optional[str] + lora_config: Optional[LoraConfig] + name: str + source: Optional[ModelSourceData] + system_data: Optional[SystemDataV3] + tags: Optional[dict[str, str]] + version: str + warnings: Optional[list[FoundryModelWarning]] + weight_type: Optional[Union[str, FoundryModelWeightType]] + + @overload + def __init__( + self, + *, + base_model: Optional[str] = ..., + blob_uri: str, + description: Optional[str] = ..., + lora_config: Optional[LoraConfig] = ..., + source: Optional[ModelSourceData] = ..., + tags: Optional[dict[str, str]] = ..., + weight_type: Optional[Union[str, FoundryModelWeightType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator='Monthly'): + days_of_month: list[int] + type: Literal[RecurrenceType.MONTHLY] + + @overload + def __init__( + self, + *, + days_of_month: list[int] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.NamespaceToolParam(Tool, discriminator='namespace'): + description: str + name: str + tools: list[Union[FunctionToolParam, CustomToolParam]] + type: Literal[ToolType.NAMESPACE] + + @overload + def __init__( + self, + *, + description: str, + name: str, + tools: list[Union[FunctionToolParam, CustomToolParam]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.NoAuthenticationCredentials(BaseCredentials, discriminator='None'): + type: Literal[CredentialType.NONE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OneTimeTrigger(Trigger, discriminator='OneTime'): + time_zone: Optional[str] + trigger_at: datetime + type: Literal[TriggerType.ONE_TIME] + + @overload + def __init__( + self, + *, + time_zone: Optional[str] = ..., + trigger_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator='anonymous'): + type: Literal[OpenApiAuthType.ANONYMOUS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiAuthDetails(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "anonymous" + MANAGED_IDENTITY = "managed_identity" + PROJECT_CONNECTION = "project_connection" + + + class azure.ai.projects.models.OpenApiFunctionDefinition(_Model): + auth: OpenApiAuthDetails + default_params: Optional[list[str]] + description: Optional[str] + functions: Optional[list[OpenApiFunctionDefinitionFunction]] + name: str + spec: dict[str, Any] + + @overload + def __init__( + self, + *, + auth: OpenApiAuthDetails, + default_params: Optional[list[str]] = ..., + description: Optional[str] = ..., + name: str, + spec: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiFunctionDefinitionFunction(_Model): + description: Optional[str] + name: str + parameters: dict[str, Any] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: dict[str, Any] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator='managed_identity'): + security_scheme: OpenApiManagedSecurityScheme + type: Literal[OpenApiAuthType.MANAGED_IDENTITY] + + @overload + def __init__( + self, + *, + security_scheme: OpenApiManagedSecurityScheme + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiManagedSecurityScheme(_Model): + audience: str + + @overload + def __init__( + self, + *, + audience: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator='project_connection'): + security_scheme: OpenApiProjectConnectionSecurityScheme + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] + + @overload + def __init__( + self, + *, + security_scheme: OpenApiProjectConnectionSecurityScheme + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme(_Model): + project_connection_id: str + + @overload + def __init__( + self, + *, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OpenApiTool(Tool, discriminator='openapi'): + openapi: OpenApiFunctionDefinition + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.OPENAPI] + + @overload + def __init__( + self, + *, + openapi: OpenApiFunctionDefinition, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + NOT_STARTED = "NotStarted" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + + + class azure.ai.projects.models.OptimizationAgentIdentifier(_Model): + agent_name: str + agent_version: Optional[str] + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationCandidate(_Model): + avg_score: float + avg_tokens: float + candidate_id: Optional[str] + eval_id: Optional[str] + eval_run_id: Optional[str] + mutations: Optional[dict[str, Any]] + name: str + promotion: Optional[PromotionInfo] + + @overload + def __init__( + self, + *, + avg_score: float, + avg_tokens: float, + candidate_id: Optional[str] = ..., + eval_id: Optional[str] = ..., + eval_run_id: Optional[str] = ..., + mutations: Optional[dict[str, Any]] = ..., + name: str, + promotion: Optional[PromotionInfo] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationDatasetCriterion(_Model): + instruction: str + name: str + + @overload + def __init__( + self, + *, + instruction: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationDatasetInput(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationDatasetInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INLINE = "inline" + REFERENCE = "reference" + + + class azure.ai.projects.models.OptimizationDatasetItem(_Model): + criteria: Optional[list[OptimizationDatasetCriterion]] + desired_num_turns: Optional[int] + ground_truth: Optional[str] + query: Optional[str] + + @overload + def __init__( + self, + *, + criteria: Optional[list[OptimizationDatasetCriterion]] = ..., + desired_num_turns: Optional[int] = ..., + ground_truth: Optional[str] = ..., + query: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationEvaluatorRef(_Model): + name: str + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationInlineDatasetInput(OptimizationDatasetInput, discriminator='inline'): + items_property: list[OptimizationDatasetItem] + type: Literal[OptimizationDatasetInputType.INLINE] + + @overload + def __init__( + self, + *, + items_property: list[OptimizationDatasetItem] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationJob(_Model): + created_at: datetime + error: Optional[ApiError] + id: str + inputs: Optional[OptimizationJobInputs] + progress: Optional[OptimizationJobProgress] + result: Optional[OptimizationJobResult] + status: Union[str, JobStatus] + updated_at: datetime + warnings: Optional[list[str]] + + @overload + def __init__( + self, + *, + inputs: Optional[OptimizationJobInputs] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationJobInputs(_Model): + agent: OptimizationAgentIdentifier + evaluators: list[OptimizationEvaluatorRef] + options: Optional[OptimizationOptions] + train_dataset: OptimizationDatasetInput + validation_dataset: Optional[OptimizationDatasetInput] + + @overload + def __init__( + self, + *, + agent: OptimizationAgentIdentifier, + evaluators: list[OptimizationEvaluatorRef], + options: Optional[OptimizationOptions] = ..., + train_dataset: OptimizationDatasetInput, + validation_dataset: Optional[OptimizationDatasetInput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationJobListItem(_Model): + agent: Optional[OptimizationAgentIdentifier] + created_at: datetime + error: Optional[ApiError] + id: str + progress: Optional[OptimizationJobProgress] + status: Union[str, JobStatus] + updated_at: datetime + + + class azure.ai.projects.models.OptimizationJobProgress(_Model): + best_score: float + candidates_completed: int + elapsed_seconds: float + + @overload + def __init__( + self, + *, + best_score: float, + candidates_completed: int, + elapsed_seconds: float + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationJobResult(_Model): + baseline: Optional[str] + best: Optional[str] + candidates: Optional[list[OptimizationCandidate]] + + @overload + def __init__( + self, + *, + baseline: Optional[str] = ..., + best: Optional[str] = ..., + candidates: Optional[list[OptimizationCandidate]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationOptions(_Model): + eval_model: Optional[str] + evaluation_level: Optional[Union[str, EvaluationLevel]] + max_candidates: Optional[int] + optimization_config: Optional[dict[str, Any]] + optimization_model: Optional[str] + + @overload + def __init__( + self, + *, + eval_model: Optional[str] = ..., + evaluation_level: Optional[Union[str, EvaluationLevel]] = ..., + max_candidates: Optional[int] = ..., + optimization_config: Optional[dict[str, Any]] = ..., + optimization_model: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OptimizationReferenceDatasetInput(OptimizationDatasetInput, discriminator='reference'): + name: str + type: Literal[OptimizationDatasetInputType.REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.OtlpTelemetryEndpoint(TelemetryEndpoint, discriminator='OTLP'): + auth: TelemetryEndpointAuth + data: Union[list[str, TelemetryDataKind]] + endpoint: str + kind: Literal[TelemetryEndpointKind.OTLP] + protocol: Union[str, TelemetryTransportProtocol] + + @overload + def __init__( + self, + *, + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + endpoint: str, + protocol: Union[str, TelemetryTransportProtocol] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASC = "asc" + DESC = "desc" + + + class azure.ai.projects.models.PendingUploadRequest(_Model): + connection_name: Optional[str] + pending_upload_id: Optional[str] + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + + @overload + def __init__( + self, + *, + connection_name: Optional[str] = ..., + pending_upload_id: Optional[str] = ..., + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PendingUploadResponse(_Model): + blob_reference: BlobReference + pending_upload_id: str + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + blob_reference: BlobReference, + pending_upload_id: str, + pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLOB_REFERENCE = "BlobReference" + NONE = "None" + TEMPORARY_BLOB_REFERENCE = "TemporaryBlobReference" + + + class azure.ai.projects.models.ProceduralMemoryItem(MemoryItem, discriminator='procedural'): + content: str + kind: Literal[MemoryItemKind.PROCEDURAL] + memory_id: str + scope: str + updated_at: datetime + + @overload + def __init__( + self, + *, + content: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromotionInfo(_Model): + agent_name: str + agent_version: str + promoted_at: datetime + + @overload + def __init__( + self, + *, + agent_name: str, + agent_version: str, + promoted_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromptAgentDefinition(AgentDefinition, discriminator='prompt'): + instructions: Optional[str] + kind: Literal[AgentKind.PROMPT] + model: str + rai_config: RaiConfig + reasoning: Optional[Reasoning] + structured_inputs: Optional[dict[str, StructuredInputDefinition]] + temperature: Optional[float] + text: Optional[PromptAgentDefinitionTextOptions] + tool_choice: Optional[Union[str, ToolChoiceParam]] + tools: Optional[list[Tool]] + top_p: Optional[float] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + model: str, + rai_config: Optional[RaiConfig] = ..., + reasoning: Optional[Reasoning] = ..., + structured_inputs: Optional[dict[str, StructuredInputDefinition]] = ..., + temperature: Optional[float] = ..., + text: Optional[PromptAgentDefinitionTextOptions] = ..., + tool_choice: Optional[Union[str, ToolChoiceParam]] = ..., + tools: Optional[list[Tool]] = ..., + top_p: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromptAgentDefinitionTextOptions(_Model): + format: Optional[TextResponseFormat] + + @overload + def __init__( + self, + *, + format: Optional[TextResponseFormat] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='prompt'): + data_schema: dict[str, any] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + prompt_text: str + type: Literal[EvaluatorDefinitionType.PROMPT] + + @overload + def __init__( + self, + *, + data_schema: Optional[dict[str, Any]] = ..., + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + prompt_text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromptDataGenerationJobSource(DataGenerationJobSource, discriminator='prompt'): + description: str + prompt: str + type: Literal[DataGenerationJobSourceType.PROMPT] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + prompt: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.PromptEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='prompt'): + description: Optional[str] + prompt: str + type: Literal[EvaluatorGenerationJobSourceType.PROMPT] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + prompt: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ProtocolVersionRecord(_Model): + protocol: Union[str, AgentProtocol] + version: str + + @overload + def __init__( + self, + *, + protocol: Union[str, AgentProtocol], + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RaiConfig(_Model): + rai_policy_name: str + + @overload + def __init__( + self, + *, + rai_policy_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + DEFAULT_2024_11_15 = "default-2024-11-15" + + + class azure.ai.projects.models.RankingOptions(_Model): + hybrid_search: Optional[HybridSearchOptions] + ranker: Optional[Union[str, RankerVersionType]] + score_threshold: Optional[float] + + @overload + def __init__( + self, + *, + hybrid_search: Optional[HybridSearchOptions] = ..., + ranker: Optional[Union[str, RankerVersionType]] = ..., + score_threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Reasoning(_Model): + effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] + generate_summary: Optional[Literal["auto", "concise", "detailed"]] + summary: Optional[Literal["auto", "concise", "detailed"]] + + @overload + def __init__( + self, + *, + effort: Optional[Literal[none, minimal, low, medium, high, xhigh]] = ..., + generate_summary: Optional[Literal[auto, concise, detailed]] = ..., + summary: Optional[Literal[auto, concise, detailed]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RecurrenceSchedule(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RecurrenceTrigger(Trigger, discriminator='Recurrence'): + end_time: Optional[datetime] + interval: int + schedule: RecurrenceSchedule + start_time: Optional[datetime] + time_zone: Optional[str] + type: Literal[TriggerType.RECURRENCE] + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + interval: int, + schedule: RecurrenceSchedule, + start_time: Optional[datetime] = ..., + time_zone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + WEEKLY = "Weekly" + + + class azure.ai.projects.models.RedTeam(_Model): + application_scenario: Optional[str] + attack_strategies: Optional[list[Union[str, AttackStrategy]]] + display_name: Optional[str] + name: str + num_turns: Optional[int] + properties: Optional[dict[str, str]] + risk_categories: Optional[list[Union[str, RiskCategory]]] + simulation_only: Optional[bool] + status: Optional[str] + tags: Optional[dict[str, str]] + target: RedTeamTargetConfig + + @overload + def __init__( + self, + *, + application_scenario: Optional[str] = ..., + attack_strategies: Optional[list[Union[str, AttackStrategy]]] = ..., + display_name: Optional[str] = ..., + num_turns: Optional[int] = ..., + properties: Optional[dict[str, str]] = ..., + risk_categories: Optional[list[Union[str, RiskCategory]]] = ..., + simulation_only: Optional[bool] = ..., + tags: Optional[dict[str, str]] = ..., + target: RedTeamTargetConfig + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RedTeamEvalRunDataSource(TypedDict, total=False): + key "item_generation_params": Required[Any] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_red_team"]] + + + class azure.ai.projects.models.RedTeamTargetConfig(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponseRetrievalItemGenerationParams(TypedDict, total=False): + key "data_mapping": Required[Dict[str, str]] + key "max_num_turns": int + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "type": Required[Literal["response_retrieval"]] + + + class azure.ai.projects.models.ResponseUsageInputTokensDetails(_Model): + cached_tokens: int + + @overload + def __init__( + self, + *, + cached_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ResponseUsageOutputTokensDetails(_Model): + reasoning_tokens: int + + @overload + def __init__( + self, + *, + reasoning_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CODE_VULNERABILITY = "CodeVulnerability" + HATE_UNFAIRNESS = "HateUnfairness" + PROHIBITED_ACTIONS = "ProhibitedActions" + PROTECTED_MATERIAL = "ProtectedMaterial" + SELF_HARM = "SelfHarm" + SENSITIVE_DATA_LEAKAGE = "SensitiveDataLeakage" + SEXUAL = "Sexual" + TASK_ADHERENCE = "TaskAdherence" + UNGROUNDED_ATTRIBUTES = "UngroundedAttributes" + VIOLENCE = "Violence" + + + class azure.ai.projects.models.Routine(_Model): + action: Optional[RoutineAction] + created_at: Optional[datetime] + description: Optional[str] + enabled: bool + name: Optional[str] + triggers: Optional[dict[str, RoutineTrigger]] + updated_at: Optional[datetime] + + @overload + def __init__( + self, + *, + action: Optional[RoutineAction] = ..., + created_at: Optional[datetime] = ..., + description: Optional[str] = ..., + enabled: bool, + name: Optional[str] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + updated_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineAction(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineAttemptSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVENT_FIRE = "event_fire" + MANUAL_DISPATCH = "manual_dispatch" + QUEUED_DISPATCH = "queued_dispatch" + SCHEDULE_DELIVERY = "schedule_delivery" + TIMER_DELIVERY = "timer_delivery" + + + class azure.ai.projects.models.RoutineDispatchPayload(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineDispatchPayloadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INVOKE_AGENT_INVOCATIONS_API = "invoke_agent_invocations_api" + INVOKE_AGENT_RESPONSES_API = "invoke_agent_responses_api" + + + class azure.ai.projects.models.RoutineRun(_Model): + action_correlation_id: Optional[str] + action_type: Optional[Union[str, RoutineActionType]] + agent_endpoint_id: Optional[str] + agent_id: Optional[str] + attempt_source: Optional[Union[str, RoutineAttemptSource]] + conversation_id: Optional[str] + dispatch_id: Optional[str] + ended_at: Optional[datetime] + error_message: Optional[str] + error_status_code: Optional[int] + error_type: Optional[str] + id: str + phase: Optional[Union[str, RoutineRunPhase]] + response_id: Optional[str] + scheduled_fire_at: Optional[datetime] + session_id: Optional[str] + started_at: Optional[datetime] + status: Optional[RoutineRunStatus] + task_id: Optional[str] + trigger_name: Optional[str] + trigger_type: Optional[Union[str, RoutineTriggerType]] + triggered_at: Optional[datetime] + + @overload + def __init__( + self, + *, + action_correlation_id: Optional[str] = ..., + action_type: Optional[Union[str, RoutineActionType]] = ..., + agent_endpoint_id: Optional[str] = ..., + agent_id: Optional[str] = ..., + attempt_source: Optional[Union[str, RoutineAttemptSource]] = ..., + conversation_id: Optional[str] = ..., + dispatch_id: Optional[str] = ..., + ended_at: Optional[datetime] = ..., + error_message: Optional[str] = ..., + error_status_code: Optional[int] = ..., + error_type: Optional[str] = ..., + phase: Optional[Union[str, RoutineRunPhase]] = ..., + response_id: Optional[str] = ..., + scheduled_fire_at: Optional[datetime] = ..., + session_id: Optional[str] = ..., + started_at: Optional[datetime] = ..., + status: Optional[RoutineRunStatus] = ..., + task_id: Optional[str] = ..., + trigger_name: Optional[str] = ..., + trigger_type: Optional[Union[str, RoutineTriggerType]] = ..., + triggered_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineRunPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + DISPATCHING = "dispatching" + FAILED = "failed" + QUEUED = "queued" + + + class azure.ai.projects.models.RoutineTrigger(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.RoutineTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + GITHUB_ISSUE = "github_issue" + SCHEDULE = "schedule" + TIMER = "timer" + + + class azure.ai.projects.models.RubricBasedEvaluatorDefinition(EvaluatorDefinition, discriminator='rubric'): + data_schema: dict[str, any] + dimensions: list[Dimension] + init_parameters: dict[str, any] + metrics: dict[str, EvaluatorMetric] + pass_threshold: Optional[float] + type: Literal[EvaluatorDefinitionType.RUBRIC] + + @overload + def __init__( + self, + *, + data_schema: Optional[dict[str, Any]] = ..., + dimensions: list[Dimension], + init_parameters: Optional[dict[str, Any]] = ..., + metrics: Optional[dict[str, EvaluatorMetric]] = ..., + pass_threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SASCredentials(BaseCredentials, discriminator='SAS'): + sas_token: Optional[str] + type: Literal[CredentialType.SAS] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SampleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION_RESULT_SAMPLE = "EvaluationResultSample" + + + class azure.ai.projects.models.Schedule(_Model): + description: Optional[str] + display_name: Optional[str] + enabled: bool + properties: Optional[dict[str, str]] + provisioning_status: Optional[Union[str, ScheduleProvisioningStatus]] + schedule_id: str + system_data: dict[str, str] + tags: Optional[dict[str, str]] + task: ScheduleTask + trigger: Trigger + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + enabled: bool, + properties: Optional[dict[str, str]] = ..., + tags: Optional[dict[str, str]] = ..., + task: ScheduleTask, + trigger: Trigger + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleProvisioningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.ai.projects.models.ScheduleRoutineTrigger(RoutineTrigger, discriminator='schedule'): + cron_expression: str + time_zone: str + type: Literal[RoutineTriggerType.SCHEDULE] + + @overload + def __init__( + self, + *, + cron_expression: str, + time_zone: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleRun(_Model): + error: Optional[str] + properties: dict[str, str] + run_id: str + schedule_id: str + success: bool + trigger_time: Optional[datetime] + + @overload + def __init__( + self, + *, + schedule_id: str, + trigger_time: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleTask(_Model): + configuration: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + configuration: Optional[dict[str, str]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EVALUATION = "Evaluation" + INSIGHT = "Insight" + + + class azure.ai.projects.models.SearchContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" + + + class azure.ai.projects.models.SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.projects.models.SessionDirectoryEntry(_Model): + is_directory: bool + modified_time: datetime + name: str + size: int + + @overload + def __init__( + self, + *, + is_directory: bool, + modified_time: datetime, + name: str, + size: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionFileWriteResult(_Model): + bytes_written: int + path: str + + @overload + def __init__( + self, + *, + bytes_written: int, + path: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionLogEvent(_Model): + data: str + event: Union[str, SessionLogEventType] + + @overload + def __init__( + self, + *, + data: str, + event: Union[str, SessionLogEventType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SessionLogEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "log" + + + class azure.ai.projects.models.SharepointGroundingToolParameters(_Model): + project_connections: Optional[list[ToolProjectConnection]] + + @overload + def __init__( + self, + *, + project_connections: Optional[list[ToolProjectConnection]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SharepointPreviewTool(Tool, discriminator='sharepoint_grounding_preview'): + description: Optional[str] + name: Optional[str] + sharepoint_grounding_preview: SharepointGroundingToolParameters + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.SHAREPOINT_GROUNDING_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + sharepoint_grounding_preview: SharepointGroundingToolParameters, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SimpleQnADataGenerationJobOptions(DataGenerationJobOptions, discriminator='simple_qna'): + max_samples: int + model_options: DataGenerationModelOptions + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] + train_split: float + type: Literal[DataGenerationJobType.SIMPLE_QNA] + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + question_types: Optional[list[Union[str, SimpleQnAFineTuningQuestionType]]] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SimpleQnAFineTuningQuestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LONG_ANSWER = "long_answer" + SHORT_ANSWER = "short_answer" + + + class azure.ai.projects.models.SkillDetails(_Model): + created_at: datetime + default_version: str + description: str + id: str + latest_version: str + name: str + + @overload + def __init__( + self, + *, + created_at: datetime, + default_version: str, + description: str, + id: str, + latest_version: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillInlineContent(_Model): + allowed_tools: Optional[list[str]] + compatibility: Optional[str] + description: str + instructions: str + license: Optional[str] + metadata: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + allowed_tools: Optional[list[str]] = ..., + compatibility: Optional[str] = ..., + description: str, + instructions: str, + license: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillReferenceParam(ContainerSkill, discriminator='skill_reference'): + skill_id: str + type: Literal[ContainerSkillType.SKILL_REFERENCE] + version: Optional[str] + + @overload + def __init__( + self, + *, + skill_id: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SkillVersion(_Model): + created_at: datetime + description: str + id: str + name: str + skill_id: str + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + description: str, + id: str, + name: str, + skill_id: str, + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SpecificApplyPatchParam(ToolChoiceParam, discriminator='apply_patch'): + type: Literal[ToolChoiceParamType.APPLY_PATCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SpecificFunctionShellParam(ToolChoiceParam, discriminator='shell'): + type: Literal[ToolChoiceParamType.SHELL] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.StructuredInputDefinition(_Model): + default_value: Optional[Any] + description: Optional[str] + required: Optional[bool] + schema: Optional[dict[str, Any]] + + @overload + def __init__( + self, + *, + default_value: Optional[Any] = ..., + description: Optional[str] = ..., + required: Optional[bool] = ..., + schema: Optional[dict[str, Any]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.StructuredOutputDefinition(_Model): + description: str + name: str + schema: dict[str, Any] + strict: bool + + @overload + def __init__( + self, + *, + description: str, + name: str, + schema: dict[str, Any], + strict: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.SystemDataV3(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[str] + last_modified_at: Optional[datetime] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[str] = ..., + last_modified_at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TargetCompletionEvalRunDataSource(TypedDict, total=False): + key "input_messages": Required[InputMessagesItemReference] + key "source": Required[Union[SourceFileContent, SourceFileID]] + key "target": Required[Union[AzureAIAgentTargetParam, AzureAIModelTargetParam, dict[str, Any]]] + key "type": Required[Literal["azure_ai_target_completions"]] + + + class azure.ai.projects.models.TaxonomyCategory(_Model): + description: Optional[str] + id: str + name: str + properties: Optional[dict[str, str]] + risk_category: Union[str, RiskCategory] + sub_categories: list[TaxonomySubCategory] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + id: str, + name: str, + properties: Optional[dict[str, str]] = ..., + risk_category: Union[str, RiskCategory], + sub_categories: list[TaxonomySubCategory] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TaxonomySubCategory(_Model): + description: Optional[str] + enabled: bool + id: str + name: str + properties: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + enabled: bool, + id: str, + name: str, + properties: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryConfig(_Model): + endpoints: list[TelemetryEndpoint] + + @overload + def __init__( + self, + *, + endpoints: list[TelemetryEndpoint] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryDataKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINER_OTEL = "ContainerOtel" + CONTAINER_STDOUT_STDERR = "ContainerStdoutStderr" + METRICS = "Metrics" + + + class azure.ai.projects.models.TelemetryEndpoint(_Model): + auth: Optional[TelemetryEndpointAuth] + data: list[Union[str, TelemetryDataKind]] + kind: str + + @overload + def __init__( + self, + *, + auth: Optional[TelemetryEndpointAuth] = ..., + data: list[Union[str, TelemetryDataKind]], + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryEndpointAuth(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TelemetryEndpointAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HEADER = "header" + + + class azure.ai.projects.models.TelemetryEndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OTLP = "OTLP" + + + class azure.ai.projects.models.TelemetryTransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GRPC = "Grpc" + HTTP = "Http" + + + class azure.ai.projects.models.TestingCriterionAzureAIEvaluator(TypedDict, total=False): + key "data_mapping": Dict[str, str] + key "evaluator_name": Required[str] + key "evaluator_version": str + key "initialization_parameters": Dict[str, Any] + key "name": Required[str] + key "type": Required[Literal["azure_ai_evaluator"]] + + + class azure.ai.projects.models.TextResponseFormat(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + JSON_OBJECT = "json_object" + JSON_SCHEMA = "json_schema" + TEXT = "text" + + + class azure.ai.projects.models.TextResponseFormatJsonObject(TextResponseFormat, discriminator='json_object'): + type: Literal[TextResponseFormatConfigurationType.JSON_OBJECT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatJsonSchema(TextResponseFormat, discriminator='json_schema'): + description: Optional[str] + name: str + schema: dict[str, Any] + strict: Optional[bool] + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + schema: dict[str, Any], + strict: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TextResponseFormatText(TextResponseFormat, discriminator='text'): + type: Literal[TextResponseFormatConfigurationType.TEXT] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TimerRoutineTrigger(RoutineTrigger, discriminator='timer'): + at: Optional[datetime] + type: Literal[RoutineTriggerType.TIMER] + + @overload + def __init__( + self, + *, + at: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.Tool(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceAllowed(ToolChoiceParam, discriminator='allowed_tools'): + mode: Literal["auto", "required"] + tools: list[dict[str, Any]] + type: Literal[ToolChoiceParamType.ALLOWED_TOOLS] + + @overload + def __init__( + self, + *, + mode: Literal["auto", "required"], + tools: list[dict[str, Any]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceCodeInterpreter(ToolChoiceParam, discriminator='code_interpreter'): + type: Literal[ToolChoiceParamType.CODE_INTERPRETER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputer(ToolChoiceParam, discriminator='computer'): + type: Literal[ToolChoiceParamType.COMPUTER] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputerUse(ToolChoiceParam, discriminator='computer_use'): + type: Literal[ToolChoiceParamType.COMPUTER_USE] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceComputerUsePreview(ToolChoiceParam, discriminator='computer_use_preview'): + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceCustom(ToolChoiceParam, discriminator='custom'): + name: str + type: Literal[ToolChoiceParamType.CUSTOM] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceFileSearch(ToolChoiceParam, discriminator='file_search'): + type: Literal[ToolChoiceParamType.FILE_SEARCH] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceFunction(ToolChoiceParam, discriminator='function'): + name: str + type: Literal[ToolChoiceParamType.FUNCTION] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceImageGeneration(ToolChoiceParam, discriminator='image_generation'): + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceMCP(ToolChoiceParam, discriminator='mcp'): + name: Optional[str] + server_label: str + type: Literal[ToolChoiceParamType.MCP] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceParam(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOWED_TOOLS = "allowed_tools" + APPLY_PATCH = "apply_patch" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE = "computer_use" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + MCP = "mcp" + SHELL = "shell" + WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH_PREVIEW_2025_03_11 = "web_search_preview_2025_03_11" + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview(ToolChoiceParam, discriminator='web_search_preview'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolChoiceWebSearchPreview20250311(ToolChoiceParam, discriminator='web_search_preview_2025_03_11'): + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW_2025_03_11] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolConfig(_Model): + additional_search_text: Optional[str] + pin: Optional[bool] + + @overload + def __init__( + self, + *, + additional_search_text: Optional[str] = ..., + pin: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolDescription(_Model): + description: Optional[str] + name: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolDescriptionParam(TypedDict, total=False): + key "description": str + key "name": str + + + class azure.ai.projects.models.ToolProjectConnection(_Model): + project_connection_id: str + + @overload + def __init__( + self, + *, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolSearchExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" + + + class azure.ai.projects.models.ToolSearchToolParam(Tool, discriminator='tool_search'): + description: Optional[str] + execution: Optional[Union[str, ToolSearchExecutionType]] + parameters: Optional[EmptyModelParam] + type: Literal[ToolType.TOOL_SEARCH] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + execution: Optional[Union[str, ToolSearchExecutionType]] = ..., + parameters: Optional[EmptyModelParam] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A2A_PREVIEW = "a2a_preview" + APPLY_PATCH = "apply_patch" + AZURE_AI_SEARCH = "azure_ai_search" + AZURE_FUNCTION = "azure_function" + BING_CUSTOM_SEARCH_PREVIEW = "bing_custom_search_preview" + BING_GROUNDING = "bing_grounding" + BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" + CAPTURE_STRUCTURED_OUTPUTS = "capture_structured_outputs" + CODE_INTERPRETER = "code_interpreter" + COMPUTER = "computer" + COMPUTER_USE_PREVIEW = "computer_use_preview" + CUSTOM = "custom" + FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" + FABRIC_IQ_PREVIEW = "fabric_iq_preview" + FILE_SEARCH = "file_search" + FUNCTION = "function" + IMAGE_GENERATION = "image_generation" + LOCAL_SHELL = "local_shell" + MCP = "mcp" + MEMORY_SEARCH_PREVIEW = "memory_search_preview" + NAMESPACE = "namespace" + OPENAPI = "openapi" + SHAREPOINT_GROUNDING_PREVIEW = "sharepoint_grounding_preview" + SHELL = "shell" + TOOLBOX_SEARCH_PREVIEW = "toolbox_search_preview" + TOOL_SEARCH = "tool_search" + WEB_SEARCH = "web_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + WORK_IQ_PREVIEW = "work_iq_preview" + + + class azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions(DataGenerationJobOptions, discriminator='tool_use'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TOOL_USE] + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxObject(_Model): + default_version: str + id: str + name: str + + @overload + def __init__( + self, + *, + default_version: str, + id: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxPolicies(_Model): + rai_config: Optional[RaiConfig] + + @overload + def __init__( + self, + *, + rai_config: Optional[RaiConfig] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxSearchPreviewTool(Tool, discriminator='toolbox_search_preview'): + description: Optional[str] + name: Optional[str] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.TOOLBOX_SEARCH_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxSkill(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxSkillReference(ToolboxSkill, discriminator='skill_reference'): + name: str + type: Literal["skill_reference"] + version: Optional[str] + + @overload + def __init__( + self, + *, + name: str, + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.ToolboxVersionObject(_Model): + created_at: datetime + description: Optional[str] + id: str + metadata: dict[str, str] + name: str + policies: Optional[ToolboxPolicies] + skills: Optional[list[ToolboxSkill]] + tools: list[Tool] + version: str + + @overload + def __init__( + self, + *, + created_at: datetime, + description: Optional[str] = ..., + id: str, + metadata: dict[str, str], + name: str, + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[list[ToolboxSkill]] = ..., + tools: list[Tool], + version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesDataGenerationJobOptions(DataGenerationJobOptions, discriminator='traces'): + max_samples: int + model_options: DataGenerationModelOptions + train_split: float + type: Literal[DataGenerationJobType.TRACES] + + @overload + def __init__( + self, + *, + max_samples: int, + model_options: Optional[DataGenerationModelOptions] = ..., + train_split: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesDataGenerationJobSource(DataGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: str + end_time: Optional[datetime] + start_time: datetime + type: Literal[DataGenerationJobSourceType.TRACES] + + @overload + def __init__( + self, + *, + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesEvaluatorGenerationJobSource(EvaluatorGenerationJobSource, discriminator='traces'): + agent_id: Optional[str] + agent_name: Optional[str] + agent_version: Optional[str] + description: Optional[str] + end_time: Optional[datetime] + start_time: datetime + type: Literal[EvaluatorGenerationJobSourceType.TRACES] + + @overload + def __init__( + self, + *, + agent_id: Optional[str] = ..., + agent_name: Optional[str] = ..., + agent_version: Optional[str] = ..., + description: Optional[str] = ..., + end_time: Optional[datetime] = ..., + start_time: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TracesPreviewEvalRunDataSource(TypedDict, total=False): + key "agent_id": str + key "agent_name": str + key "end_time": datetime + key "ingestion_delay_seconds": int + key "lookback_hours": int + key "max_traces": int + key "trace_ids": List[str] + key "type": Required[Literal["azure_ai_traces_preview"]] + + + class azure.ai.projects.models.TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANGED = "Changed" + DEGRADED = "Degraded" + IMPROVED = "Improved" + INCONCLUSIVE = "Inconclusive" + TOO_FEW_SAMPLES = "TooFewSamples" + + + class azure.ai.projects.models.Trigger(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CRON = "Cron" + ONE_TIME = "OneTime" + RECURRENCE = "Recurrence" + + + class azure.ai.projects.models.UpdateMemoriesLROPoller(LROPoller[MemoryStoreUpdateCompletedResult]): + property superseded_by: Optional[str] # Read-only + property update_id: str # Read-only + + @classmethod + def from_continuation_token( + cls, + polling_method: PollingMethod[MemoryStoreUpdateCompletedResult], + continuation_token: str, + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + + class azure.ai.projects.models.UpdateModelVersionRequest(_Model): + description: Optional[str] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.UpdateToolboxRequest(_Model): + default_version: str + + @overload + def __init__( + self, + *, + default_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.UserProfileMemoryItem(MemoryItem, discriminator='user_profile'): + content: str + kind: Literal[MemoryItemKind.USER_PROFILE] + memory_id: str + scope: str + updated_at: datetime + + @overload + def __init__( + self, + *, + content: str, + memory_id: str, + scope: str, + updated_at: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionIndicator(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionIndicatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VERSION_REF = "version_ref" + + + class azure.ai.projects.models.VersionRefIndicator(VersionIndicator, discriminator='version_ref'): + agent_version: str + type: Literal[VersionIndicatorType.VERSION_REF] + + @overload + def __init__( + self, + *, + agent_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionSelectionRule(_Model): + agent_version: str + type: str + + @overload + def __init__( + self, + *, + agent_version: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionSelector(_Model): + version_selection_rules: list[VersionSelectionRule] + + @overload + def __init__( + self, + *, + version_selection_rules: list[VersionSelectionRule] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.VersionSelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIXED_RATIO = "FixedRatio" + + + class azure.ai.projects.models.WebSearchApproximateLocation(_Model): + city: Optional[str] + country: Optional[str] + region: Optional[str] + timezone: Optional[str] + type: Literal["approximate"] + + @overload + def __init__( + self, + *, + city: Optional[str] = ..., + country: Optional[str] = ..., + region: Optional[str] = ..., + timezone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchConfiguration(_Model): + instance_name: str + project_connection_id: str + + @overload + def __init__( + self, + *, + instance_name: str, + project_connection_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchPreviewTool(Tool, discriminator='web_search_preview'): + search_content_types: Optional[list[Union[str, SearchContentType]]] + search_context_size: Optional[Union[str, SearchContextSize]] + type: Literal[ToolType.WEB_SEARCH_PREVIEW] + user_location: Optional[ApproximateLocation] + + @overload + def __init__( + self, + *, + search_content_types: Optional[list[Union[str, SearchContentType]]] = ..., + search_context_size: Optional[Union[str, SearchContextSize]] = ..., + user_location: Optional[ApproximateLocation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchTool(Tool, discriminator='web_search'): + custom_search_configuration: Optional[WebSearchConfiguration] + description: Optional[str] + filters: Optional[WebSearchToolFilters] + name: Optional[str] + search_context_size: Optional[Literal["low", "medium", "high"]] + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.WEB_SEARCH] + user_location: Optional[WebSearchApproximateLocation] + + @overload + def __init__( + self, + *, + custom_search_configuration: Optional[WebSearchConfiguration] = ..., + description: Optional[str] = ..., + filters: Optional[WebSearchToolFilters] = ..., + name: Optional[str] = ..., + search_context_size: Optional[Literal[low, medium, high]] = ..., + tool_configs: Optional[dict[str, ToolConfig]] = ..., + user_location: Optional[WebSearchApproximateLocation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WebSearchToolFilters(_Model): + allowed_domains: Optional[list[str]] + + @overload + def __init__( + self, + *, + allowed_domains: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator='Weekly'): + days_of_week: list[Union[str, DayOfWeek]] + type: Literal[RecurrenceType.WEEKLY] + + @overload + def __init__( + self, + *, + days_of_week: list[Union[str, DayOfWeek]] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkIQPreviewTool(Tool, discriminator='work_iq_preview'): + description: Optional[str] + name: Optional[str] + project_connection_id: str + tool_configs: Optional[dict[str, ToolConfig]] + type: Literal[ToolType.WORK_IQ_PREVIEW] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: Optional[str] = ..., + project_connection_id: str, + tool_configs: Optional[dict[str, ToolConfig]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.projects.models.WorkflowAgentDefinition(AgentDefinition, discriminator='workflow'): + kind: Literal[AgentKind.WORKFLOW] + rai_config: RaiConfig + workflow: Optional[str] + + @overload + def __init__( + self, + *, + rai_config: Optional[RaiConfig] = ..., + workflow: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.projects.operations + + class azure.ai.projects.operations.AgentsOperations(GeneratedAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_version( + self, + agent_name: str, + *, + blueprint_reference: Optional[AgentBlueprintReference] = ..., + content_type: str = "application/json", + definition: AgentDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + manifest_id: str, + metadata: Optional[dict[str, str]] = ..., + parameter_values: dict[str, Any], + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_manifest( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def delete( + self, + agent_name: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentResponse: ... + + @distributed_trace + def delete_version( + self, + agent_name: str, + agent_version: str, + *, + force: Optional[bool] = ..., + **kwargs: Any + ) -> DeleteAgentVersionResponse: ... + + @distributed_trace + def get( + self, + agent_name: str, + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace + def get_version( + self, + agent_name: str, + agent_version: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + kind: Optional[Union[str, AgentKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentDetails]: ... + + @distributed_trace + def list_versions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[AgentVersionDetails]: ... + + + class azure.ai.projects.operations.BetaAgentsOperations(GeneratedBetaAgentsOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def cancel_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + def create_optimization_job( + self, + job: OptimizationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + def create_optimization_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + def create_optimization_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> OptimizationJob: ... + + @overload + def create_session( + self, + agent_name: str, + *, + agent_session_id: Optional[str] = ..., + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + version_indicator: VersionIndicator, + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_session( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @overload + def create_version_from_code( + self, + agent_name: str, + content: CreateAgentVersionFromCodeContent, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @overload + def create_version_from_code( + self, + agent_name: str, + content: JSON, + *, + code_zip_sha256: str, + **kwargs: Any + ) -> AgentVersionDetails: ... + + @distributed_trace + def delete_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_session( + self, + agent_name: str, + session_id: str, + *, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_session_file( + self, + agent_name: str, + agent_session_id: str, + *, + path: str, + recursive: Optional[bool] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def download_code( + self, + agent_name: str, + *, + agent_version: Optional[str] = ..., + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_session_file( + self, + agent_name: str, + agent_session_id: str, + *, + path: str, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get_optimization_job( + self, + job_id: str, + **kwargs: Any + ) -> OptimizationJob: ... + + @distributed_trace + def get_session( + self, + agent_name: str, + session_id: str, + *, + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> AgentSessionResource: ... + + @distributed_trace + def get_session_log_stream( + self, + agent_name: str, + agent_version: str, + session_id: str, + **kwargs: Any + ) -> SessionLogEvent: ... + + @distributed_trace + def list_optimization_jobs( + self, + *, + agent_name: Optional[str] = ..., + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + status: Optional[Union[str, JobStatus]] = ..., + **kwargs: Any + ) -> ItemPaged[OptimizationJobListItem]: ... + + @distributed_trace + def list_session_files( + self, + agent_name: str, + agent_session_id: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + path: Optional[str] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[SessionDirectoryEntry]: ... + + @distributed_trace + def list_sessions( + self, + agent_name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + user_isolation_key: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[AgentSessionResource]: ... + + @overload + def patch_agent_details( + self, + agent_name: str, + *, + agent_card: Optional[AgentCard] = ..., + agent_endpoint: Optional[AgentEndpointConfig] = ..., + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def patch_agent_details( + self, + agent_name: str, + body: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @overload + def patch_agent_details( + self, + agent_name: str, + body: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> AgentDetails: ... + + @distributed_trace + def stop_session( + self, + agent_name: str, + session_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def upload_session_file( + self, + agent_name: str, + session_id: str, + content_or_file_path: bytes | str, + *, + path: str, + **kwargs: Any + ) -> SessionFileWriteResult: ... + + + class azure.ai.projects.operations.BetaDatasetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + def create_generation_job( + self, + job: DataGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + def create_generation_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @overload + def create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> DataGenerationJob: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[DataGenerationJob]: ... + + + class azure.ai.projects.operations.BetaEvaluationTaxonomiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def create( + self, + name: str, + taxonomy: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def create( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @distributed_trace + def list( + self, + *, + input_name: Optional[str] = ..., + input_type: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluationTaxonomy]: ... + + @overload + def update( + self, + name: str, + taxonomy: EvaluationTaxonomy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def update( + self, + name: str, + taxonomy: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + @overload + def update( + self, + name: str, + taxonomy: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationTaxonomy: ... + + + class azure.ai.projects.operations.BetaEvaluatorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def cancel_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_generation_job( + self, + job: EvaluatorGenerationJob, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_generation_job( + self, + job: JSON, + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_generation_job( + self, + job: IO[bytes], + *, + content_type: str = "application/json", + operation_id: Optional[str] = ..., + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def create_version( + self, + name: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def delete_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: EvaluatorCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def get_generation_job( + self, + job_id: str, + **kwargs: Any + ) -> EvaluatorGenerationJob: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> EvaluatorVersion: ... + + @distributed_trace + def list( + self, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... + + @distributed_trace + def list_generation_jobs( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorGenerationJob]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + limit: Optional[int] = ..., + type: Optional[Union[Literal[builtin], Literal[custom], Literal[all], str]] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluatorVersion]: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: EvaluatorVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluatorVersion: ... + + + class azure.ai.projects.operations.BetaInsightsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def generate( + self, + insight: Insight, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + def generate( + self, + insight: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @overload + def generate( + self, + insight: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Insight: ... + + @distributed_trace + def get( + self, + insight_id: str, + *, + include_coordinates: Optional[bool] = ..., + **kwargs: Any + ) -> Insight: ... + + @distributed_trace + def list( + self, + *, + agent_name: Optional[str] = ..., + eval_id: Optional[str] = ..., + include_coordinates: Optional[bool] = ..., + run_id: Optional[str] = ..., + type: Optional[Union[str, InsightType]] = ..., + **kwargs: Any + ) -> ItemPaged[Insight]: ... + + + class azure.ai.projects.operations.BetaMemoryStoresOperations(GenerateBetaMemoryStoresOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_update_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + previous_update_id: Optional[str] = ..., + scope: str, + update_delay: Optional[int] = ..., + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def begin_update_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def begin_update_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UpdateMemoriesLROPoller: ... + + @overload + def create( + self, + *, + content_type: str = "application/json", + definition: MemoryStoreDefinition, + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create( + self, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create( + self, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def create_memory( + self, + name: str, + *, + content: str, + content_type: str = "application/json", + kind: Union[str, MemoryItemKind], + scope: str, + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def create_memory( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def create_memory( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteMemoryStoreResult: ... + + @distributed_trace + def delete_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> DeleteMemoryResult: ... + + @overload + def delete_scope( + self, + name: str, + *, + content_type: str = "application/json", + scope: str, + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + def delete_scope( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @overload + def delete_scope( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDeleteScopeResult: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @distributed_trace + def get_memory( + self, + name: str, + memory_id: str, + **kwargs: Any + ) -> MemoryItem: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryStoreDetails]: ... + + @overload + def list_memories( + self, + name: str, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + scope: str, + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: JSON, + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def list_memories( + self, + name: str, + body: IO[bytes], + *, + before: Optional[str] = ..., + content_type: str = "application/json", + kind: Optional[Union[str, MemoryItemKind]] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[MemoryItem]: ... + + @overload + def search_memories( + self, + name: str, + *, + content_type: str = "application/json", + items: Optional[Union[str, ResponseInputParam]] = ..., + options: Optional[MemorySearchOptions] = ..., + previous_search_id: Optional[str] = ..., + scope: str, + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def search_memories( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def search_memories( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreSearchResult: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryStoreDetails: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + *, + content: str, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + @overload + def update_memory( + self, + name: str, + memory_id: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> MemoryItem: ... + + + class azure.ai.projects.operations.BetaModelsOperations(BetaModelsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + *, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[True] = True, + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def create( + self, + *, + azcopy_path: Optional[str] = ..., + base_model: Optional[str] = ..., + description: Optional[str] = ..., + name: str, + polling_interval: float = 2.0, + polling_timeout: float = 300.0, + source: Union[str, PathLike[str]], + tags: Optional[dict[str, str]] = ..., + version: str, + wait_for_commit: Literal[False], + weight_type: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: ModelCredentialRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @overload + def get_credentials( + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[ModelVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[ModelVersion]: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: ModelVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_create_version( + self, + name: str, + version: str, + model_version: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CreateAsyncResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: ModelPendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ModelPendingUploadResponse: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: UpdateModelVersionRequest, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + @overload + def update( + self, + name: str, + version: str, + model_version_update: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> ModelVersion: ... + + + class azure.ai.projects.operations.BetaOperations(GeneratedBetaOperations): + agents: BetaAgentsOperations + datasets: BetaDatasetsOperations + evaluation_taxonomies: BetaEvaluationTaxonomiesOperations + evaluators: BetaEvaluatorsOperations + insights: BetaInsightsOperations + memory_stores: BetaMemoryStoresOperations + models: BetaModelsOperations + red_teams: BetaRedTeamsOperations + routines: BetaRoutinesOperations + schedules: BetaSchedulesOperations + skills: BetaSkillsOperations + toolboxes: BetaToolboxesOperations + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + + class azure.ai.projects.operations.BetaRedTeamsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + red_team: RedTeam, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + def create( + self, + red_team: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @overload + def create( + self, + red_team: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> RedTeam: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[RedTeam]: ... + + + class azure.ai.projects.operations.BetaRoutinesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + routine_name: str, + *, + action: Optional[RoutineAction] = ..., + content_type: str = "application/json", + description: Optional[str] = ..., + enabled: Optional[bool] = ..., + triggers: Optional[dict[str, RoutineTrigger]] = ..., + **kwargs: Any + ) -> Routine: ... + + @overload + def create_or_update( + self, + routine_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @overload + def create_or_update( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def delete( + self, + routine_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def disable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @overload + def dispatch( + self, + routine_name: str, + *, + content_type: str = "application/json", + payload: Optional[RoutineDispatchPayload] = ..., + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @overload + def dispatch( + self, + routine_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DispatchRoutineResult: ... + + @distributed_trace + def enable( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def get( + self, + routine_name: str, + **kwargs: Any + ) -> Routine: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Routine]: ... + + @distributed_trace + def list_runs( + self, + routine_name: str, + *, + before: Optional[str] = ..., + filter: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[RoutineRun]: ... + + + class azure.ai.projects.operations.BetaSchedulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: Schedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @overload + def create_or_update( + self, + schedule_id: str, + schedule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace + def delete( + self, + schedule_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + schedule_id: str, + **kwargs: Any + ) -> Schedule: ... + + @distributed_trace + def get_run( + self, + schedule_id: str, + run_id: str, + **kwargs: Any + ) -> ScheduleRun: ... + + @distributed_trace + def list( + self, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> ItemPaged[Schedule]: ... + + @distributed_trace + def list_runs( + self, + schedule_id: str, + *, + enabled: Optional[bool] = ..., + type: Optional[Union[str, ScheduleTaskType]] = ..., + **kwargs: Any + ) -> ItemPaged[ScheduleRun]: ... + + + class azure.ai.projects.operations.BetaSkillsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + name: str, + *, + content_type: str = "application/json", + default: Optional[bool] = ..., + inline_content: Optional[SkillInlineContent] = ..., + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: CreateSkillVersionFromFilesBody, + **kwargs: Any + ) -> SkillVersion: ... + + @overload + def create_from_files( + self, + name: str, + content: JSON, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> DeleteSkillResult: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> DeleteSkillVersionResult: ... + + @distributed_trace + def download( + self, + name: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def download_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> Iterator[bytes]: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> SkillDetails: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> SkillVersion: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[SkillDetails]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[SkillVersion]: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> SkillDetails: ... + + @overload + def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SkillDetails: ... + + + class azure.ai.projects.operations.BetaToolboxesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_version( + self, + name: str, + *, + content_type: str = "application/json", + description: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ..., + policies: Optional[ToolboxPolicies] = ..., + skills: Optional[List[ToolboxSkill]] = ..., + tools: List[Tool], + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + def create_version( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @overload + def create_version( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace + def delete( + self, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @distributed_trace + def get_version( + self, + name: str, + version: str, + **kwargs: Any + ) -> ToolboxVersionObject: ... + + @distributed_trace + def list( + self, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxObject]: ... + + @distributed_trace + def list_versions( + self, + name: str, + *, + before: Optional[str] = ..., + limit: Optional[int] = ..., + order: Optional[Union[str, PageOrder]] = ..., + **kwargs: Any + ) -> ItemPaged[ToolboxVersionObject]: ... + + @overload + def update( + self, + name: str, + *, + content_type: str = "application/json", + default_version: str, + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + def update( + self, + name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + @overload + def update( + self, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ToolboxObject: ... + + + class azure.ai.projects.operations.ConnectionsOperations(ConnectionsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def get_default( + self, + connection_type: Union[str, ConnectionType], + *, + include_credentials: Optional[bool] = False, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + def list( + self, + *, + connection_type: Optional[Union[str, ConnectionType]] = ..., + default_connection: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[Connection]: ... + + + class azure.ai.projects.operations.DatasetsOperations(DatasetsOperationsGenerated): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: DatasetVersion, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + dataset_version: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetVersion: ... + + @distributed_trace + def get_credentials( + self, + name: str, + version: str, + **kwargs: Any + ) -> DatasetCredential: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[DatasetVersion]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[DatasetVersion]: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: PendingUploadRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @overload + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PendingUploadResponse: ... + + @distributed_trace + def upload_file( + self, + *, + connection_name: Optional[str] = ..., + file_path: str, + name: str, + version: str, + **kwargs: Any + ) -> FileDatasetVersion: ... + + @distributed_trace + def upload_folder( + self, + *, + connection_name: Optional[str] = ..., + file_pattern: Optional[Pattern] = ..., + folder: str, + name: str, + version: str, + **kwargs: Any + ) -> FolderDatasetVersion: ... + + + class azure.ai.projects.operations.DeploymentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> Deployment: ... + + @distributed_trace + def list( + self, + *, + deployment_type: Optional[Union[str, DeploymentType]] = ..., + model_name: Optional[str] = ..., + model_publisher: Optional[str] = ..., + **kwargs: Any + ) -> ItemPaged[Deployment]: ... + + + class azure.ai.projects.operations.EvaluationRulesOperations(GeneratedEvaluationRulesOperations): + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: EvaluationRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @overload + def create_or_update( + self, + id: str, + evaluation_rule: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace + def delete( + self, + id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + id: str, + **kwargs: Any + ) -> EvaluationRule: ... + + @distributed_trace + def list( + self, + *, + action_type: Optional[Union[str, EvaluationRuleActionType]] = ..., + agent_name: Optional[str] = ..., + enabled: Optional[bool] = ..., + **kwargs: Any + ) -> ItemPaged[EvaluationRule]: ... + + + class azure.ai.projects.operations.IndexesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @overload + def create_or_update( + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> Index: ... + + @distributed_trace + def delete( + self, + name: str, + version: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + version: str, + **kwargs: Any + ) -> Index: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Index]: ... + + @distributed_trace + def list_versions( + self, + name: str, + **kwargs: Any + ) -> ItemPaged[Index]: ... + + + class azure.ai.projects.operations.TelemetryOperations: + + def __init__(self, outer_instance: AIProjectClient) -> None: ... + + @distributed_trace + def get_application_insights_connection_string(self) -> str: ... + + +namespace azure.ai.projects.telemetry + + def azure.ai.projects.telemetry.trace_function(span_name: Optional[str] = None) -> Callable: ... + + + class azure.ai.projects.telemetry.AIProjectInstrumentor: + + def __init__(self) -> None: ... + + def instrument( + self, + enable_content_recording: Optional[bool] = None, + enable_trace_context_propagation: Optional[bool] = None, + enable_baggage_propagation: Optional[bool] = None + ) -> None: ... + + def is_content_recording_enabled(self) -> bool: ... + + def is_instrumented(self) -> bool: ... + + def uninstrument(self) -> None: ... + + +``` \ No newline at end of file From 0fa136af3ce2840a2f75ba72726e232442b8281d Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 15 Jun 2026 10:56:17 -0700 Subject: [PATCH 40/40] Update api files --- sdk/ai/azure-ai-projects/api.md | 3 --- sdk/ai/azure-ai-projects/api.metadata.yml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/api.metadata.yml diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 509f48f2ee4f..657edf783e06 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -1,7 +1,4 @@ ```py -# Package is parsed using apiview-stub-generator(version:0.3.28), Python version: 3.14.3 - - namespace azure.ai.projects class azure.ai.projects.AIProjectClient(AIProjectClientGenerated): implements ContextManager diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml new file mode 100644 index 000000000000..f930bb0f724f --- /dev/null +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 21533487ff2217a30e5e9e61194466340ea4be034aef29cc66784996eaa298d0 +parserVersion: 0.3.28 +pythonVersion: 3.14.3