Skip to content

Commit 934a29e

Browse files
author
SDKAuto
committed
CodeGen from PR 34631 in Azure/azure-rest-api-specs
Merge 5afe59a92e729a1560e9a3d44cede1709b858b34 into c269b7b78cac2808d7acc55124a9653b2e904e4b
1 parent 0346175 commit 934a29e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+8451
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (1970-01-01)
4+
5+
- Initial version
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include *.md
2+
include LICENSE
3+
include azure/ai/resources/autogen/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/ai/__init__.py
8+
include azure/ai/resources/__init__.py
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Azure Ai Resources Autogen client library for Python
2+
<!-- write necessary description of service -->
3+
4+
## Getting started
5+
6+
### Install the package
7+
8+
```bash
9+
python -m pip install azure-ai-resources-autogen
10+
```
11+
12+
#### Prequisites
13+
14+
- Python 3.9 or later is required to use this package.
15+
- You need an [Azure subscription][azure_sub] to use this package.
16+
- An existing Azure Ai Resources Autogen instance.
17+
18+
#### Create with an Azure Active Directory Credential
19+
To use an [Azure Active Directory (AAD) token credential][authenticate_with_token],
20+
provide an instance of the desired credential type obtained from the
21+
[azure-identity][azure_identity_credentials] library.
22+
23+
To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip]
24+
25+
After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use.
26+
As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client:
27+
28+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
29+
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`
30+
31+
Use the returned token credential to authenticate the client:
32+
33+
```python
34+
>>> from azure.ai.resources.autogen import MachineLearningServicesClient
35+
>>> from azure.identity import DefaultAzureCredential
36+
>>> client = MachineLearningServicesClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
37+
```
38+
39+
## Examples
40+
41+
```python
42+
>>> from azure.ai.resources.autogen import MachineLearningServicesClient
43+
>>> from azure.identity import DefaultAzureCredential
44+
>>> from azure.core.exceptions import HttpResponseError
45+
46+
>>> client = MachineLearningServicesClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
47+
>>> try:
48+
<!-- write test code here -->
49+
except HttpResponseError as e:
50+
print('service responds error: {}'.format(e.response.json()))
51+
52+
```
53+
54+
## Contributing
55+
56+
This project welcomes contributions and suggestions. Most contributions require
57+
you to agree to a Contributor License Agreement (CLA) declaring that you have
58+
the right to, and actually do, grant us the rights to use your contribution.
59+
For details, visit https://cla.microsoft.com.
60+
61+
When you submit a pull request, a CLA-bot will automatically determine whether
62+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
63+
comment). Simply follow the instructions provided by the bot. You will only
64+
need to do this once across all repos using our CLA.
65+
66+
This project has adopted the
67+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
68+
see the Code of Conduct FAQ or contact [email protected] with any
69+
additional questions or comments.
70+
71+
<!-- LINKS -->
72+
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
73+
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
74+
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
75+
[azure_identity_pip]: https://pypi.org/project/azure-identity/
76+
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
77+
[pip]: https://pypi.org/project/pip/
78+
[azure_sub]: https://azure.microsoft.com/free/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "c537a4e6cc3ed95c030b2c10671d1f0585ddcc08",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/machinelearningservices/AzureAI.Assets",
5+
"@azure-tools/typespec-python": "0.44.2"
6+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.MachineLearningServices",
3+
"CrossLanguageDefinitionId": {
4+
"azure.ai.resources.autogen.models.Index": "Microsoft.MachineLearningServices.Index",
5+
"azure.ai.resources.autogen.models.Prompt": "Microsoft.MachineLearningServices.Prompt",
6+
"azure.ai.resources.autogen.models.SystemData": "Microsoft.MachineLearningServices.SystemData",
7+
"azure.ai.resources.autogen.models.VersionInfo": "Microsoft.MachineLearningServices.VersionInfo",
8+
"azure.ai.resources.autogen.operations.IndexesOperations.get": "Microsoft.MachineLearningServices.Indexes.get",
9+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.get": "Microsoft.MachineLearningServices.Indexes.get",
10+
"azure.ai.resources.autogen.operations.IndexesOperations.create_or_update": "Microsoft.MachineLearningServices.Indexes.createOrUpdate",
11+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.create_or_update": "Microsoft.MachineLearningServices.Indexes.createOrUpdate",
12+
"azure.ai.resources.autogen.operations.IndexesOperations.list": "Microsoft.MachineLearningServices.Indexes.list",
13+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.list": "Microsoft.MachineLearningServices.Indexes.list",
14+
"azure.ai.resources.autogen.operations.IndexesOperations.get_latest": "Microsoft.MachineLearningServices.Indexes.getLatest",
15+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.get_latest": "Microsoft.MachineLearningServices.Indexes.getLatest",
16+
"azure.ai.resources.autogen.operations.IndexesOperations.get_next_version": "Microsoft.MachineLearningServices.Indexes.getNextVersion",
17+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.get_next_version": "Microsoft.MachineLearningServices.Indexes.getNextVersion",
18+
"azure.ai.resources.autogen.operations.IndexesOperations.list_latest": "Microsoft.MachineLearningServices.Indexes.listLatest",
19+
"azure.ai.resources.autogen.aio.operations.IndexesOperations.list_latest": "Microsoft.MachineLearningServices.Indexes.listLatest",
20+
"azure.ai.resources.autogen.operations.PromptsOperations.get": "Microsoft.MachineLearningServices.Prompts.get",
21+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.get": "Microsoft.MachineLearningServices.Prompts.get",
22+
"azure.ai.resources.autogen.operations.PromptsOperations.create_or_update": "Microsoft.MachineLearningServices.Prompts.createOrUpdate",
23+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.create_or_update": "Microsoft.MachineLearningServices.Prompts.createOrUpdate",
24+
"azure.ai.resources.autogen.operations.PromptsOperations.list": "Microsoft.MachineLearningServices.Prompts.list",
25+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.list": "Microsoft.MachineLearningServices.Prompts.list",
26+
"azure.ai.resources.autogen.operations.PromptsOperations.get_latest": "Microsoft.MachineLearningServices.Prompts.getLatest",
27+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.get_latest": "Microsoft.MachineLearningServices.Prompts.getLatest",
28+
"azure.ai.resources.autogen.operations.PromptsOperations.get_next_version": "Microsoft.MachineLearningServices.Prompts.getNextVersion",
29+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.get_next_version": "Microsoft.MachineLearningServices.Prompts.getNextVersion",
30+
"azure.ai.resources.autogen.operations.PromptsOperations.list_latest": "Microsoft.MachineLearningServices.Prompts.listLatest",
31+
"azure.ai.resources.autogen.aio.operations.PromptsOperations.list_latest": "Microsoft.MachineLearningServices.Prompts.listLatest"
32+
}
33+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import MachineLearningServicesClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"MachineLearningServicesClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()

0 commit comments

Comments
 (0)