Skip to content

Commit 21f5fd9

Browse files
author
SDKAuto
committed
CodeGen from PR 33130 in Azure/azure-rest-api-specs
Merge dd26409dd0f4c4ba67e05ccb9e0cfcb3ec855e2f into ded12658bca7c9ef9eacd926088225e80ef6cad5
1 parent c33e4f7 commit 21f5fd9

39 files changed

+26363
-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/projects/1dp/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/projects/__init__.py
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
3+
# Azure Ai Projects 1dp client library for Python
4+
<!-- write necessary description of service -->
5+
6+
## Getting started
7+
8+
### Install the package
9+
10+
```bash
11+
python -m pip install azure-ai-projects-1dp
12+
```
13+
14+
#### Prequisites
15+
16+
- Python 3.8 or later is required to use this package.
17+
- You need an [Azure subscription][azure_sub] to use this package.
18+
- An existing Azure Ai Projects 1dp instance.
19+
#### Create with an Azure Active Directory Credential
20+
To use an [Azure Active Directory (AAD) token credential][authenticate_with_token],
21+
provide an instance of the desired credential type obtained from the
22+
[azure-identity][azure_identity_credentials] library.
23+
24+
To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip]
25+
26+
After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use.
27+
As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client:
28+
29+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
30+
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`
31+
32+
Use the returned token credential to authenticate the client:
33+
34+
```python
35+
>>> from azure.ai.projects.1dp import AIProjectClient
36+
>>> from azure.identity import DefaultAzureCredential
37+
>>> client = AIProjectClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
38+
```
39+
40+
## Examples
41+
42+
```python
43+
>>> from azure.ai.projects.1dp import AIProjectClient
44+
>>> from azure.identity import DefaultAzureCredential
45+
>>> from azure.core.exceptions import HttpResponseError
46+
47+
>>> client = AIProjectClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
48+
>>> try:
49+
<!-- write test code here -->
50+
except HttpResponseError as e:
51+
print('service responds error: {}'.format(e.response.json()))
52+
53+
```
54+
55+
## Contributing
56+
57+
This project welcomes contributions and suggestions. Most contributions require
58+
you to agree to a Contributor License Agreement (CLA) declaring that you have
59+
the right to, and actually do, grant us the rights to use your contribution.
60+
For details, visit https://cla.microsoft.com.
61+
62+
When you submit a pull request, a CLA-bot will automatically determine whether
63+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
64+
comment). Simply follow the instructions provided by the bot. You will only
65+
need to do this once across all repos using our CLA.
66+
67+
This project has adopted the
68+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
69+
see the Code of Conduct FAQ or contact [email protected] with any
70+
additional questions or comments.
71+
72+
<!-- LINKS -->
73+
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
74+
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
75+
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
76+
[azure_identity_pip]: https://pypi.org/project/azure-identity/
77+
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
78+
[pip]: https://pypi.org/project/pip/
79+
[azure_sub]: https://azure.microsoft.com/free/
80+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "1199fc5a12ad985261086332a445de52e33ea1d2",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/ai/Azure.AI.Projects",
5+
"@azure-tools/typespec-python": "0.39.1"
6+
}

0 commit comments

Comments
 (0)