Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updating evaluation object to have name field instead of id
  • Loading branch information
singankit committed Apr 28, 2025
commit e40cadc2edbfe20e4e819a596056925e025aa4b0
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,7 @@ def list(
*,
model_publisher: Optional[str] = None,
model_name: Optional[str] = None,
deployment_type: Optional[Union[str, _models.DeploymentType]] = None,
top: Optional[int] = None,
skip: Optional[int] = None,
**kwargs: Any
Expand All @@ -2066,6 +2067,9 @@ def list(
:keyword model_name: Model name (the publisher specific name) to filter models by. Default
value is None.
:paramtype model_name: str
:keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value
is None.
:paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType
:keyword top: The number of result items to return. Default value is None.
:paramtype top: int
:keyword skip: The number of result items to skip. Default value is None.
Expand Down Expand Up @@ -2094,6 +2098,7 @@ def prepare_request(next_link=None):
_request = build_deployments_list_request(
model_publisher=model_publisher,
model_name=model_name,
deployment_type=deployment_type,
top=top,
skip=skip,
maxpagesize=maxpagesize,
Expand Down
24 changes: 15 additions & 9 deletions sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ class BlobReferenceForConsumption(_Model):
"""Represents a reference to a blob for consumption.

:ivar blob_uri: Blob URI path for client to upload data. Example:
``https://blob.windows.core.net/Container/Path``. Required.
`https://blob.windows.core.net/Container/Path <https://blob.windows.core.net/Container/Path>`_.
Required.
:vartype blob_uri: str
:ivar storage_account_arm_id: ARM ID of the storage account to use. Required.
:vartype storage_account_arm_id: str
Expand All @@ -566,7 +567,8 @@ class BlobReferenceForConsumption(_Model):
"""

blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"])
"""Blob URI path for client to upload data. Example: ``https://blob.windows.core.net/Container/Path``. Required."""
"""Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path
<https://blob.windows.core.net/Container/Path>`_. Required."""
storage_account_arm_id: str = rest_field(
name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"]
)
Expand Down Expand Up @@ -731,7 +733,8 @@ class DatasetVersion(_Model):
FileDatasetVersion, FolderDatasetVersion

:ivar dataset_uri: [Required] Uri of the data. Example:
``https://go.microsoft.com/fwlink/?linkid=2202330``. Required.
`https://go.microsoft.com/fwlink/?linkid=2202330
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
:vartype dataset_uri: str
:ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder".
:vartype type: str or ~azure.ai.projects.models.DatasetType
Expand All @@ -754,7 +757,8 @@ class DatasetVersion(_Model):

__mapping__: Dict[str, _Model] = {}
dataset_uri: str = rest_field(name="datasetUri", visibility=["read", "create"])
"""[Required] Uri of the data. Example: ``https://go.microsoft.com/fwlink/?linkid=2202330``. Required."""
"""[Required] Uri of the data. Example: `https://go.microsoft.com/fwlink/?linkid=2202330
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required."""
type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
"""Dataset type. Required. Known values are: \"uri_file\" and \"uri_folder\"."""
is_reference: Optional[bool] = rest_field(name="isReference", visibility=["read"])
Expand Down Expand Up @@ -895,8 +899,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
class Evaluation(_Model):
"""Evaluation Definition.

:ivar id: Identifier of the evaluation. Required.
:vartype id: str
:ivar name: Identifier of the evaluation. Required.
:vartype name: str
:ivar data: Data for evaluation. Required.
:vartype data: ~azure.ai.projects.models.InputData
:ivar display_name: Display Name for evaluation. It helps to find the evaluation easily in AI
Expand All @@ -916,7 +920,7 @@ class Evaluation(_Model):
:vartype evaluators: dict[str, ~azure.ai.projects.models.EvaluatorConfiguration]
"""

id: str = rest_field(visibility=["read"])
name: str = rest_field(name="id", visibility=["read"])
"""Identifier of the evaluation. Required."""
data: "_models.InputData" = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Data for evaluation. Required."""
Expand Down Expand Up @@ -1009,7 +1013,8 @@ class FileDatasetVersion(DatasetVersion, discriminator="uri_file"):
"""FileDatasetVersion Definition.

:ivar dataset_uri: [Required] Uri of the data. Example:
``https://go.microsoft.com/fwlink/?linkid=2202330``. Required.
`https://go.microsoft.com/fwlink/?linkid=2202330
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
:vartype dataset_uri: str
:ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If
true, the underlying data will be deleted when the dataset version is deleted.
Expand Down Expand Up @@ -1065,7 +1070,8 @@ class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"):
"""FileDatasetVersion Definition.

:ivar dataset_uri: [Required] Uri of the data. Example:
``https://go.microsoft.com/fwlink/?linkid=2202330``. Required.
`https://go.microsoft.com/fwlink/?linkid=2202330
<https://go.microsoft.com/fwlink/?linkid=2202330>`_. Required.
:vartype dataset_uri: str
:ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If
true, the underlying data will be deleted when the dataset version is deleted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ def build_deployments_list_request(
*,
model_publisher: Optional[str] = None,
model_name: Optional[str] = None,
deployment_type: Optional[Union[str, _models.DeploymentType]] = None,
top: Optional[int] = None,
skip: Optional[int] = None,
maxpagesize: Optional[int] = None,
Expand All @@ -638,6 +639,8 @@ def build_deployments_list_request(
_params["modelPublisher"] = _SERIALIZER.query("model_publisher", model_publisher, "str")
if model_name is not None:
_params["modelName"] = _SERIALIZER.query("model_name", model_name, "str")
if deployment_type is not None:
_params["deploymentType"] = _SERIALIZER.query("deployment_type", deployment_type, "str")
if top is not None:
_params["top"] = _SERIALIZER.query("top", top, "int")
if skip is not None:
Expand Down Expand Up @@ -2712,6 +2715,7 @@ def list(
*,
model_publisher: Optional[str] = None,
model_name: Optional[str] = None,
deployment_type: Optional[Union[str, _models.DeploymentType]] = None,
top: Optional[int] = None,
skip: Optional[int] = None,
**kwargs: Any
Expand All @@ -2723,6 +2727,9 @@ def list(
:keyword model_name: Model name (the publisher specific name) to filter models by. Default
value is None.
:paramtype model_name: str
:keyword deployment_type: Type of deployment to filter list by. "ModelDeployment" Default value
is None.
:paramtype deployment_type: str or ~azure.ai.projects.models.DeploymentType
:keyword top: The number of result items to return. Default value is None.
:paramtype top: int
:keyword skip: The number of result items to skip. Default value is None.
Expand Down Expand Up @@ -2751,6 +2758,7 @@ def prepare_request(next_link=None):
_request = build_deployments_list_request(
model_publisher=model_publisher,
model_name=model_name,
deployment_type=deployment_type,
top=top,
skip=skip,
maxpagesize=maxpagesize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@
evaluation: Evaluation = Evaluation(
display_name="Sample Evaluation",
description="Sample evaluation for testing", # TODO: Can we optional once bug 4115256 is fixed
data=InputDataset(id="<dataset_id>"), # TODO: update this to use the correct id
data=InputDataset(id="<>"), # TODO: update this to use the correct id
evaluators={
"relevance": EvaluatorConfiguration(
id=EvaluatorIds.RELEVANCE.value, # TODO: update this to use the correct id
id=EvaluatorIds.RELEVANCE.value,
init_params={
"deployment_name": "gpt-4o",
"deployment_name": "gpt-4o-mini",
},
data_mapping={
"query": "${data.query}",
"response": "${data.response}",
}
),
},
)
Expand All @@ -76,7 +80,7 @@
print(evaluation_response)

print("Get evaluation")
get_evaluation_response: Evaluation = project_client.evaluations.get(evaluation_response.id)
get_evaluation_response: Evaluation = project_client.evaluations.get(evaluation_response.name)

print(get_evaluation_response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def sample_evaluations_async() -> None:
print(evaluation_response)

print("Get evaluation")
get_evaluation_response: Evaluation = await project_client.evaluations.get(evaluation_response.id)
get_evaluation_response: Evaluation = await project_client.evaluations.get(evaluation_response.name)

print(get_evaluation_response)

Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/tsp-location.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
directory: specification/ai/Azure.AI.Projects
commit: 0f04d880fe17e0da290f836f62dcb033e73faec4
commit: 8a44a2e4400999bcdf42c7e63a3e4cd378115cf9
repo: Azure/azure-rest-api-specs
additionalDirectories:
Loading