Skip to content

Commit 7097f80

Browse files
authored
Updates to new 1DP Python Projects SDK
1 parent 2fce349 commit 7097f80

File tree

12 files changed

+766
-35
lines changed

12 files changed

+766
-35
lines changed

sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_patch.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,53 @@
66
77
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
88
"""
9-
from typing import List
9+
from typing import List, Any, Union, Optional
10+
from azure.core.credentials import AzureKeyCredential
11+
from ._client import AIProjectClient as AIProjectClientGenerated
12+
from .operations import TelemetryOperations, InferenceOperations
1013

11-
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
14+
class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-instance-attributes
15+
"""AIProjectClient.
16+
17+
:ivar service_patterns: ServicePatternsOperations operations
18+
:vartype service_patterns: azure.ai.projects.onedp.operations.ServicePatternsOperations
19+
:ivar connections: ConnectionsOperations operations
20+
:vartype connections: azure.ai.projects.onedp.operations.ConnectionsOperations
21+
:ivar evaluations: EvaluationsOperations operations
22+
:vartype evaluations: azure.ai.projects.onedp.operations.EvaluationsOperations
23+
:ivar datasets: DatasetsOperations operations
24+
:vartype datasets: azure.ai.projects.onedp.operations.DatasetsOperations
25+
:ivar indexes: IndexesOperations operations
26+
:vartype indexes: azure.ai.projects.onedp.operations.IndexesOperations
27+
:ivar deployments: DeploymentsOperations operations
28+
:vartype deployments: azure.ai.projects.onedp.operations.DeploymentsOperations
29+
:ivar evaluation_results: EvaluationResultsOperations operations
30+
:vartype evaluation_results: azure.ai.projects.onedp.operations.EvaluationResultsOperations
31+
:ivar red_teams: RedTeamsOperations operations
32+
:vartype red_teams: azure.ai.projects.onedp.operations.RedTeamsOperations
33+
:param endpoint: Project endpoint in the form of:
34+
https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. Required.
35+
:type endpoint: str
36+
:param credential: Credential used to authenticate requests to the service. Is either a key
37+
credential type or a token credential type. Required.
38+
:type credential: ~azure.core.credentials.AzureKeyCredential or
39+
~azure.core.credentials.TokenCredential
40+
:keyword api_version: The API version to use for this operation. Default value is
41+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
42+
behavior.
43+
:paramtype api_version: str
44+
"""
45+
46+
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
47+
self._user_agent: Optional[str] = kwargs.get("user_agent", None)
48+
super().__init__(endpoint=endpoint, credential=credential, **kwargs)
49+
self.telemetry = TelemetryOperations(self)
50+
self.inference = InferenceOperations(self)
51+
52+
53+
__all__: List[str] = [
54+
"AIProjectClient"
55+
] # Add all objects you want publicly available to users at this package level
1256

1357

1458
def patch_sdk():

sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_patch.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,54 @@
66
77
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
88
"""
9-
from typing import List
9+
from typing import List, Optional, Union, Any
10+
from azure.core.credentials import AzureKeyCredential
11+
from ._client import AIProjectClient as AIProjectClientGenerated
12+
from .operations import InferenceOperations
1013

11-
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
14+
class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-instance-attributes
15+
"""AIProjectClient.
16+
17+
:ivar service_patterns: ServicePatternsOperations operations
18+
:vartype service_patterns: azure.ai.projects.onedp.aio.operations.ServicePatternsOperations
19+
:ivar connections: ConnectionsOperations operations
20+
:vartype connections: azure.ai.projects.onedp.aio.operations.ConnectionsOperations
21+
:ivar evaluations: EvaluationsOperations operations
22+
:vartype evaluations: azure.ai.projects.onedp.aio.operations.EvaluationsOperations
23+
:ivar datasets: DatasetsOperations operations
24+
:vartype datasets: azure.ai.projects.onedp.aio.operations.DatasetsOperations
25+
:ivar indexes: IndexesOperations operations
26+
:vartype indexes: azure.ai.projects.onedp.aio.operations.IndexesOperations
27+
:ivar deployments: DeploymentsOperations operations
28+
:vartype deployments: azure.ai.projects.onedp.aio.operations.DeploymentsOperations
29+
:ivar evaluation_results: EvaluationResultsOperations operations
30+
:vartype evaluation_results: azure.ai.projects.onedp.aio.operations.EvaluationResultsOperations
31+
:ivar red_teams: RedTeamsOperations operations
32+
:vartype red_teams: azure.ai.projects.onedp.aio.operations.RedTeamsOperations
33+
:param endpoint: Project endpoint in the form of:
34+
https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. Required.
35+
:type endpoint: str
36+
:param credential: Credential used to authenticate requests to the service. Is either a key
37+
credential type or a token credential type. Required.
38+
:type credential: ~azure.core.credentials.AzureKeyCredential or
39+
~azure.core.credentials_async.AsyncTokenCredential
40+
:keyword api_version: The API version to use for this operation. Default value is
41+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
42+
behavior.
43+
:paramtype api_version: str
44+
"""
45+
46+
def __init__(
47+
self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any
48+
) -> None:
49+
self._user_agent: Optional[str] = kwargs.get("user_agent", None)
50+
super().__init__(endpoint=endpoint, credential=credential, **kwargs)
51+
self.inference = InferenceOperations(self)
52+
53+
54+
__all__: List[str] = [
55+
"AIProjectClient"
56+
] # Add all objects you want publicly available to users at this package level
1257

1358

1459
def patch_sdk():

0 commit comments

Comments
 (0)