Skip to content

Commit b4d5f85

Browse files
committed
Merge branch 'feature/azure-ai-agents/1.0.3' of https://github.com/Azure/azure-sdk-for-python into feature/azure-ai-agents/1.0.3
2 parents 48a2e5b + 851dab1 commit b4d5f85

17 files changed

+352
-281
lines changed

eng/emitter-package-lock.json

Lines changed: 245 additions & 232 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/emitter-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"main": "dist/src/index.js",
2+
"name": "dist/src/index.js",
33
"dependencies": {
44
"@azure-tools/typespec-python": "0.46.0"
55
},

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- Added a sample showing auto function call for a synchronous client, [`sample_agents_auto_function_call.py`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_auto_function_call.py)
1313
- Added a sample showing auto function call for an asynchronous client, [`sample_agents_auto_function_call_async.py`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/agents_async/sample_agents_auto_function_call_async.py).
1414

15+
### Bugs Fixed
16+
17+
- `_AgentsClientOperationsMixin` is now private.
18+
1519
## 1.0.2 (2025-07-01)
1620

1721
### Bugs Fixed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"apiVersion": "v1"
3+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from ._configuration import AgentsClientConfiguration
1818
from ._utils.serialization import Deserializer, Serializer
1919
from .operations import (
20-
AgentsClientOperationsMixin,
2120
FilesOperations,
2221
MessagesOperations,
2322
RunStepsOperations,
@@ -27,12 +26,13 @@
2726
VectorStoreFilesOperations,
2827
VectorStoresOperations,
2928
)
29+
from .operations._operations import _AgentsClientOperationsMixin
3030

3131
if TYPE_CHECKING:
3232
from azure.core.credentials import TokenCredential
3333

3434

35-
class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes
35+
class AgentsClient(_AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes
3636
"""AgentsClient.
3737
3838
:ivar threads: ThreadsOperations operations

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=line-too-long,useless-suppression,too-many-lines
1+
# pylint: disable=line-too-long,useless-suppression,too-many-lines
22
# ------------------------------------
33
# Copyright (c) Microsoft Corporation.
44
# Licensed under the MIT License.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from .._utils.serialization import Deserializer, Serializer
1818
from ._configuration import AgentsClientConfiguration
1919
from .operations import (
20-
AgentsClientOperationsMixin,
2120
FilesOperations,
2221
MessagesOperations,
2322
RunStepsOperations,
@@ -27,12 +26,13 @@
2726
VectorStoreFilesOperations,
2827
VectorStoresOperations,
2928
)
29+
from .operations._operations import _AgentsClientOperationsMixin
3030

3131
if TYPE_CHECKING:
3232
from azure.core.credentials_async import AsyncTokenCredential
3333

3434

35-
class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes
35+
class AgentsClient(_AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes
3636
"""AgentsClient.
3737
3838
:ivar threads: ThreadsOperations operations

sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from ._operations import VectorStoresOperations # type: ignore
2121
from ._operations import VectorStoreFilesOperations # type: ignore
2222
from ._operations import VectorStoreFileBatchesOperations # type: ignore
23-
from ._operations import AgentsClientOperationsMixin # type: ignore
2423

2524
from ._patch import __all__ as _patch_all
2625
from ._patch import *
@@ -35,7 +34,6 @@
3534
"VectorStoresOperations",
3635
"VectorStoreFilesOperations",
3736
"VectorStoreFileBatchesOperations",
38-
"AgentsClientOperationsMixin",
3937
]
4038
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
4139
_patch_sdk()

sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_operations.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,7 @@
99
from collections.abc import MutableMapping
1010
from io import IOBase
1111
import json
12-
from typing import (
13-
Any,
14-
AsyncIterable,
15-
AsyncIterator,
16-
Callable,
17-
Dict,
18-
IO,
19-
List,
20-
Optional,
21-
TYPE_CHECKING,
22-
TypeVar,
23-
Union,
24-
overload,
25-
)
12+
from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TYPE_CHECKING, TypeVar, Union, overload
2613
import urllib.parse
2714

2815
from azure.core import AsyncPipelineClient
@@ -284,7 +271,7 @@ def list(
284271
order: Optional[Union[str, _models.ListSortOrder]] = None,
285272
before: Optional[str] = None,
286273
**kwargs: Any
287-
) -> AsyncIterable["_models.AgentThread"]:
274+
) -> AsyncItemPaged["_models.AgentThread"]:
288275
"""Gets a list of threads that were previously created.
289276
290277
:keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and
@@ -861,7 +848,7 @@ def list(
861848
order: Optional[Union[str, _models.ListSortOrder]] = None,
862849
before: Optional[str] = None,
863850
**kwargs: Any
864-
) -> AsyncIterable["_models.ThreadMessage"]:
851+
) -> AsyncItemPaged["_models.ThreadMessage"]:
865852
"""Gets a list of messages that exist on a thread.
866853
867854
:param thread_id: Identifier of the thread. Required.
@@ -1195,6 +1182,7 @@ async def create(
11951182
additional_instructions: Optional[str] = None,
11961183
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
11971184
tools: Optional[List[_models.ToolDefinition]] = None,
1185+
tool_resources: Optional[_models.ToolResources] = None,
11981186
stream_parameter: Optional[bool] = None,
11991187
temperature: Optional[float] = None,
12001188
top_p: Optional[float] = None,
@@ -1237,6 +1225,9 @@ async def create(
12371225
:keyword tools: The overridden list of enabled tools that the agent should use to run the
12381226
thread. Default value is None.
12391227
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
1228+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
1229+
the thread. Default value is None.
1230+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
12401231
:keyword stream_parameter: If ``true``, returns a stream of events that happen during the Run
12411232
as server-sent events,
12421233
terminating when the Run enters a terminal state with a ``data: [DONE]`` message. Default
@@ -1366,6 +1357,7 @@ async def create(
13661357
additional_instructions: Optional[str] = None,
13671358
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
13681359
tools: Optional[List[_models.ToolDefinition]] = None,
1360+
tool_resources: Optional[_models.ToolResources] = None,
13691361
stream_parameter: Optional[bool] = None,
13701362
temperature: Optional[float] = None,
13711363
top_p: Optional[float] = None,
@@ -1407,6 +1399,9 @@ async def create(
14071399
:keyword tools: The overridden list of enabled tools that the agent should use to run the
14081400
thread. Default value is None.
14091401
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
1402+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
1403+
the thread. Default value is None.
1404+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
14101405
:keyword stream_parameter: If ``true``, returns a stream of events that happen during the Run
14111406
as server-sent events,
14121407
terminating when the Run enters a terminal state with a ``data: [DONE]`` message. Default
@@ -1495,6 +1490,7 @@ async def create(
14951490
"stream": stream_parameter,
14961491
"temperature": temperature,
14971492
"tool_choice": tool_choice,
1493+
"tool_resources": tool_resources,
14981494
"tools": tools,
14991495
"top_p": top_p,
15001496
"truncation_strategy": truncation_strategy,
@@ -1557,7 +1553,7 @@ def list(
15571553
order: Optional[Union[str, _models.ListSortOrder]] = None,
15581554
before: Optional[str] = None,
15591555
**kwargs: Any
1560-
) -> AsyncIterable["_models.ThreadRun"]:
1556+
) -> AsyncItemPaged["_models.ThreadRun"]:
15611557
"""Gets a list of runs for a specified thread.
15621558
15631559
:param thread_id: Identifier of the thread. Required.
@@ -2197,7 +2193,7 @@ def list(
21972193
order: Optional[Union[str, _models.ListSortOrder]] = None,
21982194
before: Optional[str] = None,
21992195
**kwargs: Any
2200-
) -> AsyncIterable["_models.RunStep"]:
2196+
) -> AsyncItemPaged["_models.RunStep"]:
22012197
"""Gets a list of run steps from a thread run.
22022198
22032199
:param thread_id: Identifier of the thread. Required.
@@ -2646,7 +2642,7 @@ def list(
26462642
order: Optional[Union[str, _models.ListSortOrder]] = None,
26472643
before: Optional[str] = None,
26482644
**kwargs: Any
2649-
) -> AsyncIterable["_models.VectorStore"]:
2645+
) -> AsyncItemPaged["_models.VectorStore"]:
26502646
"""Returns a list of vector stores.
26512647
26522648
:keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and
@@ -3216,7 +3212,7 @@ def list(
32163212
order: Optional[Union[str, _models.ListSortOrder]] = None,
32173213
before: Optional[str] = None,
32183214
**kwargs: Any
3219-
) -> AsyncIterable["_models.VectorStoreFile"]:
3215+
) -> AsyncItemPaged["_models.VectorStoreFile"]:
32203216
"""Returns a list of vector store files.
32213217
32223218
:param vector_store_id: Identifier of the vector store. Required.
@@ -3904,7 +3900,7 @@ def list_files(
39043900
order: Optional[Union[str, _models.ListSortOrder]] = None,
39053901
before: Optional[str] = None,
39063902
**kwargs: Any
3907-
) -> AsyncIterable["_models.VectorStoreFile"]:
3903+
) -> AsyncItemPaged["_models.VectorStoreFile"]:
39083904
"""Returns a list of vector store files in a batch.
39093905
39103906
:param vector_store_id: Identifier of the vector store. Required.
@@ -3988,7 +3984,7 @@ async def get_next(_continuation_token=None):
39883984
return AsyncItemPaged(get_next, extract_data)
39893985

39903986

3991-
class AgentsClientOperationsMixin(
3987+
class _AgentsClientOperationsMixin(
39923988
ClientMixinABC[AsyncPipelineClient[HttpRequest, AsyncHttpResponse], AgentsClientConfiguration]
39933989
):
39943990

@@ -4232,7 +4228,7 @@ def list_agents(
42324228
order: Optional[Union[str, _models.ListSortOrder]] = None,
42334229
before: Optional[str] = None,
42344230
**kwargs: Any
4235-
) -> AsyncIterable["_models.Agent"]:
4231+
) -> AsyncItemPaged["_models.Agent"]:
42364232
"""Gets a list of agents that were previously created.
42374233
42384234
:keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ async def create( # pylint: disable=arguments-differ
115115
additional_instructions: Optional[str] = None,
116116
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
117117
tools: Optional[List[_models.ToolDefinition]] = None,
118+
tool_resources: Optional[_models.ToolResources] = None,
118119
temperature: Optional[float] = None,
119120
top_p: Optional[float] = None,
120121
max_prompt_tokens: Optional[int] = None,
@@ -156,6 +157,9 @@ async def create( # pylint: disable=arguments-differ
156157
:keyword tools: The overridden list of enabled tools that the agent should use to run the
157158
thread. Default value is None.
158159
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
160+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
161+
the thread. Default value is None.
162+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
159163
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
160164
will make the output
161165
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -281,6 +285,7 @@ async def create(
281285
additional_instructions: Optional[str] = None,
282286
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
283287
tools: Optional[List[_models.ToolDefinition]] = None,
288+
tool_resources: Optional[_models.ToolResources] = None,
284289
temperature: Optional[float] = None,
285290
top_p: Optional[float] = None,
286291
max_prompt_tokens: Optional[int] = None,
@@ -321,6 +326,9 @@ async def create(
321326
:keyword tools: The overridden list of enabled tools that the agent should use to run the
322327
thread. Default value is None.
323328
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
329+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
330+
the thread. Default value is None.
331+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
324332
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
325333
will make the output
326334
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -389,6 +397,7 @@ async def create(
389397
additional_instructions=additional_instructions,
390398
additional_messages=additional_messages,
391399
tools=tools,
400+
tool_resources=tool_resources,
392401
stream_parameter=False,
393402
stream=False,
394403
temperature=temperature,
@@ -530,6 +539,7 @@ async def create_and_process(
530539
additional_instructions=additional_instructions,
531540
additional_messages=additional_messages,
532541
tools=toolset.definitions if toolset else None,
542+
tool_resources=toolset.resources if toolset else None,
533543
temperature=temperature,
534544
top_p=top_p,
535545
max_prompt_tokens=max_prompt_tokens,
@@ -599,6 +609,7 @@ async def stream(
599609
additional_instructions: Optional[str] = None,
600610
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
601611
tools: Optional[List[_models.ToolDefinition]] = None,
612+
tool_resources: Optional[_models.ToolResources] = None,
602613
temperature: Optional[float] = None,
603614
top_p: Optional[float] = None,
604615
max_prompt_tokens: Optional[int] = None,
@@ -641,6 +652,9 @@ async def stream(
641652
:keyword tools: The overridden list of enabled tools that the agent should use to run the
642653
thread. Default value is None.
643654
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
655+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
656+
the thread. Default value is None.
657+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
644658
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
645659
will make the output
646660
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -710,6 +724,7 @@ async def stream(
710724
additional_instructions: Optional[str] = None,
711725
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
712726
tools: Optional[List[_models.ToolDefinition]] = None,
727+
tool_resources: Optional[_models.ToolResources] = None,
713728
temperature: Optional[float] = None,
714729
top_p: Optional[float] = None,
715730
max_prompt_tokens: Optional[int] = None,
@@ -752,6 +767,9 @@ async def stream(
752767
:keyword tools: The overridden list of enabled tools that the agent should use to run the
753768
thread. Default value is None.
754769
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
770+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
771+
the thread. Default value is None.
772+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
755773
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
756774
will make the output
757775
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -890,6 +908,7 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
890908
additional_instructions: Optional[str] = None,
891909
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
892910
tools: Optional[List[_models.ToolDefinition]] = None,
911+
tool_resources: Optional[_models.ToolResources] = None,
893912
temperature: Optional[float] = None,
894913
top_p: Optional[float] = None,
895914
max_prompt_tokens: Optional[int] = None,
@@ -933,6 +952,9 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
933952
:keyword tools: The overridden list of enabled tools that the agent should use to run the
934953
thread. Default value is None.
935954
:paramtype tools: list[~azure.ai.agents.models.ToolDefinition]
955+
:keyword tool_resources: The overridden enabled tool resources that the agent should use to run
956+
the thread. Default value is None.
957+
:paramtype tool_resources: ~azure.ai.agents.models.ToolResources
936958
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
937959
will make the output
938960
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -1004,6 +1026,7 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
10041026
additional_instructions=additional_instructions,
10051027
additional_messages=additional_messages,
10061028
tools=tools,
1029+
tool_resources=tool_resources,
10071030
stream_parameter=True,
10081031
stream=True,
10091032
temperature=temperature,
@@ -1373,7 +1396,7 @@ async def upload(
13731396
:paramtype file: Optional[FileType]
13741397
:keyword file_path: Path to the file. Required if `body` and `purpose` are not provided.
13751398
:paramtype file_path: Optional[str]
1376-
:keyword purpose: Known values are: "assistants", "assistants_output", and "vision".
1399+
:keyword purpose: Known values are: "assistants", "assistants_output", and "vision".
13771400
Required if `body` and `file` are not provided.
13781401
:paramtype purpose: Union[str, _models.FilePurpose, None]
13791402
:keyword filename: The name of the file.
@@ -1513,7 +1536,7 @@ async def upload_and_poll(
15131536
:paramtype file: Optional[FileType]
15141537
:keyword file_path: Path to the file. Required if `body` and `purpose` are not provided.
15151538
:paramtype file_path: Optional[str]
1516-
:keyword purpose: Known values are: "assistants", "assistants_output", and "vision".
1539+
:keyword purpose: Known values are: "assistants", "assistants_output", and "vision".
15171540
Required if `body` and `file` are not provided.
15181541
:paramtype purpose: Union[str, _models.FilePurpose, None]
15191542
:keyword filename: The name of the file.

0 commit comments

Comments
 (0)