diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index b4e7fcf1ec65..435f53cddf7c 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -10,10 +10,10 @@ * 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 `.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: `list_versions`, `list`, `get`, `delete`, `update`, `create_async`, `pending_upload`, `get_credentials`. -* New `.beta.routines` sub-client with routine operations: `create_or_update`, `get`, `enable`, `disable`, `list`, `delete`, `list_runs`, `dispatch_async`. +* New `.beta.models` sub-client to handle AI model weights: `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.agents` for code-based hosted agents: `create_version_from_code`, `download_agent_code`. +* New methods on `.beta.agents` for code-based hosted agents: `create_version_from_code`, `download_code`. * New methods on `.beta.agents` for optimization jobs: `create_optimization_job`, `get_optimization_job`, `list_optimization_jobs`, `cancel_optimization_job`, `list_optimization_candidates`. * New methods on `.beta.memory_stores` to handle individual memory items:`.beta.memory_stores`: `get_memory`, `delete_memory`. * New read-only property `content_hash` on `CodeConfiguration`, returning the SHA-256 hex digest of the uploaded code zip. @@ -33,7 +33,6 @@ 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 `PendingUploadResponse` to `PendingUploadResult`. * Renamed class `SessionDirectoryListResponse` to `SessionDirectoryListResult`. * Renamed class `SessionFileWriteResponse` to `SessionFileWriteResult`. * Renamed class `SkillObject` to `SkillDetails`. diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 6b220f8903f9..7e6e38b214d3 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -119,12 +119,12 @@ "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", "azure.ai.projects.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", "azure.ai.projects.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", - "azure.ai.projects.models.DeleteMemoryResponse": "Azure.AI.Projects.DeleteMemoryResponse", + "azure.ai.projects.models.DeleteMemoryResult": "Azure.AI.Projects.DeleteMemoryResponse", "azure.ai.projects.models.DeleteMemoryStoreResult": "Azure.AI.Projects.DeleteMemoryStoreResponse", "azure.ai.projects.models.DeleteSkillResult": "Azure.AI.Projects.DeleteSkillResponse", "azure.ai.projects.models.Deployment": "Azure.AI.Projects.Deployment", "azure.ai.projects.models.Dimension": "Azure.AI.Projects.Dimension", - "azure.ai.projects.models.DispatchRoutineResponse": "Azure.AI.Projects.DispatchRoutineResponse", + "azure.ai.projects.models.DispatchRoutineResult": "Azure.AI.Projects.DispatchRoutineResponse", "azure.ai.projects.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration", "azure.ai.projects.models.EntraAuthorizationScheme": "Azure.AI.Projects.EntraAuthorizationScheme", "azure.ai.projects.models.EntraIDCredentials": "Azure.AI.Projects.EntraIDCredentials", @@ -249,7 +249,7 @@ "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.PendingUploadResult": "Azure.AI.Projects.PendingUploadResponse", + "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.ProceduralMemoryItem": "Azure.AI.Projects.ProceduralMemoryItem", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", 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 74ca7f7b13ba..a25abbf8a518 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 @@ -10,6 +10,7 @@ from .._utils.model_base import Model, SdkJSONEncoder + # file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` FileContent = Union[str, bytes, IO[str], IO[bytes]] diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index 5e6c7cc31436..7a9f6d37dc42 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 @@ -52,7 +52,7 @@ build_beta_agents_delete_optimization_job_request, build_beta_agents_delete_session_file_request, build_beta_agents_delete_session_request, - build_beta_agents_download_agent_code_request, + build_beta_agents_download_code_request, build_beta_agents_download_session_file_request, build_beta_agents_get_optimization_candidate_config_request, build_beta_agents_get_optimization_candidate_request, @@ -105,12 +105,12 @@ build_beta_memory_stores_update_memories_request, build_beta_memory_stores_update_memory_request, build_beta_memory_stores_update_request, - build_beta_models_create_async_request, build_beta_models_delete_request, build_beta_models_get_credentials_request, build_beta_models_get_request, build_beta_models_list_request, build_beta_models_list_versions_request, + build_beta_models_pending_create_version_request, build_beta_models_pending_upload_request, build_beta_models_update_request, build_beta_red_teams_create_request, @@ -119,7 +119,7 @@ build_beta_routines_create_or_update_request, build_beta_routines_delete_request, build_beta_routines_disable_request, - build_beta_routines_dispatch_async_request, + build_beta_routines_dispatch_request, build_beta_routines_enable_request, build_beta_routines_get_request, build_beta_routines_list_request, @@ -302,8 +302,8 @@ async def delete( :param agent_name: The name of the agent to delete. Required. :type agent_name: str :keyword force: For Hosted Agents, if true, force-deletes the agent even if its versions have - active sessions, cascading deletion to all associated sessions. This value is not relevant for - other Agent types. Defaults to false. Default value is None. + active sessions, cascading deletion to all associated sessions. Defaults to ``false``. This + value is not relevant for other Agent types. Default value is None. :paramtype force: bool :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse @@ -953,8 +953,8 @@ async def delete_version( :param agent_version: The version of the agent to delete. Required. :type agent_version: str :keyword force: For Hosted Agents, if true, force-deletes the version even if it has active - sessions, cascading deletion to all associated sessions. This value is not relevant for other - Agent types. Defaults to false. Default value is None. + sessions, cascading deletion to all associated sessions. Defaults to ``false``. This value is + not relevant for other Agent types. Default value is None. :paramtype force: bool :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping @@ -2195,7 +2195,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2207,8 +2207,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2221,7 +2221,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2233,8 +2233,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2247,7 +2247,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2259,8 +2259,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2271,7 +2271,7 @@ async def pending_upload( version: str, pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2282,8 +2282,8 @@ async def pending_upload( types: PendingUploadRequest, JSON, IO[bytes] Required. :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2298,7 +2298,7 @@ async def pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResult] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2341,7 +2341,7 @@ async def pending_upload( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PendingUploadResult, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3371,7 +3371,7 @@ async def create_version_from_code( return deserialized # type: ignore @distributed_trace_async - async def download_agent_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. @@ -3405,7 +3405,7 @@ async def download_agent_code( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_beta_agents_download_agent_code_request( + _request = build_beta_agents_download_code_request( agent_name=agent_name, agent_version=agent_version, api_version=self._config.api_version, @@ -6216,7 +6216,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -6228,8 +6228,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6242,7 +6242,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -6254,8 +6254,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6268,7 +6268,7 @@ async def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -6280,8 +6280,8 @@ async def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6292,7 +6292,7 @@ async def pending_upload( version: str, pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -6303,8 +6303,8 @@ async def pending_upload( types: PendingUploadRequest, JSON, IO[bytes] Required. :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6319,7 +6319,7 @@ async def pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResult] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -6366,7 +6366,7 @@ async def pending_upload( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PendingUploadResult, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8949,6 +8949,7 @@ def list_memories( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore def prepare_request(_continuation_token=None): + _request = build_beta_memory_stores_list_memories_request( name=name, kind=kind, @@ -9000,15 +9001,15 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResponse: + async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: """Delete a memory item from a memory store. :param name: The name of the memory store. Required. :type name: str :param memory_id: The ID of the memory item to delete. Required. :type memory_id: str - :return: DeleteMemoryResponse. The DeleteMemoryResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteMemoryResponse + :return: DeleteMemoryResult. The DeleteMemoryResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteMemoryResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9022,7 +9023,7 @@ async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteMemoryResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.DeleteMemoryResult] = kwargs.pop("cls", None) _request = build_beta_memory_stores_delete_memory_request( name=name, @@ -9060,7 +9061,7 @@ async def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _mode if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeleteMemoryResponse, response.json()) + deserialized = _deserialize(_models.DeleteMemoryResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9537,11 +9538,11 @@ async def update( return deserialized # type: ignore @overload - async def create_async( + async def pending_create_version( self, name: str, version: str, - body: _models.ModelVersion, + model_version: _models.ModelVersion, *, content_type: str = "application/json", **kwargs: Any @@ -9553,8 +9554,8 @@ async def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: ~azure.ai.projects.models.ModelVersion + :param model_version: Model version to create. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9564,8 +9565,8 @@ async def create_async( """ @overload - async def create_async( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -9574,8 +9575,8 @@ async def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: JSON + :param model_version: Model version to create. Required. + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9585,8 +9586,14 @@ async def create_async( """ @overload - async def create_async( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + async def pending_create_version( + self, + name: str, + version: str, + model_version: IO[bytes], + *, + 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. @@ -9595,8 +9602,8 @@ async def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: IO[bytes] + :param model_version: Model version to create. Required. + :type model_version: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -9606,8 +9613,8 @@ async def create_async( """ @distributed_trace_async - async def create_async( - self, name: str, version: str, body: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + 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. @@ -9616,9 +9623,9 @@ async def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Is one of the following types: ModelVersion, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -9639,12 +9646,12 @@ async def create_async( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(model_version, (IOBase, bytes)): + _content = model_version else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(model_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_beta_models_create_async_request( + _request = build_beta_models_pending_create_version_request( name=name, version=version, content_type=content_type, @@ -9693,7 +9700,7 @@ async def pending_upload( self, name: str, version: str, - body: _models.ModelPendingUploadRequest, + pending_upload_request: _models.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -9704,8 +9711,8 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: ~azure.ai.projects.models.ModelPendingUploadRequest + :param pending_upload_request: Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9717,7 +9724,13 @@ async def pending_upload( @overload async def pending_upload( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -9725,8 +9738,8 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: JSON + :param pending_upload_request: Required. + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9738,7 +9751,13 @@ async def pending_upload( @overload async def pending_upload( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -9746,8 +9765,8 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: IO[bytes] + :param pending_upload_request: Required. + :type pending_upload_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 @@ -9759,7 +9778,11 @@ async def pending_upload( @distributed_trace_async async def pending_upload( - self, name: str, version: str, body: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -9767,9 +9790,10 @@ async def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Is one of the following types: ModelPendingUploadRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or IO[bytes] + :param pending_upload_request: Is one of the following types: ModelPendingUploadRequest, JSON, + IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -9791,10 +9815,10 @@ async def pending_upload( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_models_pending_upload_request( name=name, @@ -9842,7 +9866,7 @@ async def get_credentials( self, name: str, version: str, - body: _models.ModelCredentialRequest, + credential_request: _models.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -9853,8 +9877,8 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: ~azure.ai.projects.models.ModelCredentialRequest + :param credential_request: Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9865,7 +9889,13 @@ async def get_credentials( @overload async def get_credentials( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -9873,8 +9903,8 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: JSON + :param credential_request: Required. + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9885,7 +9915,13 @@ async def get_credentials( @overload async def get_credentials( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -9893,8 +9929,8 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: IO[bytes] + :param credential_request: Required. + :type credential_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 @@ -9905,7 +9941,11 @@ async def get_credentials( @distributed_trace_async async def get_credentials( - self, name: str, version: str, body: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -9913,8 +9953,9 @@ async def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Is one of the following types: ModelCredentialRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: Is one of the following types: ModelCredentialRequest, JSON, + IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -9935,10 +9976,10 @@ async def get_credentials( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(credential_request, (IOBase, bytes)): + _content = credential_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(credential_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_models_get_credentials_request( name=name, @@ -10896,14 +10937,14 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @overload - async def dispatch_async( + async def dispatch( self, routine_name: str, *, content_type: str = "application/json", payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -10914,15 +10955,15 @@ async def dispatch_async( :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def dispatch_async( + async def dispatch( self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -10932,15 +10973,15 @@ async def dispatch_async( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def dispatch_async( + async def dispatch( self, routine_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -10950,20 +10991,20 @@ async def dispatch_async( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def dispatch_async( + async def dispatch( self, routine_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -10973,8 +11014,8 @@ async def dispatch_async( :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10989,7 +11030,7 @@ async def dispatch_async( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DispatchRoutineResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.DispatchRoutineResult] = kwargs.pop("cls", None) if body is _Unset: body = {"payload": payload} @@ -11001,7 +11042,7 @@ async def dispatch_async( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_beta_routines_dispatch_async_request( + _request = build_beta_routines_dispatch_request( routine_name=routine_name, content_type=content_type, api_version=self._config.api_version, @@ -11038,7 +11079,7 @@ async def dispatch_async( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DispatchRoutineResponse, response.json()) + deserialized = _deserialize(_models.DispatchRoutineResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py index 29b38664a588..46a4d7a9e456 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_agents_async.py @@ -69,7 +69,7 @@ async def create_version( :keyword description: A human-readable description of the agent. Default value is None. :paramtype description: str :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentVersionDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -160,7 +160,7 @@ async def create_version( :keyword description: A human-readable description of the agent. Default value is None. :paramtype description: str :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentVersionDetails :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py index f4983d79e7f9..dc7095c827ea 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_patch_datasets_async.py @@ -22,7 +22,7 @@ FileDatasetVersion, FolderDatasetVersion, PendingUploadRequest, - PendingUploadResult, + PendingUploadResponse, PendingUploadType, ) @@ -48,7 +48,7 @@ async def _create_dataset_and_get_its_container_client( connection_name: Optional[str] = None, ) -> Tuple[ContainerClient, str]: - pending_upload_response: PendingUploadResult = await self.pending_upload( + pending_upload_response: PendingUploadResponse = await self.pending_upload( name=name, version=input_version, pending_upload_request=PendingUploadRequest( 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 1b8c85aace5a..18cf2f3c5d96 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 @@ -118,12 +118,12 @@ DatasetVersion, DeleteAgentResponse, DeleteAgentVersionResponse, - DeleteMemoryResponse, + DeleteMemoryResult, DeleteMemoryStoreResult, DeleteSkillResult, Deployment, Dimension, - DispatchRoutineResponse, + DispatchRoutineResult, EmbeddingConfiguration, EntraAuthorizationScheme, EntraIDCredentials, @@ -251,7 +251,7 @@ OptimizationTaskResult, OtlpTelemetryEndpoint, PendingUploadRequest, - PendingUploadResult, + PendingUploadResponse, ProceduralMemoryItem, PromptAgentDefinition, PromptAgentDefinitionTextOptions, @@ -540,12 +540,12 @@ "DatasetVersion", "DeleteAgentResponse", "DeleteAgentVersionResponse", - "DeleteMemoryResponse", + "DeleteMemoryResult", "DeleteMemoryStoreResult", "DeleteSkillResult", "Deployment", "Dimension", - "DispatchRoutineResponse", + "DispatchRoutineResult", "EmbeddingConfiguration", "EntraAuthorizationScheme", "EntraIDCredentials", @@ -673,7 +673,7 @@ "OptimizationTaskResult", "OtlpTelemetryEndpoint", "PendingUploadRequest", - "PendingUploadResult", + "PendingUploadResponse", "ProceduralMemoryItem", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", 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 b73ace6881df..f904d16f9caa 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 @@ -4077,7 +4077,7 @@ class CronTrigger(Trigger, discriminator="Cron"): :vartype type: str or ~azure.ai.projects.models.CRON :ivar expression: Cron expression that defines the schedule frequency. Required. :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. + :ivar time_zone: Time zone for the cron schedule. Defaults to ``UTC``. :vartype time_zone: str :ivar start_time: Start time for the cron schedule in ISO 8601 format. :vartype start_time: ~datetime.datetime @@ -4090,7 +4090,7 @@ class CronTrigger(Trigger, discriminator="Cron"): expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Cron expression that defines the schedule frequency. Required.""" time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the cron schedule.""" + """Time zone for the cron schedule. Defaults to ``UTC``.""" start_time: Optional[datetime.datetime] = rest_field( name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) @@ -5161,7 +5161,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeleteMemoryResponse(_Model): +class DeleteMemoryResult(_Model): """Response for deleting a memory item from a memory store. :ivar object: The object type. Always 'memory_store.item.deleted'. Required. MEMORY_DELETED. @@ -5329,7 +5329,7 @@ class Dimension(_Model): :ivar always_applicable: When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom - dimensions. + dimensions. Defaults to ``false``. :vartype always_applicable: bool """ @@ -5347,7 +5347,8 @@ class Dimension(_Model): always_applicable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set - to true and is non-editable. Users may set this on their own custom dimensions.""" + to true and is non-editable. Users may set this on their own custom dimensions. Defaults to + ``false``.""" @overload def __init__( @@ -5370,7 +5371,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DispatchRoutineResponse(_Model): +class DispatchRoutineResult(_Model): """Identifiers returned after a routine dispatch is queued. :ivar dispatch_id: The dispatch identifier created for the routine dispatch. @@ -9384,14 +9385,14 @@ class MemoryStoreDefaultOptions(_Model): :ivar user_profile_details: Specific categories or types of user profile information to extract and store. :vartype user_profile_details: str - :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Default is - true. Required. + :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Defaults to + ``true``. Required. :vartype chat_summary_enabled: bool :ivar procedural_memory_enabled: Whether to enable procedural memory extraction and storage. - Default is true. + Defaults to ``true``. :vartype procedural_memory_enabled: bool - :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of 0 - indicates that memories do not expire. + :ivar default_ttl_seconds: The default time-to-live for memories in seconds. A value of ``0`` + indicates that memories do not expire. Defaults to ``0``. :vartype default_ttl_seconds: int """ @@ -9400,12 +9401,12 @@ class MemoryStoreDefaultOptions(_Model): user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specific categories or types of user profile information to extract and store.""" chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable chat summary extraction and storage. Default is true. Required.""" + """Whether to enable chat summary extraction and storage. Defaults to ``true``. Required.""" procedural_memory_enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable procedural memory extraction and storage. Default is true.""" + """Whether to enable procedural memory extraction and storage. Defaults to ``true``.""" default_ttl_seconds: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default time-to-live for memories in seconds. A value of 0 indicates that memories do not - expire.""" + """The default time-to-live for memories in seconds. A value of ``0`` indicates that memories do + not expire. Defaults to ``0``.""" @overload def __init__( @@ -10260,7 +10261,7 @@ class OneTimeTrigger(Trigger, discriminator="OneTime"): :vartype type: str or ~azure.ai.projects.models.ONE_TIME :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. :vartype trigger_at: ~datetime.datetime - :ivar time_zone: Time zone for the one-time trigger. + :ivar time_zone: Time zone for the one-time trigger. Defaults to ``UTC``. :vartype time_zone: str """ @@ -10271,7 +10272,7 @@ class OneTimeTrigger(Trigger, discriminator="OneTime"): ) """Date and time for the one-time trigger in ISO 8601 format. Required.""" time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the one-time trigger.""" + """Time zone for the one-time trigger. Defaults to ``UTC``.""" @overload def __init__( @@ -11430,7 +11431,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PendingUploadResult(_Model): +class PendingUploadResponse(_Model): """Represents the response for a pending upload request. :ivar blob_reference: Container-level read, write, list SAS. Required. @@ -11537,14 +11538,13 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): :vartype instructions: str :ivar temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and - deterministic. We generally recommend altering this or ``top_p`` but not both. + deterministic. We generally recommend altering this or ``top_p`` but not both. Defaults to + ``1``. :vartype temperature: float - :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. - - We generally recommend altering this or ``temperature`` but not both. + :ivar top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 means only the + tokens comprising the top 10% probability mass are considered. We generally recommend altering + this or ``temperature`` but not both. Defaults to ``1``. :vartype top_p: float :ivar reasoning: :vartype reasoning: ~azure.ai.projects.models.Reasoning @@ -11572,14 +11572,12 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We - generally recommend altering this or ``top_p`` but not both.""" + generally recommend altering this or ``top_p`` but not both. Defaults to ``1``.""" top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. - - We generally recommend altering this or ``temperature`` but not both.""" + """An alternative to sampling with temperature, called nucleus sampling, where the model considers + the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising + the top 10% probability mass are considered. We generally recommend altering this or + ``temperature`` but not both. Defaults to ``1``.""" reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of tools the model may call while generating a response. You can specify which tool to @@ -11958,7 +11956,7 @@ class RecurrenceTrigger(Trigger, discriminator="Recurrence"): :vartype start_time: ~datetime.datetime :ivar end_time: End time for the recurrence schedule in ISO 8601 format. :vartype end_time: ~datetime.datetime - :ivar time_zone: Time zone for the recurrence schedule. + :ivar time_zone: Time zone for the recurrence schedule. Defaults to ``UTC``. :vartype time_zone: str :ivar interval: Interval for the recurrence schedule. Required. :vartype interval: int @@ -11977,7 +11975,7 @@ class RecurrenceTrigger(Trigger, discriminator="Recurrence"): ) """End time for the recurrence schedule in ISO 8601 format.""" time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the recurrence schedule.""" + """Time zone for the recurrence schedule. Defaults to ``UTC``.""" interval: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Interval for the recurrence schedule. Required.""" schedule: "_models.RecurrenceSchedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -13160,7 +13158,8 @@ class StructuredInputDefinition(_Model): :vartype default_value: any :ivar schema: The JSON schema for the structured input (optional). :vartype schema: dict[str, any] - :ivar required: Whether the input property is required when the agent is invoked. + :ivar required: Whether the input property is required when the agent is invoked. Defaults to + ``false``. :vartype required: bool """ @@ -13171,7 +13170,7 @@ class StructuredInputDefinition(_Model): schema: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The JSON schema for the structured input (optional).""" required: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the input property is required when the agent is invoked.""" + """Whether the input property is required when the agent is invoked. Defaults to ``false``.""" @overload def __init__( 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 7a758cf07acd..598044703105 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 @@ -860,7 +860,7 @@ def build_beta_agents_create_version_from_code_request( # pylint: disable=name- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_agents_download_agent_code_request( # pylint: disable=name-too-long +def build_beta_agents_download_code_request( agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2506,7 +2506,9 @@ def build_beta_models_update_request(name: str, version: str, **kwargs: Any) -> return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_models_create_async_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_beta_models_pending_create_version_request( # pylint: disable=name-too-long + name: str, version: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -2853,9 +2855,7 @@ def build_beta_routines_list_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_routines_dispatch_async_request( # pylint: disable=name-too-long - routine_name: str, **kwargs: Any -) -> HttpRequest: +def build_beta_routines_dispatch_request(routine_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -3693,8 +3693,8 @@ def delete(self, agent_name: str, *, force: Optional[bool] = None, **kwargs: Any :param agent_name: The name of the agent to delete. Required. :type agent_name: str :keyword force: For Hosted Agents, if true, force-deletes the agent even if its versions have - active sessions, cascading deletion to all associated sessions. This value is not relevant for - other Agent types. Defaults to false. Default value is None. + active sessions, cascading deletion to all associated sessions. Defaults to ``false``. This + value is not relevant for other Agent types. Default value is None. :paramtype force: bool :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse @@ -4344,8 +4344,8 @@ def delete_version( :param agent_version: The version of the agent to delete. Required. :type agent_version: str :keyword force: For Hosted Agents, if true, force-deletes the version even if it has active - sessions, cascading deletion to all associated sessions. This value is not relevant for other - Agent types. Defaults to false. Default value is None. + sessions, cascading deletion to all associated sessions. Defaults to ``false``. This value is + not relevant for other Agent types. Default value is None. :paramtype force: bool :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping @@ -5586,7 +5586,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -5598,8 +5598,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5612,7 +5612,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -5624,8 +5624,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5638,7 +5638,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -5650,8 +5650,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5662,7 +5662,7 @@ def pending_upload( version: str, pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -5673,8 +5673,8 @@ def pending_upload( types: PendingUploadRequest, JSON, IO[bytes] Required. :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5689,7 +5689,7 @@ def pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResult] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -5732,7 +5732,7 @@ def pending_upload( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PendingUploadResult, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6762,9 +6762,7 @@ def create_version_from_code( return deserialized # type: ignore @distributed_trace - def download_agent_code( - self, agent_name: str, *, agent_version: Optional[str] = None, **kwargs: Any - ) -> Iterator[bytes]: + 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. Returns the previously-uploaded zip (``application/zip``). @@ -6796,7 +6794,7 @@ def download_agent_code( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_beta_agents_download_agent_code_request( + _request = build_beta_agents_download_code_request( agent_name=agent_name, agent_version=agent_version, api_version=self._config.api_version, @@ -9611,7 +9609,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -9623,8 +9621,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9637,7 +9635,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -9649,8 +9647,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9663,7 +9661,7 @@ def pending_upload( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -9675,8 +9673,8 @@ def pending_upload( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9687,7 +9685,7 @@ def pending_upload( version: str, pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.PendingUploadResult: + ) -> _models.PendingUploadResponse: """Start a new or get an existing pending upload of an evaluator for a specific version. :param name: Required. @@ -9698,8 +9696,8 @@ def pending_upload( types: PendingUploadRequest, JSON, IO[bytes] Required. :type pending_upload_request: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] - :return: PendingUploadResult. The PendingUploadResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResult + :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9714,7 +9712,7 @@ def pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PendingUploadResult] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -9761,7 +9759,7 @@ def pending_upload( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PendingUploadResult, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12329,7 +12327,7 @@ def list_memories( raise TypeError("missing required argument: scope") body = {"scope": scope} body = {k: v for k, v in body.items() if v is not None} - + content_type = content_type or "application/json" _content = None if isinstance(body, (IOBase, bytes)): @@ -12338,6 +12336,7 @@ def list_memories( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore def prepare_request(_continuation_token=None): + _request = build_beta_memory_stores_list_memories_request( name=name, kind=kind, @@ -12389,15 +12388,15 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResponse: + def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.DeleteMemoryResult: """Delete a memory item from a memory store. :param name: The name of the memory store. Required. :type name: str :param memory_id: The ID of the memory item to delete. Required. :type memory_id: str - :return: DeleteMemoryResponse. The DeleteMemoryResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteMemoryResponse + :return: DeleteMemoryResult. The DeleteMemoryResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteMemoryResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12411,7 +12410,7 @@ def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.Del _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteMemoryResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.DeleteMemoryResult] = kwargs.pop("cls", None) _request = build_beta_memory_stores_delete_memory_request( name=name, @@ -12449,7 +12448,7 @@ def delete_memory(self, name: str, memory_id: str, **kwargs: Any) -> _models.Del if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeleteMemoryResponse, response.json()) + deserialized = _deserialize(_models.DeleteMemoryResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12926,11 +12925,11 @@ def update( return deserialized # type: ignore @overload - def create_async( + def pending_create_version( self, name: str, version: str, - body: _models.ModelVersion, + model_version: _models.ModelVersion, *, content_type: str = "application/json", **kwargs: Any @@ -12942,8 +12941,8 @@ def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: ~azure.ai.projects.models.ModelVersion + :param model_version: Model version to create. Required. + :type model_version: ~azure.ai.projects.models.ModelVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12953,8 +12952,8 @@ def create_async( """ @overload - def create_async( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + 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. @@ -12963,8 +12962,8 @@ def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: JSON + :param model_version: Model version to create. Required. + :type model_version: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12974,8 +12973,14 @@ def create_async( """ @overload - def create_async( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + def pending_create_version( + self, + name: str, + version: str, + model_version: IO[bytes], + *, + 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. @@ -12984,8 +12989,8 @@ def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Required. - :type body: IO[bytes] + :param model_version: Model version to create. Required. + :type model_version: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -12995,8 +13000,8 @@ def create_async( """ @distributed_trace - def create_async( - self, name: str, version: str, body: Union[_models.ModelVersion, JSON, IO[bytes]], **kwargs: Any + 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. @@ -13005,9 +13010,9 @@ def create_async( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Model version to create. Is one of the following types: ModelVersion, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] + :param model_version: Model version to create. Is one of the following types: ModelVersion, + JSON, IO[bytes] Required. + :type model_version: ~azure.ai.projects.models.ModelVersion or JSON or IO[bytes] :return: CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.CreateAsyncResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -13028,12 +13033,12 @@ def create_async( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(model_version, (IOBase, bytes)): + _content = model_version else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(model_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_beta_models_create_async_request( + _request = build_beta_models_pending_create_version_request( name=name, version=version, content_type=content_type, @@ -13082,7 +13087,7 @@ def pending_upload( self, name: str, version: str, - body: _models.ModelPendingUploadRequest, + pending_upload_request: _models.ModelPendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13093,8 +13098,8 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: ~azure.ai.projects.models.ModelPendingUploadRequest + :param pending_upload_request: Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13106,7 +13111,13 @@ def pending_upload( @overload def pending_upload( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -13114,8 +13125,8 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: JSON + :param pending_upload_request: Required. + :type pending_upload_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13127,7 +13138,13 @@ def pending_upload( @overload def pending_upload( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -13135,8 +13152,8 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: IO[bytes] + :param pending_upload_request: Required. + :type pending_upload_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 @@ -13148,7 +13165,11 @@ def pending_upload( @distributed_trace def pending_upload( - self, name: str, version: str, body: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + pending_upload_request: Union[_models.ModelPendingUploadRequest, JSON, IO[bytes]], + **kwargs: Any ) -> _models.ModelPendingUploadResponse: """Start or retrieve a pending upload for a model version. @@ -13156,9 +13177,10 @@ def pending_upload( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Is one of the following types: ModelPendingUploadRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or IO[bytes] + :param pending_upload_request: Is one of the following types: ModelPendingUploadRequest, JSON, + IO[bytes] Required. + :type pending_upload_request: ~azure.ai.projects.models.ModelPendingUploadRequest or JSON or + IO[bytes] :return: ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ModelPendingUploadResponse @@ -13180,10 +13202,10 @@ def pending_upload( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_models_pending_upload_request( name=name, @@ -13231,7 +13253,7 @@ def get_credentials( self, name: str, version: str, - body: _models.ModelCredentialRequest, + credential_request: _models.ModelCredentialRequest, *, content_type: str = "application/json", **kwargs: Any @@ -13242,8 +13264,8 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: ~azure.ai.projects.models.ModelCredentialRequest + :param credential_request: Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13254,7 +13276,13 @@ def get_credentials( @overload def get_credentials( - self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + credential_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -13262,8 +13290,8 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: JSON + :param credential_request: Required. + :type credential_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -13274,7 +13302,13 @@ def get_credentials( @overload def get_credentials( - self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + version: str, + credential_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -13282,8 +13316,8 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Required. - :type body: IO[bytes] + :param credential_request: Required. + :type credential_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 @@ -13294,7 +13328,11 @@ def get_credentials( @distributed_trace def get_credentials( - self, name: str, version: str, body: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + version: str, + credential_request: Union[_models.ModelCredentialRequest, JSON, IO[bytes]], + **kwargs: Any ) -> _models.DatasetCredential: """Get credentials for a model version asset. @@ -13302,8 +13340,9 @@ def get_credentials( :type name: str :param version: Version of the model. Required. :type version: str - :param body: Is one of the following types: ModelCredentialRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] + :param credential_request: Is one of the following types: ModelCredentialRequest, JSON, + IO[bytes] Required. + :type credential_request: ~azure.ai.projects.models.ModelCredentialRequest or JSON or IO[bytes] :return: DatasetCredential. The DatasetCredential is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DatasetCredential :raises ~azure.core.exceptions.HttpResponseError: @@ -13324,10 +13363,10 @@ def get_credentials( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(credential_request, (IOBase, bytes)): + _content = credential_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(credential_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_beta_models_get_credentials_request( name=name, @@ -14283,14 +14322,14 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @overload - def dispatch_async( + def dispatch( self, routine_name: str, *, content_type: str = "application/json", payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -14301,15 +14340,15 @@ def dispatch_async( :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def dispatch_async( + def dispatch( self, routine_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -14319,15 +14358,15 @@ def dispatch_async( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def dispatch_async( + def dispatch( self, routine_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -14337,20 +14376,20 @@ def dispatch_async( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def dispatch_async( + def dispatch( self, routine_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, payload: Optional[_models.RoutineDispatchPayload] = None, **kwargs: Any - ) -> _models.DispatchRoutineResponse: + ) -> _models.DispatchRoutineResult: """Queue an asynchronous routine dispatch. :param routine_name: The unique name of the routine. Required. @@ -14360,8 +14399,8 @@ def dispatch_async( :keyword payload: A direct action-input override sent downstream when testing a routine. Default value is None. :paramtype payload: ~azure.ai.projects.models.RoutineDispatchPayload - :return: DispatchRoutineResponse. The DispatchRoutineResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DispatchRoutineResponse + :return: DispatchRoutineResult. The DispatchRoutineResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DispatchRoutineResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14376,7 +14415,7 @@ def dispatch_async( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DispatchRoutineResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.DispatchRoutineResult] = kwargs.pop("cls", None) if body is _Unset: body = {"payload": payload} @@ -14388,7 +14427,7 @@ def dispatch_async( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_beta_routines_dispatch_async_request( + _request = build_beta_routines_dispatch_request( routine_name=routine_name, content_type=content_type, api_version=self._config.api_version, @@ -14425,7 +14464,7 @@ def dispatch_async( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DispatchRoutineResponse, response.json()) + deserialized = _deserialize(_models.DispatchRoutineResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py index b79e64ba0781..a2f129f1dae1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_agents.py @@ -21,6 +21,7 @@ _PREVIEW_FEATURE_ADDED_ERROR_MESSAGE, ) + class AgentsOperations(GeneratedAgentsOperations): """ .. warning:: @@ -68,7 +69,7 @@ def create_version( :keyword description: A human-readable description of the agent. Default value is None. :paramtype description: str :keyword blueprint_reference: The blueprint reference for the agent. Default value is None. - :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference + :paramtype blueprint_reference: ~azure.ai.projects.models.AgentBlueprintReference :return: AgentVersionDetails. The AgentVersionDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.AgentVersionDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -186,7 +187,7 @@ def create_version( ) except HttpResponseError as exc: """ - Example service response payload when the caller is trying to use a feature preview without opt-in flag (service error 403 (Forbidden)): + Example service response payload when the caller is trying to use a feature preview without opt-in flag (service error 403 (Forbidden)): "error": { "code": "preview_feature_required", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py index e8c13ff64627..bf2c0db51271 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_patch_datasets.py @@ -21,7 +21,7 @@ FileDatasetVersion, FolderDatasetVersion, PendingUploadRequest, - PendingUploadResult, + PendingUploadResponse, PendingUploadType, ) @@ -47,7 +47,7 @@ def _create_dataset_and_get_its_container_client( connection_name: Optional[str] = None, ) -> Tuple[ContainerClient, str]: - pending_upload_response: PendingUploadResult = self.pending_upload( + pending_upload_response: PendingUploadResponse = self.pending_upload( name=name, version=input_version, pending_upload_request=PendingUploadRequest( diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py index 1db86d1dee18..cdd4a3396125 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py @@ -114,7 +114,7 @@ version_zip_path = Path(tempfile.gettempdir()) / f"{agent_name}-{created.version}.zip" sha = hashlib.sha256() with open(version_zip_path, "wb") as f: - for chunk in project_client.beta.agents.download_agent_code( + for chunk in project_client.beta.agents.download_code( agent_name=agent_name, agent_version=created.version, ): diff --git a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py index 630bb7925a08..cd05ad4b472e 100644 --- a/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py +++ b/sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py @@ -119,7 +119,7 @@ async def main() -> None: # Download the zip for the version we just created, streaming to a temp file. version_zip_path = Path(tempfile.gettempdir()) / f"{agent_name}-{created.version}.zip" sha = hashlib.sha256() - version_stream = await project_client.beta.agents.download_agent_code( + version_stream = await project_client.beta.agents.download_code( agent_name=agent_name, agent_version=created.version, ) diff --git a/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py b/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py index af98d794a98d..0e0f776441cf 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py +++ b/sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py @@ -18,7 +18,8 @@ from typing import Final -agent_tools_instructions: Final[str] = """ +agent_tools_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a tool-driven assistant workflow. @@ -43,9 +44,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -memories_instructions: Final[str] = """ +memories_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a memories workflow. @@ -70,9 +73,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -agents_instructions: Final[str] = """ +agents_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct. @@ -103,9 +108,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -chat_completions_instructions: Final[str] = """ +chat_completions_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for Chat Completions scenarios. @@ -124,9 +131,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -resource_management_instructions: Final[str] = """ +resource_management_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for resource-management samples (for example connections, files, and deployments). @@ -152,9 +161,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -fine_tuning_instructions: Final[str] = """ +fine_tuning_instructions: Final[str] = ( + """ We just ran Python code and captured print/log output in an attached log file (TXT). Validate whether sample execution/output is correct for a fine-tuning workflow. @@ -178,9 +189,11 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) -evaluations_instructions: Final[str] = """ +evaluations_instructions: Final[str] = ( + """ We just ran Python code for an evaluation sample and captured print/log output in an attached log file (TXT). Your job: determine if the sample code executed to completion WITHOUT throwing an unhandled exception. @@ -202,9 +215,11 @@ Always respond with `reason` indicating the reason for the response. """.strip() +) -hosted_agents_instructions: Final[str] = """ +hosted_agents_instructions: Final[str] = ( + """ We just ran Python code for a hosted-agent sample and captured print/log output in an attached log file (TXT). Validate whether the sample executed correctly. @@ -226,6 +241,7 @@ Always include `reason` with a concise explanation tied to the observed print output. """.strip() +) # Folder (under samples/) -> instructions. diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 18c876d87f07..1d28b6a52b56 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: 18ccc2a0bfd5cccccf78608f9faaa88185c66f5a +commit: 53fbe53ff36e1d41dc9d12dbfd949182b07a88bf repo: Azure/azure-rest-api-specs additionalDirectories: