Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-ai-face] Migrate existing Azure AI Face service to TypeSpec #5858

Closed
wants to merge 1 commit into from

Conversation

azure-sdk
Copy link
Owner

Create to sync Azure/azure-rest-api-specs#27576

You can install the use using pip install of the artifacts.

@azure-sdk azure-sdk force-pushed the sdkAuto/27576/azure-ai-face branch 3 times, most recently from 6ab969b to 8ea1efd Compare February 5, 2024 09:41
@azure-sdk azure-sdk force-pushed the sdkAuto/27576/azure-ai-face branch 6 times, most recently from b02da2a to fd4f2ea Compare February 21, 2024 08:26
@azure-sdk azure-sdk changed the title [AutoPR azure-ai-face] Azure AI Face TypeSpec [AutoPR azure-ai-face] Migrate existing Azure AI Face service to TypeSpec Feb 22, 2024
@azure-sdk azure-sdk force-pushed the sdkAuto/27576/azure-ai-face branch 2 times, most recently from 65642b5 to 626cf0d Compare February 29, 2024 04:12
Merge f25d933a13e5f2b428f8179be8e72468f97bbac4 into 7d111b106a71ca148eda71d1f70b7929c1ef164a
async def add_face_from_stream(
self,
face_list_id: str,
image_content: bytes,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a stream - we should support IO[bytes]

self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@overload
async def create_list( # pylint: disable=inconsistent-return-statements

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These method names shouldn't duplicate the noun - i.e. we should use something like:
client.face_lists.get/create/update/delete
Instead of:
client.face_lists.get_list/create_list/update_list/delete_list

self.person_directory_persons = PersonDirectoryPersonsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.person_directory_dynamic_person_groups = PersonDirectoryDynamicPersonGroupsOperations(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will need to work on these operation group names.

self._serialize.client_side_validation = False
self.face_lists = FaceListsOperations(self._client, self._config, self._serialize, self._deserialize)
self.large_face_lists = LargeFaceListsOperations(self._client, self._config, self._serialize, self._deserialize)
self.face_async_operations = FaceAsyncOperationsOperations(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid the term "async" in the operation group name.

return cls(pipeline_response, None, {}) # type: ignore

@distributed_trace_async
async def list_face(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we need to add a noun to a listing operation - it should be plural: list_faces

async def list_face(
self, person_id: str, recognition_model: Union[str, _models.RecognitionModel], **kwargs: Any
) -> _models.ListFaceResult:
"""Operation that lists resources in a paginated way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These operations seem to be missing docstrings

:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The identify methods don't need the suffix for clarification, as that's implied by their grouping. I would probably just call them all idenfity_faces or something similar.

return deserialized # type: ignore


class PersonDirectoryDynamicPersonGroupsOperations: # pylint: disable=name-too-long

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be just "DynamicPersonGroupOperations"

:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This takes the same payload and returns the same response as the create_session method above.
Are we able to merge these two "session" operation groups?

:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should support IO[bytes]

async def add_face_from_url(
self,
face_list_id: str,
body: _models.AddFaceFromUrlContent,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this simply be a url str?

@azure-sdk azure-sdk force-pushed the main branch 3 times, most recently from 6680ffc to 5652869 Compare April 3, 2024 03:33
@azure-sdk azure-sdk closed this May 5, 2024
@azure-sdk azure-sdk deleted the sdkAuto/27576/azure-ai-face branch May 5, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants