Skip to content

Commit fd55c90

Browse files
authored
Add tool_resources for async run operation (#42060)
1 parent 6e77168 commit fd55c90

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
## 1.1.0b5 (Unreleased)
66

7+
### Features Added
8+
9+
- Support `tool_resources` for run async operations.
10+
711
### Bugs Fixed
812

913
- `AgentsResponseFormatOption`, `MessageInputContent`, `MessageAttachmentToolDefinition`, `AgentsToolChoiceOption` are now public.

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

Lines changed: 22 additions & 0 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,
@@ -600,6 +609,7 @@ async def stream(
600609
additional_instructions: Optional[str] = None,
601610
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
602611
tools: Optional[List[_models.ToolDefinition]] = None,
612+
tool_resources: Optional[_models.ToolResources] = None,
603613
temperature: Optional[float] = None,
604614
top_p: Optional[float] = None,
605615
max_prompt_tokens: Optional[int] = None,
@@ -642,6 +652,9 @@ async def stream(
642652
:keyword tools: The overridden list of enabled tools that the agent should use to run the
643653
thread. Default value is None.
644654
: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
645658
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
646659
will make the output
647660
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -711,6 +724,7 @@ async def stream(
711724
additional_instructions: Optional[str] = None,
712725
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
713726
tools: Optional[List[_models.ToolDefinition]] = None,
727+
tool_resources: Optional[_models.ToolResources] = None,
714728
temperature: Optional[float] = None,
715729
top_p: Optional[float] = None,
716730
max_prompt_tokens: Optional[int] = None,
@@ -753,6 +767,9 @@ async def stream(
753767
:keyword tools: The overridden list of enabled tools that the agent should use to run the
754768
thread. Default value is None.
755769
: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
756773
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
757774
will make the output
758775
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -891,6 +908,7 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
891908
additional_instructions: Optional[str] = None,
892909
additional_messages: Optional[List[_models.ThreadMessageOptions]] = None,
893910
tools: Optional[List[_models.ToolDefinition]] = None,
911+
tool_resources: Optional[_models.ToolResources] = None,
894912
temperature: Optional[float] = None,
895913
top_p: Optional[float] = None,
896914
max_prompt_tokens: Optional[int] = None,
@@ -934,6 +952,9 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
934952
:keyword tools: The overridden list of enabled tools that the agent should use to run the
935953
thread. Default value is None.
936954
: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
937958
:keyword temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8
938959
will make the output
939960
more random, while lower values like 0.2 will make it more focused and deterministic. Default
@@ -1005,6 +1026,7 @@ async def stream( # pyright: ignore[reportInconsistentOverload]
10051026
additional_instructions=additional_instructions,
10061027
additional_messages=additional_messages,
10071028
tools=tools,
1029+
tool_resources=tool_resources,
10081030
stream_parameter=True,
10091031
stream=True,
10101032
temperature=temperature,

0 commit comments

Comments
 (0)