Skip to content

Commit 9272f01

Browse files
authored
Method updates following another api review meeting (#47757)
1 parent 0f34c1b commit 9272f01

23 files changed

Lines changed: 671 additions & 1766 deletions

sdk/ai/azure-ai-projects/api.md

Lines changed: 32 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,16 @@ namespace azure.ai.projects.aio.operations
153153
**kwargs: Any
154154
) -> AgentVersionDetails: ...
155155

156-
@overload
157-
async def create_version_from_code(
158-
self,
159-
agent_name: str,
160-
content: CreateAgentVersionFromCodeContent,
161-
*,
162-
code_zip_sha256: str,
163-
**kwargs: Any
164-
) -> AgentVersionDetails: ...
165-
166-
@overload
156+
@distributed_trace_async
167157
async def create_version_from_code(
168158
self,
169159
agent_name: str,
170-
content: JSON,
171160
*,
172-
code_zip_sha256: str,
161+
code: IO[bytes],
162+
code_zip_sha256: Optional[str] = ...,
163+
definition: HostedAgentDefinition,
164+
description: Optional[str] = ...,
165+
metadata: Optional[dict[str, str]] = ...,
173166
**kwargs: Any
174167
) -> AgentVersionDetails: ...
175168

@@ -227,10 +220,10 @@ namespace azure.ai.projects.aio.operations
227220
async def delete_session_file(
228221
self,
229222
agent_name: str,
230-
agent_session_id: str,
223+
session_id: str,
231224
*,
225+
path: str,
232226
recursive: Optional[bool] = ...,
233-
remote_path: str,
234227
**kwargs: Any
235228
) -> None: ...
236229

@@ -252,7 +245,7 @@ namespace azure.ai.projects.aio.operations
252245
) -> None: ...
253246

254247
@distributed_trace_async
255-
async def download_code_as_bytes(
248+
async def download_code(
256249
self,
257250
agent_name: str,
258251
*,
@@ -261,37 +254,14 @@ namespace azure.ai.projects.aio.operations
261254
) -> AsyncIterator[bytes]: ...
262255

263256
@distributed_trace_async
264-
async def download_code_to_path(
265-
self,
266-
agent_name: str,
267-
*,
268-
agent_version: Optional[str] = ...,
269-
file_path: Union[str, PathLike[str]],
270-
overwrite: bool = False,
271-
**kwargs: Any
272-
) -> str: ...
273-
274-
@distributed_trace_async
275-
async def download_session_file_as_bytes(
276-
self,
277-
agent_name: str,
278-
agent_session_id: str,
279-
*,
280-
remote_path: str,
281-
**kwargs: Any
282-
) -> AsyncIterator[bytes]: ...
283-
284-
@distributed_trace_async
285-
async def download_session_file_to_path(
257+
async def download_session_file(
286258
self,
287259
agent_name: str,
288260
session_id: str,
289261
*,
290-
file_path: Union[str, PathLike[str]],
291-
overwrite: bool = False,
292-
remote_path: str,
262+
path: str,
293263
**kwargs: Any
294-
) -> None: ...
264+
) -> AsyncIterator[bytes]: ...
295265

296266
@distributed_trace_async
297267
async def enable(
@@ -347,12 +317,12 @@ namespace azure.ai.projects.aio.operations
347317
def list_session_files(
348318
self,
349319
agent_name: str,
350-
agent_session_id: str,
320+
session_id: str,
351321
*,
352322
before: Optional[str] = ...,
353323
limit: Optional[int] = ...,
354324
order: Optional[Union[str, PageOrder]] = ...,
355-
remote_path: Optional[str] = ...,
325+
path: Optional[str] = ...,
356326
**kwargs: Any
357327
) -> AsyncItemPaged[SessionDirectoryEntry]: ...
358328

@@ -418,25 +388,14 @@ namespace azure.ai.projects.aio.operations
418388
**kwargs: Any
419389
) -> AgentDetails: ...
420390

421-
@overload
391+
@distributed_trace_async
422392
async def upload_session_file(
423393
self,
424394
agent_name: str,
425395
session_id: str,
426-
*,
427396
content: bytes,
428-
remote_path: str,
429-
**kwargs: Any
430-
) -> SessionFileWriteResult: ...
431-
432-
@overload
433-
async def upload_session_file(
434-
self,
435-
agent_name: str,
436-
session_id: str,
437397
*,
438-
file_path: Union[str, PathLike[str]],
439-
remote_path: str,
398+
path: str,
440399
**kwargs: Any
441400
) -> SessionFileWriteResult: ...
442401

@@ -3944,40 +3903,6 @@ namespace azure.ai.projects.models
39443903
def __init__(self, mapping: Mapping[str, Any]) -> None: ...
39453904

39463905

3947-
class azure.ai.projects.models.CreateAgentVersionFromCodeContent(_Model):
3948-
code: Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]
3949-
metadata: CreateAgentVersionFromCodeMetadata
3950-
3951-
@overload
3952-
def __init__(
3953-
self,
3954-
*,
3955-
code: FileType,
3956-
metadata: CreateAgentVersionFromCodeMetadata
3957-
) -> None: ...
3958-
3959-
@overload
3960-
def __init__(self, mapping: Mapping[str, Any]) -> None: ...
3961-
3962-
3963-
class azure.ai.projects.models.CreateAgentVersionFromCodeMetadata(_Model):
3964-
definition: HostedAgentDefinition
3965-
description: Optional[str]
3966-
metadata: Optional[dict[str, str]]
3967-
3968-
@overload
3969-
def __init__(
3970-
self,
3971-
*,
3972-
definition: HostedAgentDefinition,
3973-
description: Optional[str] = ...,
3974-
metadata: Optional[dict[str, str]] = ...
3975-
) -> None: ...
3976-
3977-
@overload
3978-
def __init__(self, mapping: Mapping[str, Any]) -> None: ...
3979-
3980-
39813906
class azure.ai.projects.models.CreateAsyncResponse(_Model):
39823907
location: Optional[str]
39833908
operation_result: Optional[str]
@@ -9536,23 +9461,16 @@ namespace azure.ai.projects.operations
95369461
**kwargs: Any
95379462
) -> AgentVersionDetails: ...
95389463

9539-
@overload
9540-
def create_version_from_code(
9541-
self,
9542-
agent_name: str,
9543-
content: CreateAgentVersionFromCodeContent,
9544-
*,
9545-
code_zip_sha256: str,
9546-
**kwargs: Any
9547-
) -> AgentVersionDetails: ...
9548-
9549-
@overload
9464+
@distributed_trace
95509465
def create_version_from_code(
95519466
self,
95529467
agent_name: str,
9553-
content: JSON,
95549468
*,
9555-
code_zip_sha256: str,
9469+
code: IO[bytes],
9470+
code_zip_sha256: Optional[str] = ...,
9471+
definition: HostedAgentDefinition,
9472+
description: Optional[str] = ...,
9473+
metadata: Optional[dict[str, str]] = ...,
95569474
**kwargs: Any
95579475
) -> AgentVersionDetails: ...
95589476

@@ -9610,10 +9528,10 @@ namespace azure.ai.projects.operations
96109528
def delete_session_file(
96119529
self,
96129530
agent_name: str,
9613-
agent_session_id: str,
9531+
session_id: str,
96149532
*,
9533+
path: str,
96159534
recursive: Optional[bool] = ...,
9616-
remote_path: str,
96179535
**kwargs: Any
96189536
) -> None: ...
96199537

@@ -9635,7 +9553,7 @@ namespace azure.ai.projects.operations
96359553
) -> None: ...
96369554

96379555
@distributed_trace
9638-
def download_code_as_bytes(
9556+
def download_code(
96399557
self,
96409558
agent_name: str,
96419559
*,
@@ -9644,37 +9562,14 @@ namespace azure.ai.projects.operations
96449562
) -> Iterator[bytes]: ...
96459563

96469564
@distributed_trace
9647-
def download_code_to_path(
9648-
self,
9649-
agent_name: str,
9650-
*,
9651-
agent_version: Optional[str] = ...,
9652-
file_path: Union[str, PathLike[str]],
9653-
overwrite: bool = False,
9654-
**kwargs: Any
9655-
) -> str: ...
9656-
9657-
@distributed_trace
9658-
def download_session_file_as_bytes(
9659-
self,
9660-
agent_name: str,
9661-
agent_session_id: str,
9662-
*,
9663-
remote_path: str,
9664-
**kwargs: Any
9665-
) -> Iterator[bytes]: ...
9666-
9667-
@distributed_trace
9668-
def download_session_file_to_path(
9565+
def download_session_file(
96699566
self,
96709567
agent_name: str,
96719568
session_id: str,
96729569
*,
9673-
file_path: Union[str, PathLike[str]],
9674-
overwrite: bool = False,
9675-
remote_path: str,
9570+
path: str,
96769571
**kwargs: Any
9677-
) -> None: ...
9572+
) -> Iterator[bytes]: ...
96789573

96799574
@distributed_trace
96809575
def enable(
@@ -9730,12 +9625,12 @@ namespace azure.ai.projects.operations
97309625
def list_session_files(
97319626
self,
97329627
agent_name: str,
9733-
agent_session_id: str,
9628+
session_id: str,
97349629
*,
97359630
before: Optional[str] = ...,
97369631
limit: Optional[int] = ...,
97379632
order: Optional[Union[str, PageOrder]] = ...,
9738-
remote_path: Optional[str] = ...,
9633+
path: Optional[str] = ...,
97399634
**kwargs: Any
97409635
) -> ItemPaged[SessionDirectoryEntry]: ...
97419636

@@ -9801,25 +9696,14 @@ namespace azure.ai.projects.operations
98019696
**kwargs: Any
98029697
) -> AgentDetails: ...
98039698

9804-
@overload
9699+
@distributed_trace
98059700
def upload_session_file(
98069701
self,
98079702
agent_name: str,
98089703
session_id: str,
9809-
*,
98109704
content: bytes,
9811-
remote_path: str,
9812-
**kwargs: Any
9813-
) -> SessionFileWriteResult: ...
9814-
9815-
@overload
9816-
def upload_session_file(
9817-
self,
9818-
agent_name: str,
9819-
session_id: str,
98209705
*,
9821-
file_path: Union[str, PathLike[str]],
9822-
remote_path: str,
9706+
path: str,
98239707
**kwargs: Any
98249708
) -> SessionFileWriteResult: ...
98259709

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
apiMdSha256: 24a9a51dbe82648fdabecd93660698f32ceba6e39f8a7c4353eee2cf097c180f
1+
apiMdSha256: 28e27d35c13ceeb5c5599d5770812703b1157547762a5433722a41e8a2da57b6
22
parserVersion: 0.3.28
33
pythonVersion: 3.14.3

sdk/ai/azure-ai-projects/apiview-properties.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@
9595
"azure.ai.projects.models.EvaluationRuleAction": "Azure.AI.Projects.EvaluationRuleAction",
9696
"azure.ai.projects.models.ContinuousEvaluationRuleAction": "Azure.AI.Projects.ContinuousEvaluationRuleAction",
9797
"azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex",
98-
"azure.ai.projects.models.CreateAgentVersionFromCodeContent": "Azure.AI.Projects.CreateAgentVersionFromCodeContent",
99-
"azure.ai.projects.models.CreateAgentVersionFromCodeMetadata": "Azure.AI.Projects.CreateAgentVersionFromCodeMetadata",
10098
"azure.ai.projects.models.CreateAsyncResponse": "Azure.AI.Projects.createAsync.Response.anonymous",
10199
"azure.ai.projects.models.CreateSkillVersionFromFilesBody": "Azure.AI.Projects.CreateSkillVersionFromFilesBody",
102100
"azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger",
@@ -462,10 +460,8 @@
462460
"azure.ai.projects.aio.operations.AgentsOperations.list_versions": "Azure.AI.Projects.Agents.listAgentVersions",
463461
"azure.ai.projects.operations.AgentsOperations.update_details": "Azure.AI.Projects.Agents.patchAgentObject",
464462
"azure.ai.projects.aio.operations.AgentsOperations.update_details": "Azure.AI.Projects.Agents.patchAgentObject",
465-
"azure.ai.projects.operations.AgentsOperations.create_version_from_code": "Azure.AI.Projects.Agents.createAgentVersionFromCode",
466-
"azure.ai.projects.aio.operations.AgentsOperations.create_version_from_code": "Azure.AI.Projects.Agents.createAgentVersionFromCode",
467-
"azure.ai.projects.operations.AgentsOperations.download_code_as_bytes": "Azure.AI.Projects.Agents.downloadAgentCode",
468-
"azure.ai.projects.aio.operations.AgentsOperations.download_code_as_bytes": "Azure.AI.Projects.Agents.downloadAgentCode",
463+
"azure.ai.projects.operations.AgentsOperations.download_code": "Azure.AI.Projects.Agents.downloadAgentCode",
464+
"azure.ai.projects.aio.operations.AgentsOperations.download_code": "Azure.AI.Projects.Agents.downloadAgentCode",
469465
"azure.ai.projects.operations.AgentsOperations.enable": "Azure.AI.Projects.Agents.enableAgent",
470466
"azure.ai.projects.aio.operations.AgentsOperations.enable": "Azure.AI.Projects.Agents.enableAgent",
471467
"azure.ai.projects.operations.AgentsOperations.disable": "Azure.AI.Projects.Agents.disableAgent",
@@ -482,8 +478,10 @@
482478
"azure.ai.projects.aio.operations.AgentsOperations.list_sessions": "Azure.AI.Projects.Agents.listSessions",
483479
"azure.ai.projects.operations.AgentsOperations.get_session_log_stream": "Azure.AI.Projects.Agents.getSessionLogStream",
484480
"azure.ai.projects.aio.operations.AgentsOperations.get_session_log_stream": "Azure.AI.Projects.Agents.getSessionLogStream",
485-
"azure.ai.projects.operations.AgentsOperations.download_session_file_as_bytes": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile",
486-
"azure.ai.projects.aio.operations.AgentsOperations.download_session_file_as_bytes": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile",
481+
"azure.ai.projects.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile",
482+
"azure.ai.projects.aio.operations.AgentsOperations.upload_session_file": "Azure.AI.Projects.AgentSessionFiles.uploadSessionFile",
483+
"azure.ai.projects.operations.AgentsOperations.download_session_file": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile",
484+
"azure.ai.projects.aio.operations.AgentsOperations.download_session_file": "Azure.AI.Projects.AgentSessionFiles.downloadSessionFile",
487485
"azure.ai.projects.operations.AgentsOperations.list_session_files": "Azure.AI.Projects.AgentSessionFiles.listSessionFiles",
488486
"azure.ai.projects.aio.operations.AgentsOperations.list_session_files": "Azure.AI.Projects.AgentSessionFiles.listSessionFiles",
489487
"azure.ai.projects.operations.AgentsOperations.delete_session_file": "Azure.AI.Projects.AgentSessionFiles.deleteSessionFile",
@@ -543,5 +541,5 @@
543541
"azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion",
544542
"azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion"
545543
},
546-
"CrossLanguageVersion": "8a30c0e05596"
544+
"CrossLanguageVersion": "32a086fb0432"
547545
}

sdk/ai/azure-ai-projects/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ai/azure-ai-projects",
5-
"Tag": "python/ai/azure-ai-projects_9ccd20fb6a"
5+
"Tag": "python/ai/azure-ai-projects_8ed61957d2"
66
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-ins
123123
:param credential: Credential used to authenticate requests to the service. Required.
124124
:type credential: ~azure.core.credentials.TokenCredential
125125
:param allow_preview: Whether to enable preview features. Optional, default is False.
126-
Set this to True to create a Hosted Agent (using :class:`~azure.ai.projects.models.HostedAgentDefinition`)
127-
or a Workflow Agent (using :class:`~azure.ai.projects.models.WorkflowAgentDefinition`).
126+
Set this to True to create a Workflow Agent (using :class:`~azure.ai.projects.models.WorkflowAgentDefinition`).
128127
Set this to True to use human evaluation rule action (class :class:`~azure.ai.projects.models.HumanEvaluationPreviewRuleAction`).
129128
Methods on the `.beta` sub-client (class :class:`~azure.ai.projects.operations.BetaOperations`)
130129
are all in preview, but do not require setting `allow_preview=True` since it's implied by the sub-client name.
131130
When preview features are enabled, the client libraries sends the HTTP request header `Foundry-Features`
132-
with the appropriate value in all relevant calls to the service.
131+
with the appropriate value in all relevant calls to the service. Do not use preview features in production code,
132+
as they are subject to change or removal without notice.
133133
:type allow_preview: bool
134134
:keyword api_version: The API version to use for this operation. Known values are "v1". Default
135135
value is "v1". Note that overriding this default value may result in unsupported behavior.

0 commit comments

Comments
 (0)