Skip to content

Commit 1010508

Browse files
authored
Auto retrieve AI resource name (Azure#32999)
1 parent bb072e6 commit 1010508

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sdk/ai/azure-ai-resources/azure/ai/resources/client/_ai_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def __init__(
9292
workspace_name=project_name,
9393
**kwargs,
9494
)
95+
96+
if project_name:
97+
ai_resource_name = ai_resource_name or self._ml_client.workspaces.get(project_name).workspace_hub.split("/")[-1]
98+
9599
# Client scoped to the AI Resource for operations that need AI resource-scoping
96100
# instead of project scoping.
97101
self._ai_resource_ml_client = MLClient(

0 commit comments

Comments
 (0)