Skip to content

Commit 78e40d4

Browse files
authored
Generate classes for Azure Function call. (#42534)
1 parent b350f74 commit 78e40d4

File tree

7 files changed

+265
-64
lines changed

7 files changed

+265
-64
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"azure.ai.agents.models.AzureFunctionBinding": "Azure.AI.Agents.AzureFunctionBinding",
1818
"azure.ai.agents.models.AzureFunctionDefinition": "Azure.AI.Agents.AzureFunctionDefinition",
1919
"azure.ai.agents.models.AzureFunctionStorageQueue": "Azure.AI.Agents.AzureFunctionStorageQueue",
20+
"azure.ai.agents.models.AzureFunctionToolCallDetails": "Azure.AI.Agents.AzureFunctionToolCallDetails",
2021
"azure.ai.agents.models.AzureFunctionToolDefinition": "Azure.AI.Agents.AzureFunctionToolDefinition",
2122
"azure.ai.agents.models.BingCustomSearchConfiguration": "Azure.AI.Agents.BingCustomSearchConfiguration",
2223
"azure.ai.agents.models.BingCustomSearchToolDefinition": "Azure.AI.Agents.BingCustomSearchToolDefinition",
@@ -110,6 +111,7 @@
110111
"azure.ai.agents.models.RunStepActivityDetails": "Azure.AI.Agents.RunStepActivityDetails",
111112
"azure.ai.agents.models.RunStepToolCall": "Azure.AI.Agents.RunStepToolCall",
112113
"azure.ai.agents.models.RunStepAzureAISearchToolCall": "Azure.AI.Agents.RunStepAzureAISearchToolCall",
114+
"azure.ai.agents.models.RunStepAzureFunctionToolCall": "Azure.AI.Agents.RunStepAzureFunctionToolCall",
113115
"azure.ai.agents.models.RunStepBingCustomSearchToolCall": "Azure.AI.Agents.RunStepBingCustomSearchToolCall",
114116
"azure.ai.agents.models.RunStepBingGroundingToolCall": "Azure.AI.Agents.RunStepBingGroundingToolCall",
115117
"azure.ai.agents.models.RunStepBrowserAutomationToolCall": "Azure.AI.Agents.RunStepBrowserAutomationToolCall",
@@ -127,6 +129,7 @@
127129
"azure.ai.agents.models.RunStepDelta": "Azure.AI.Agents.RunStepDelta",
128130
"azure.ai.agents.models.RunStepDeltaToolCall": "Azure.AI.Agents.RunStepDeltaToolCall",
129131
"azure.ai.agents.models.RunStepDeltaAzureAISearchToolCall": "Azure.AI.Agents.RunStepDeltaAzureAISearchToolCall",
132+
"azure.ai.agents.models.RunStepDeltaAzureFunctionToolCall": "Azure.AI.Agents.RunStepDeltaAzureFunctionToolCall",
130133
"azure.ai.agents.models.RunStepDeltaBingGroundingToolCall": "Azure.AI.Agents.RunStepDeltaBingGroundingToolCall",
131134
"azure.ai.agents.models.RunStepDeltaChunk": "Azure.AI.Agents.RunStepDeltaChunk",
132135
"azure.ai.agents.models.RunStepDeltaCodeInterpreterDetailItemObject": "Azure.AI.Agents.RunStepDeltaCodeInterpreterDetailItemObject",

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_6e57db9f8e"
5+
"Tag": "python/ai/azure-ai-agents_0082be7355"
66
}

sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
AzureFunctionBinding,
3030
AzureFunctionDefinition,
3131
AzureFunctionStorageQueue,
32+
AzureFunctionToolCallDetails,
3233
AzureFunctionToolDefinition,
3334
BingCustomSearchConfiguration,
3435
BingCustomSearchToolDefinition,
@@ -120,6 +121,7 @@
120121
RunStep,
121122
RunStepActivityDetails,
122123
RunStepAzureAISearchToolCall,
124+
RunStepAzureFunctionToolCall,
123125
RunStepBingCustomSearchToolCall,
124126
RunStepBingGroundingToolCall,
125127
RunStepBrowserAutomationToolCall,
@@ -136,6 +138,7 @@
136138
RunStepDeepResearchToolCallDetails,
137139
RunStepDelta,
138140
RunStepDeltaAzureAISearchToolCall,
141+
RunStepDeltaAzureFunctionToolCall,
139142
RunStepDeltaBingGroundingToolCall,
140143
RunStepDeltaChunk,
141144
RunStepDeltaCodeInterpreterDetailItemObject,
@@ -267,6 +270,7 @@
267270
"AzureFunctionBinding",
268271
"AzureFunctionDefinition",
269272
"AzureFunctionStorageQueue",
273+
"AzureFunctionToolCallDetails",
270274
"AzureFunctionToolDefinition",
271275
"BingCustomSearchConfiguration",
272276
"BingCustomSearchToolDefinition",
@@ -358,6 +362,7 @@
358362
"RunStep",
359363
"RunStepActivityDetails",
360364
"RunStepAzureAISearchToolCall",
365+
"RunStepAzureFunctionToolCall",
361366
"RunStepBingCustomSearchToolCall",
362367
"RunStepBingGroundingToolCall",
363368
"RunStepBrowserAutomationToolCall",
@@ -374,6 +379,7 @@
374379
"RunStepDeepResearchToolCallDetails",
375380
"RunStepDelta",
376381
"RunStepDeltaAzureAISearchToolCall",
382+
"RunStepDeltaAzureFunctionToolCall",
377383
"RunStepDeltaBingGroundingToolCall",
378384
"RunStepDeltaChunk",
379385
"RunStepDeltaCodeInterpreterDetailItemObject",

sdk/ai/azure-ai-agents/azure/ai/agents/models/_models.py

Lines changed: 138 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
806806
super().__init__(*args, **kwargs)
807807

808808

809+
class AzureFunctionToolCallDetails(_Model):
810+
"""The Azure function call description. All the fields are present in the completed run step,
811+
however
812+
only some fields are present in the RunStepDeltaAzureFunctionToolCall.
813+
814+
:ivar name: The Azure function name.
815+
:vartype name: str
816+
:ivar arguments: JSON serialized function arguments.
817+
:vartype arguments: str
818+
:ivar output: The function output.
819+
:vartype output: str
820+
"""
821+
822+
name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
823+
"""The Azure function name."""
824+
arguments: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
825+
"""JSON serialized function arguments."""
826+
output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
827+
"""The function output."""
828+
829+
@overload
830+
def __init__(
831+
self,
832+
*,
833+
name: Optional[str] = None,
834+
arguments: Optional[str] = None,
835+
output: Optional[str] = None,
836+
) -> None: ...
837+
838+
@overload
839+
def __init__(self, mapping: Mapping[str, Any]) -> None:
840+
"""
841+
:param mapping: raw JSON to initialize the model.
842+
:type mapping: Mapping[str, Any]
843+
"""
844+
845+
def __init__(self, *args: Any, **kwargs: Any) -> None:
846+
super().__init__(*args, **kwargs)
847+
848+
809849
class AzureFunctionToolDefinition(ToolDefinition, discriminator="azure_function"):
810850
"""The input definition information for a azure function tool as used to configure an agent.
811851
@@ -4336,8 +4376,8 @@ class RunStepToolCall(_Model):
43364376
existing run.
43374377
43384378
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
4339-
RunStepAzureAISearchToolCall, RunStepBingCustomSearchToolCall, RunStepBingGroundingToolCall,
4340-
RunStepBrowserAutomationToolCall, RunStepCodeInterpreterToolCall,
4379+
RunStepAzureAISearchToolCall, RunStepAzureFunctionToolCall, RunStepBingCustomSearchToolCall,
4380+
RunStepBingGroundingToolCall, RunStepBrowserAutomationToolCall, RunStepCodeInterpreterToolCall,
43414381
RunStepConnectedAgentToolCall, RunStepDeepResearchToolCall, RunStepMicrosoftFabricToolCall,
43424382
RunStepFileSearchToolCall, RunStepFunctionToolCall, RunStepMcpToolCall, RunStepOpenAPIToolCall,
43434383
RunStepSharepointToolCall
@@ -4414,27 +4454,67 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
44144454
super().__init__(*args, type="azure_ai_search", **kwargs)
44154455

44164456

4457+
class RunStepAzureFunctionToolCall(RunStepToolCall, discriminator="azure_function"):
4458+
"""A record of a call to an Azure Function tool.
4459+
4460+
:ivar id: The ID of the tool call. This ID must be referenced when you submit tool outputs.
4461+
Required.
4462+
:vartype id: str
4463+
:ivar type: The object type, which is always 'azure_function'. Required. Default value is
4464+
"azure_function".
4465+
:vartype type: str
4466+
:ivar azure_function: The description of an Azure function call. Required.
4467+
:vartype azure_function: ~azure.ai.agents.models.AzureFunctionToolCallDetails
4468+
"""
4469+
4470+
type: Literal["azure_function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
4471+
"""The object type, which is always 'azure_function'. Required. Default value is
4472+
\"azure_function\"."""
4473+
azure_function: "_models.AzureFunctionToolCallDetails" = rest_field(
4474+
visibility=["read", "create", "update", "delete", "query"]
4475+
)
4476+
"""The description of an Azure function call. Required."""
4477+
4478+
@overload
4479+
def __init__(
4480+
self,
4481+
*,
4482+
id: str, # pylint: disable=redefined-builtin
4483+
azure_function: "_models.AzureFunctionToolCallDetails",
4484+
) -> None: ...
4485+
4486+
@overload
4487+
def __init__(self, mapping: Mapping[str, Any]) -> None:
4488+
"""
4489+
:param mapping: raw JSON to initialize the model.
4490+
:type mapping: Mapping[str, Any]
4491+
"""
4492+
4493+
def __init__(self, *args: Any, **kwargs: Any) -> None:
4494+
super().__init__(*args, type="azure_function", **kwargs)
4495+
4496+
44174497
class RunStepBingCustomSearchToolCall(RunStepToolCall, discriminator="bing_custom_search"):
4418-
"""A record of a call to a bing custom search tool, issued by the model in evaluation of a defined
4498+
"""A record of a call to a Bing Custom Search tool, issued by the model in evaluation of a defined
44194499
tool, that represents
4420-
executed search with bing custom search.
4500+
executed search with Bing Custom Search.
44214501
44224502
:ivar id: The ID of the tool call. This ID must be referenced when you submit tool outputs.
44234503
Required.
44244504
:vartype id: str
44254505
:ivar type: The object type, which is always 'bing_custom_search'. Required. Default value is
44264506
"bing_custom_search".
44274507
:vartype type: str
4428-
:ivar bing_custom_search: The dictionary with request and response from Custom Bing Grounding
4429-
search tool. Required.
4508+
:ivar bing_custom_search: The dictionary with request and response from Bing Custom Search
4509+
tool. Required.
44304510
:vartype bing_custom_search: dict[str, str]
44314511
"""
44324512

44334513
type: Literal["bing_custom_search"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
44344514
"""The object type, which is always 'bing_custom_search'. Required. Default value is
44354515
\"bing_custom_search\"."""
44364516
bing_custom_search: Dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
4437-
"""The dictionary with request and response from Custom Bing Grounding search tool. Required."""
4517+
"""The dictionary with request and response from Bing Custom Search tool. Required."""
44384518

44394519
@overload
44404520
def __init__(
@@ -4987,11 +5067,11 @@ class RunStepDeltaToolCall(_Model):
49875067
call details.
49885068
49895069
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
4990-
RunStepDeltaAzureAISearchToolCall, RunStepDeltaCustomBingGroundingToolCall,
4991-
RunStepDeltaBingGroundingToolCall, RunStepDeltaCodeInterpreterToolCall,
4992-
RunStepDeltaConnectedAgentToolCall, RunStepDeltaDeepResearchToolCall,
4993-
RunStepDeltaFileSearchToolCall, RunStepDeltaFunctionToolCall, RunStepDeltaMcpToolCall,
4994-
RunStepDeltaOpenAPIToolCall
5070+
RunStepDeltaAzureAISearchToolCall, RunStepDeltaAzureFunctionToolCall,
5071+
RunStepDeltaCustomBingGroundingToolCall, RunStepDeltaBingGroundingToolCall,
5072+
RunStepDeltaCodeInterpreterToolCall, RunStepDeltaConnectedAgentToolCall,
5073+
RunStepDeltaDeepResearchToolCall, RunStepDeltaFileSearchToolCall, RunStepDeltaFunctionToolCall,
5074+
RunStepDeltaMcpToolCall, RunStepDeltaOpenAPIToolCall
49955075
49965076
:ivar index: The index of the tool call detail in the run step's tool_calls array. Required.
49975077
:vartype index: int
@@ -5071,6 +5151,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
50715151
super().__init__(*args, type="azure_ai_search", **kwargs)
50725152

50735153

5154+
class RunStepDeltaAzureFunctionToolCall(RunStepDeltaToolCall, discriminator="azure_function"):
5155+
"""Represents the Azure Function tool call in a streaming run step.
5156+
5157+
:ivar index: The index of the tool call detail in the run step's tool_calls array. Required.
5158+
:vartype index: int
5159+
:ivar id: The ID of the tool call, used when submitting outputs to the run. Required.
5160+
:vartype id: str
5161+
:ivar type: The object type, which is always 'azure_function'. Required. Default value is
5162+
"azure_function".
5163+
:vartype type: str
5164+
:ivar azure_function: Partial description of an Azure function call. Required.
5165+
:vartype azure_function: ~azure.ai.agents.models.AzureFunctionToolCallDetails
5166+
"""
5167+
5168+
type: Literal["azure_function"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
5169+
"""The object type, which is always 'azure_function'. Required. Default value is
5170+
\"azure_function\"."""
5171+
azure_function: "_models.AzureFunctionToolCallDetails" = rest_field(
5172+
visibility=["read", "create", "update", "delete", "query"]
5173+
)
5174+
"""Partial description of an Azure function call. Required."""
5175+
5176+
@overload
5177+
def __init__(
5178+
self,
5179+
*,
5180+
index: int,
5181+
id: str, # pylint: disable=redefined-builtin
5182+
azure_function: "_models.AzureFunctionToolCallDetails",
5183+
) -> None: ...
5184+
5185+
@overload
5186+
def __init__(self, mapping: Mapping[str, Any]) -> None:
5187+
"""
5188+
:param mapping: raw JSON to initialize the model.
5189+
:type mapping: Mapping[str, Any]
5190+
"""
5191+
5192+
def __init__(self, *args: Any, **kwargs: Any) -> None:
5193+
super().__init__(*args, type="azure_function", **kwargs)
5194+
5195+
50745196
class RunStepDeltaBingGroundingToolCall(RunStepDeltaToolCall, discriminator="bing_grounding"):
50755197
"""Represents the bing grounding tool call in a streaming run step.
50765198
@@ -5423,7 +5545,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
54235545

54245546

54255547
class RunStepDeltaCustomBingGroundingToolCall(RunStepDeltaToolCall, discriminator="bing_custom_search"):
5426-
"""Represents the Custom Bing Grounding tool call in a streaming run step.
5548+
"""Represents the Bing Custom Search tool call in a streaming run step.
54275549
54285550
:ivar index: The index of the tool call detail in the run step's tool_calls array. Required.
54295551
:vartype index: int
@@ -5432,16 +5554,16 @@ class RunStepDeltaCustomBingGroundingToolCall(RunStepDeltaToolCall, discriminato
54325554
:ivar type: The object type, which is always 'bing_custom_search'. Required. Default value is
54335555
"bing_custom_search".
54345556
:vartype type: str
5435-
:ivar bing_custom_search: The dictionary with request and response from Custom Bing Grounding
5436-
search tool. Required.
5557+
:ivar bing_custom_search: The dictionary with request and response from Bing Custom Search
5558+
tool. Required.
54375559
:vartype bing_custom_search: dict[str, str]
54385560
"""
54395561

54405562
type: Literal["bing_custom_search"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
54415563
"""The object type, which is always 'bing_custom_search'. Required. Default value is
54425564
\"bing_custom_search\"."""
54435565
bing_custom_search: Dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
5444-
"""The dictionary with request and response from Custom Bing Grounding search tool. Required."""
5566+
"""The dictionary with request and response from Bing Custom Search tool. Required."""
54455567

54465568
@overload
54475569
def __init__(

0 commit comments

Comments
 (0)