Skip to content

Commit 6c30600

Browse files
howieleungjhakulin
andauthored
Jhakulin/delete ops update (Azure#41025)
* update delete ops * Made public delete_* functions and update samples, test, readme * keep delete method names the same as before * update README * keep preview tools until we make first stable version * update apiview properties * update azure function samples * fix mypy * update to use 2025-05-15-preview * added recording for some sync test * added vectore store tests * Resolved comments * Comment out all async test since recording has issue with proxy * run black * update chagne log na rename function * rever .env * clean up * trigger build * fix test and upgrade api version * added tracing recording * rebase --------- Co-authored-by: jhakulin <[email protected]>
1 parent 0346175 commit 6c30600

36 files changed

+4246
-4152
lines changed

sdk/ai/azure-ai-agents/CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
### Breaking Changes
66

77
- enable_auto_function_calls supports positional arguments instead of keyword arguments.
8+
- Rename `get_last_text_message_by_role` to `get_last_message_text_by_role`.
89

910
### Features Added
1011

11-
- Initial version - splits off Azure AI Agents functionality from the Azure AI Projects SDK
12-
- Azure AI Search tool, Bing Grounding tool, and Bing Custom Search tool parameters updated
12+
- Initial version - splits off Azure AI Agents functionality from the Azure AI Projects SDK.
13+
- Azure AI Search tool, Bing Grounding tool, and Bing Custom Search tool parameters updated.
1314
- All polling functions now support timeout keyword parameter.
1415

1516
### Bugs Fixed
1617

1718
- During automatic function calls for streaming, when the thread run is cancelled due to too many retry, now a cancelled event will be sent out.
18-
- Add missing thread run id and message id on the process thread run span
19+
- Add missing thread run id and message id on the process thread run span.

sdk/ai/azure-ai-agents/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ configure_azure_monitor(connection_string=application_insights_connection_string
11741174

11751175
try:
11761176
from azure.ai.agents.telemetry import AIAgentsInstrumentor
1177+
11771178
agents_instrumentor = AIAgentsInstrumentor()
11781179
if not agents_instrumentor.is_instrumented():
11791180
agents_instrumentor.instrument()

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"CrossLanguagePackageId": "Azure.AI.Agents",
33
"CrossLanguageDefinitionId": {
44
"azure.ai.agents.models.Agent": "Azure.AI.Agents.Agent",
5-
"azure.ai.agents.models.AgentDeletionStatus": "Azure.AI.Agents.AgentDeletionStatus",
65
"azure.ai.agents.models.AgentsNamedToolChoice": "Azure.AI.Agents.AgentsNamedToolChoice",
76
"azure.ai.agents.models.AgentsResponseFormat": "Azure.AI.Agents.AgentsResponseFormat",
87
"azure.ai.agents.models.AgentThread": "Azure.AI.Agents.AgentThread",
@@ -25,7 +24,6 @@
2524
"azure.ai.agents.models.CodeInterpreterToolResource": "Azure.AI.Agents.CodeInterpreterToolResource",
2625
"azure.ai.agents.models.ConnectedAgentDetails": "Azure.AI.Agents.ConnectedAgentDetails",
2726
"azure.ai.agents.models.ConnectedAgentToolDefinition": "Azure.AI.Agents.ConnectedAgentToolDefinition",
28-
"azure.ai.agents.models.FileDeletionStatus": "Azure.AI.Agents.FileDeletionStatus",
2927
"azure.ai.agents.models.FileInfo": "Azure.AI.Agents.FileInfo",
3028
"azure.ai.agents.models.FileListResponse": "Azure.AI.Agents.FileListResponse",
3129
"azure.ai.agents.models.FileSearchRankingOptions": "Azure.AI.Agents.FileSearchRankingOptions",
@@ -132,7 +130,6 @@
132130
"azure.ai.agents.models.SharepointToolDefinition": "Azure.AI.Agents.SharepointToolDefinition",
133131
"azure.ai.agents.models.SubmitToolOutputsAction": "Azure.AI.Agents.SubmitToolOutputsAction",
134132
"azure.ai.agents.models.SubmitToolOutputsDetails": "Azure.AI.Agents.SubmitToolOutputsDetails",
135-
"azure.ai.agents.models.ThreadDeletionStatus": "Azure.AI.Agents.ThreadDeletionStatus",
136133
"azure.ai.agents.models.ThreadMessage": "Azure.AI.Agents.ThreadMessage",
137134
"azure.ai.agents.models.ThreadMessageOptions": "Azure.AI.Agents.ThreadMessageOptions",
138135
"azure.ai.agents.models.ThreadRun": "Azure.AI.Agents.ThreadRun",
@@ -152,12 +149,10 @@
152149
"azure.ai.agents.models.VectorStoreConfiguration": "Azure.AI.Agents.VectorStoreConfiguration",
153150
"azure.ai.agents.models.VectorStoreConfigurations": "Azure.AI.Agents.VectorStoreConfigurations",
154151
"azure.ai.agents.models.VectorStoreDataSource": "Azure.AI.Agents.VectorStoreDataSource",
155-
"azure.ai.agents.models.VectorStoreDeletionStatus": "Azure.AI.Agents.VectorStoreDeletionStatus",
156152
"azure.ai.agents.models.VectorStoreExpirationPolicy": "Azure.AI.Agents.VectorStoreExpirationPolicy",
157153
"azure.ai.agents.models.VectorStoreFile": "Azure.AI.Agents.VectorStoreFile",
158154
"azure.ai.agents.models.VectorStoreFileBatch": "Azure.AI.Agents.VectorStoreFileBatch",
159155
"azure.ai.agents.models.VectorStoreFileCount": "Azure.AI.Agents.VectorStoreFileCount",
160-
"azure.ai.agents.models.VectorStoreFileDeletionStatus": "Azure.AI.Agents.VectorStoreFileDeletionStatus",
161156
"azure.ai.agents.models.VectorStoreFileError": "Azure.AI.Agents.VectorStoreFileError",
162157
"azure.ai.agents.models.VectorStoreStaticChunkingStrategyOptions": "Azure.AI.Agents.VectorStoreStaticChunkingStrategyOptions",
163158
"azure.ai.agents.models.VectorStoreStaticChunkingStrategyRequest": "Azure.AI.Agents.VectorStoreStaticChunkingStrategyRequest",
@@ -207,8 +202,6 @@
207202
"azure.ai.agents.aio.operations.ThreadsOperations.get": "Azure.AI.Agents.Threads.getThread",
208203
"azure.ai.agents.operations.ThreadsOperations.update": "Azure.AI.Agents.Threads.updateThread",
209204
"azure.ai.agents.aio.operations.ThreadsOperations.update": "Azure.AI.Agents.Threads.updateThread",
210-
"azure.ai.agents.operations.ThreadsOperations.delete": "Azure.AI.Agents.Threads.deleteThread",
211-
"azure.ai.agents.aio.operations.ThreadsOperations.delete": "Azure.AI.Agents.Threads.deleteThread",
212205
"azure.ai.agents.operations.MessagesOperations.create": "Azure.AI.Agents.Messages.createMessage",
213206
"azure.ai.agents.aio.operations.MessagesOperations.create": "Azure.AI.Agents.Messages.createMessage",
214207
"azure.ai.agents.operations.MessagesOperations.list": "Azure.AI.Agents.Messages.listMessages",
@@ -235,8 +228,6 @@
235228
"azure.ai.agents.aio.operations.RunStepsOperations.list": "Azure.AI.Agents.RunSteps.listRunSteps",
236229
"azure.ai.agents.operations.FilesOperations.list": "Azure.AI.Agents.Files.listFiles",
237230
"azure.ai.agents.aio.operations.FilesOperations.list": "Azure.AI.Agents.Files.listFiles",
238-
"azure.ai.agents.operations.FilesOperations.delete": "Azure.AI.Agents.Files.deleteFile",
239-
"azure.ai.agents.aio.operations.FilesOperations.delete": "Azure.AI.Agents.Files.deleteFile",
240231
"azure.ai.agents.operations.FilesOperations.get": "Azure.AI.Agents.Files.getFile",
241232
"azure.ai.agents.aio.operations.FilesOperations.get": "Azure.AI.Agents.Files.getFile",
242233
"azure.ai.agents.operations.VectorStoresOperations.list": "Azure.AI.Agents.VectorStores.listVectorStores",
@@ -247,16 +238,12 @@
247238
"azure.ai.agents.aio.operations.VectorStoresOperations.get": "Azure.AI.Agents.VectorStores.getVectorStore",
248239
"azure.ai.agents.operations.VectorStoresOperations.modify": "Azure.AI.Agents.VectorStores.modifyVectorStore",
249240
"azure.ai.agents.aio.operations.VectorStoresOperations.modify": "Azure.AI.Agents.VectorStores.modifyVectorStore",
250-
"azure.ai.agents.operations.VectorStoresOperations.delete": "Azure.AI.Agents.VectorStores.deleteVectorStore",
251-
"azure.ai.agents.aio.operations.VectorStoresOperations.delete": "Azure.AI.Agents.VectorStores.deleteVectorStore",
252241
"azure.ai.agents.operations.VectorStoreFilesOperations.list": "Azure.AI.Agents.VectorStoreFiles.listVectorStoreFiles",
253242
"azure.ai.agents.aio.operations.VectorStoreFilesOperations.list": "Azure.AI.Agents.VectorStoreFiles.listVectorStoreFiles",
254243
"azure.ai.agents.operations.VectorStoreFilesOperations.create": "Azure.AI.Agents.VectorStoreFiles.createVectorStoreFile",
255244
"azure.ai.agents.aio.operations.VectorStoreFilesOperations.create": "Azure.AI.Agents.VectorStoreFiles.createVectorStoreFile",
256245
"azure.ai.agents.operations.VectorStoreFilesOperations.get": "Azure.AI.Agents.VectorStoreFiles.getVectorStoreFile",
257246
"azure.ai.agents.aio.operations.VectorStoreFilesOperations.get": "Azure.AI.Agents.VectorStoreFiles.getVectorStoreFile",
258-
"azure.ai.agents.operations.VectorStoreFilesOperations.delete": "Azure.AI.Agents.VectorStoreFiles.deleteVectorStoreFile",
259-
"azure.ai.agents.aio.operations.VectorStoreFilesOperations.delete": "Azure.AI.Agents.VectorStoreFiles.deleteVectorStoreFile",
260247
"azure.ai.agents.operations.VectorStoreFileBatchesOperations.create": "Azure.AI.Agents.VectorStoreFileBatches.createVectorStoreFileBatch",
261248
"azure.ai.agents.aio.operations.VectorStoreFileBatchesOperations.create": "Azure.AI.Agents.VectorStoreFileBatches.createVectorStoreFileBatch",
262249
"azure.ai.agents.operations.VectorStoreFileBatchesOperations.get": "Azure.AI.Agents.VectorStoreFileBatches.getVectorStoreFileBatch",
@@ -273,8 +260,6 @@
273260
"azure.ai.agents.aio.AgentsClient.get_agent": "Azure.AI.Agents.getAgent",
274261
"azure.ai.agents.AgentsClient.update_agent": "Azure.AI.Agents.updateAgent",
275262
"azure.ai.agents.aio.AgentsClient.update_agent": "Azure.AI.Agents.updateAgent",
276-
"azure.ai.agents.AgentsClient.delete_agent": "Azure.AI.Agents.deleteAgent",
277-
"azure.ai.agents.aio.AgentsClient.delete_agent": "Azure.AI.Agents.deleteAgent",
278263
"azure.ai.agents.AgentsClient.create_thread_and_run": "Azure.AI.Agents.createThreadAndRun",
279264
"azure.ai.agents.aio.AgentsClient.create_thread_and_run": "Azure.AI.Agents.createThreadAndRun"
280265
}

sdk/ai/azure-ai-agents/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-agents",
5-
"Tag": "python/ai/azure-ai-agents_dab4ae41b1"
5+
"Tag": "python/ai/azure-ai-agents_5d6ca21785"
66
}

sdk/ai/azure-ai-agents/azure/ai/agents/_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-ins
5656
:type endpoint: str
5757
:param credential: Credential used to authenticate requests to the service. Required.
5858
:type credential: ~azure.core.credentials.TokenCredential
59-
:keyword api_version: The API version to use for this operation. Default value is "v1". Note
60-
that overriding this default value may result in unsupported behavior.
59+
:keyword api_version: The API version to use for this operation. Default value is
60+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
61+
behavior.
6162
:paramtype api_version: str
6263
"""
6364

sdk/ai/azure-ai-agents/azure/ai/agents/_configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ class AgentsClientConfiguration: # pylint: disable=too-many-instance-attributes
2727
:type endpoint: str
2828
:param credential: Credential used to authenticate requests to the service. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:keyword api_version: The API version to use for this operation. Default value is "v1". Note
31-
that overriding this default value may result in unsupported behavior.
30+
:keyword api_version: The API version to use for this operation. Default value is
31+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
32+
behavior.
3233
:paramtype api_version: str
3334
"""
3435

3536
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "v1")
37+
api_version: str = kwargs.pop("api_version", "2025-05-15-preview")
3738

3839
if endpoint is None:
3940
raise ValueError("Parameter 'endpoint' must not be None.")

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self, endpoint: str, credential: TokenCredential, **kwargs: Any) ->
6363
)
6464
# Override the credential scope with the legacy one.
6565
kwargs["credential_scopes"] = ["https://management.azure.com/.default"]
66-
kwargs["api_version"] = "2025_05_01"
66+
kwargs["api_version"] = "2025-05-15-preview"
6767
# End of legacy endpoints handling.
6868
super().__init__(endpoint, credential, **kwargs)
6969

@@ -597,18 +597,15 @@ def _validate_tools_and_tool_resources(
597597
)
598598

599599
@distributed_trace
600-
def delete_agent( # pylint: disable=delete-operation-wrong-return-type
601-
self, agent_id: str, **kwargs: Any
602-
) -> _models.AgentDeletionStatus:
600+
def delete_agent(self, agent_id: str, **kwargs: Any) -> None:
603601
"""Deletes an agent.
604602
605603
:param agent_id: Identifier of the agent. Required.
606604
:type agent_id: str
607-
:return: AgentDeletionStatus. The AgentDeletionStatus is compatible with MutableMapping
608-
:rtype: ~azure.ai.agents.models.AgentDeletionStatus
605+
:rtype: None
609606
:raises ~azure.core.exceptions.HttpResponseError:
610607
"""
611-
return super().delete_agent(agent_id, **kwargs)
608+
super()._delete_agent(agent_id, **kwargs)
612609

613610
@distributed_trace
614611
def enable_auto_function_calls( # pylint: disable=client-method-missing-kwargs

sdk/ai/azure-ai-agents/azure/ai/agents/aio/_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-ins
5757
:type endpoint: str
5858
:param credential: Credential used to authenticate requests to the service. Required.
5959
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
60-
:keyword api_version: The API version to use for this operation. Default value is "v1". Note
61-
that overriding this default value may result in unsupported behavior.
60+
:keyword api_version: The API version to use for this operation. Default value is
61+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
62+
behavior.
6263
:paramtype api_version: str
6364
"""
6465

sdk/ai/azure-ai-agents/azure/ai/agents/aio/_configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ class AgentsClientConfiguration: # pylint: disable=too-many-instance-attributes
2727
:type endpoint: str
2828
:param credential: Credential used to authenticate requests to the service. Required.
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
30-
:keyword api_version: The API version to use for this operation. Default value is "v1". Note
31-
that overriding this default value may result in unsupported behavior.
30+
:keyword api_version: The API version to use for this operation. Default value is
31+
"2025-05-15-preview". Note that overriding this default value may result in unsupported
32+
behavior.
3233
:paramtype api_version: str
3334
"""
3435

3536
def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "v1")
37+
api_version: str = kwargs.pop("api_version", "2025-05-15-preview")
3738

3839
if endpoint is None:
3940
raise ValueError("Parameter 'endpoint' must not be None.")

sdk/ai/azure-ai-agents/azure/ai/agents/aio/_patch.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs:
6464
)
6565
# Override the credential scope with the legacy one.
6666
kwargs["credential_scopes"] = ["https://management.azure.com/.default"]
67-
kwargs["api_version"] = "2025_05_01"
67+
kwargs["api_version"] = "2025-05-15-preview"
6868
# End of legacy endpoints handling.
6969
super().__init__(endpoint, credential, **kwargs)
7070

@@ -597,16 +597,15 @@ def _validate_tools_and_tool_resources(
597597
)
598598

599599
@distributed_trace_async
600-
async def delete_agent(self, agent_id: str, **kwargs: Any) -> _models.AgentDeletionStatus:
600+
async def delete_agent(self, agent_id: str, **kwargs: Any) -> None:
601601
"""Deletes an agent.
602602
603603
:param agent_id: Identifier of the agent. Required.
604604
:type agent_id: str
605-
:return: AgentDeletionStatus. The AgentDeletionStatus is compatible with MutableMapping
606-
:rtype: ~azure.ai.agents.models.AgentDeletionStatus
605+
:rtype: None
607606
:raises ~azure.core.exceptions.HttpResponseError:
608607
"""
609-
return await super().delete_agent(agent_id, **kwargs)
608+
await super()._delete_agent(agent_id, **kwargs)
610609

611610
@distributed_trace
612611
def enable_auto_function_calls( # pylint: disable=client-method-missing-kwargs

0 commit comments

Comments
 (0)