Skip to content

Commit 8fe0488

Browse files
dargilcoCopilot
andauthored
Re-emit Python SDK from TypeSpec commit 94f9262ac1a8 (#46531)
Emit from latest commit in feature/foundry-release branch: - Rename job status to 'cancelled' (#42637) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 026d2aa commit 8fe0488

6 files changed

Lines changed: 132 additions & 27 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
"azure.ai.projects.models.EvaluatorMetric": "Azure.AI.Projects.EvaluatorMetric",
121121
"azure.ai.projects.models.EvaluatorVersion": "Azure.AI.Projects.EvaluatorVersion",
122122
"azure.ai.projects.models.FabricDataAgentToolParameters": "Azure.AI.Projects.FabricDataAgentToolParameters",
123+
"azure.ai.projects.models.FabricIQPreviewTool": "Azure.AI.Projects.FabricIQPreviewTool",
124+
"azure.ai.projects.models.FabricIQPreviewToolParameters": "Azure.AI.Projects.FabricIQPreviewToolParameters",
123125
"azure.ai.projects.models.FieldMapping": "Azure.AI.Projects.FieldMapping",
124126
"azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion",
125127
"azure.ai.projects.models.FileSearchTool": "OpenAI.FileSearchTool",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
EvaluatorMetric,
121121
EvaluatorVersion,
122122
FabricDataAgentToolParameters,
123+
FabricIQPreviewTool,
124+
FabricIQPreviewToolParameters,
123125
FieldMapping,
124126
FileDatasetVersion,
125127
FileSearchTool,
@@ -441,6 +443,8 @@
441443
"EvaluatorMetric",
442444
"EvaluatorVersion",
443445
"FabricDataAgentToolParameters",
446+
"FabricIQPreviewTool",
447+
"FabricIQPreviewToolParameters",
444448
"FieldMapping",
445449
"FileDatasetVersion",
446450
"FileSearchTool",

sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
840840
"""MEMORY_SEARCH_PREVIEW."""
841841
WORK_IQ_PREVIEW = "work_iq_preview"
842842
"""WORK_IQ_PREVIEW."""
843+
FABRIC_IQ_PREVIEW = "fabric_iq_preview"
844+
"""FABRIC_IQ_PREVIEW."""
843845
AZURE_AI_SEARCH = "azure_ai_search"
844846
"""AZURE_AI_SEARCH."""
845847
AZURE_FUNCTION = "azure_function"

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

Lines changed: 99 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ class Tool(_Model):
5959
A2APreviewTool, ApplyPatchToolParam, AzureAISearchTool, AzureFunctionTool,
6060
BingCustomSearchPreviewTool, BingGroundingTool, BrowserAutomationPreviewTool,
6161
CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerUsePreviewTool, CustomToolParam,
62-
MicrosoftFabricPreviewTool, FileSearchTool, FunctionTool, ImageGenTool, LocalShellToolParam,
63-
MCPTool, MemorySearchPreviewTool, OpenApiTool, SharepointPreviewTool, FunctionShellToolParam,
64-
WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool
62+
MicrosoftFabricPreviewTool, FabricIQPreviewTool, FileSearchTool, FunctionTool, ImageGenTool,
63+
LocalShellToolParam, MCPTool, MemorySearchPreviewTool, OpenApiTool, SharepointPreviewTool,
64+
FunctionShellToolParam, WebSearchTool, WebSearchPreviewTool, WorkIQPreviewTool
6565
6666
:ivar type: Required. Known values are: "function", "file_search", "computer_use_preview",
6767
"web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom",
6868
"web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview",
6969
"browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview",
70-
"memory_search_preview", "work_iq_preview", "azure_ai_search", "azure_function",
71-
"bing_grounding", "capture_structured_outputs", and "openapi".
70+
"memory_search_preview", "work_iq_preview", "fabric_iq_preview", "azure_ai_search",
71+
"azure_function", "bing_grounding", "capture_structured_outputs", and "openapi".
7272
:vartype type: str or ~azure.ai.projects.models.ToolType
7373
"""
7474

@@ -79,8 +79,8 @@ class Tool(_Model):
7979
\"shell\", \"custom\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\",
8080
\"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\",
8181
\"sharepoint_grounding_preview\", \"memory_search_preview\", \"work_iq_preview\",
82-
\"azure_ai_search\", \"azure_function\", \"bing_grounding\", \"capture_structured_outputs\",
83-
and \"openapi\"."""
82+
\"fabric_iq_preview\", \"azure_ai_search\", \"azure_function\", \"bing_grounding\",
83+
\"capture_structured_outputs\", and \"openapi\"."""
8484

8585
@overload
8686
def __init__(
@@ -2699,13 +2699,21 @@ class CodeConfiguration(_Model):
26992699
:vartype runtime: str
27002700
:ivar entry_point: The entry point command and arguments for the code execution. Required.
27012701
:vartype entry_point: list[str]
2702+
:ivar content_hash: The SHA-256 hex digest of the uploaded code zip. Set by the service from
2703+
the ``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in
2704+
request payloads.
2705+
:vartype content_hash: str
27022706
"""
27032707

27042708
runtime: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
27052709
"""The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13').
27062710
Required."""
27072711
entry_point: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
27082712
"""The entry point command and arguments for the code execution. Required."""
2713+
content_hash: Optional[str] = rest_field(visibility=["read"])
2714+
"""The SHA-256 hex digest of the uploaded code zip. Set by the service from the
2715+
``x-ms-code-zip-sha256`` request header; read-only in responses and never accepted in request
2716+
payloads."""
27092717

27102718
@overload
27112719
def __init__(
@@ -5051,6 +5059,90 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
50515059
super().__init__(*args, **kwargs)
50525060

50535061

5062+
class FabricIQPreviewTool(Tool, discriminator="fabric_iq_preview"):
5063+
"""FabricIQPreviewTool.
5064+
5065+
:ivar type: The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW.
5066+
:vartype type: str or ~azure.ai.projects.models.FABRIC_IQ_PREVIEW
5067+
:ivar fabric_iq_preview: The FabricIQ tool parameters. Required.
5068+
:vartype fabric_iq_preview: ~azure.ai.projects.models.FabricIQPreviewToolParameters
5069+
"""
5070+
5071+
type: Literal[ToolType.FABRIC_IQ_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
5072+
"""The object type, which is always 'fabric_iq_preview'. Required. FABRIC_IQ_PREVIEW."""
5073+
fabric_iq_preview: "_models.FabricIQPreviewToolParameters" = rest_field(
5074+
visibility=["read", "create", "update", "delete", "query"]
5075+
)
5076+
"""The FabricIQ tool parameters. Required."""
5077+
5078+
@overload
5079+
def __init__(
5080+
self,
5081+
*,
5082+
fabric_iq_preview: "_models.FabricIQPreviewToolParameters",
5083+
) -> None: ...
5084+
5085+
@overload
5086+
def __init__(self, mapping: Mapping[str, Any]) -> None:
5087+
"""
5088+
:param mapping: raw JSON to initialize the model.
5089+
:type mapping: Mapping[str, Any]
5090+
"""
5091+
5092+
def __init__(self, *args: Any, **kwargs: Any) -> None:
5093+
super().__init__(*args, **kwargs)
5094+
self.type = ToolType.FABRIC_IQ_PREVIEW # type: ignore
5095+
5096+
5097+
class FabricIQPreviewToolParameters(_Model):
5098+
"""FabricIQPreviewToolParameters.
5099+
5100+
:ivar project_connection_id: The ID of the FabricIQ project connection. Required.
5101+
:vartype project_connection_id: str
5102+
:ivar server_label: (Optional) The label of the FabricIQ MCP server to connect to.
5103+
:vartype server_label: str
5104+
:ivar server_url: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from
5105+
the project connection will be used.
5106+
:vartype server_url: str
5107+
:ivar require_approval: (Optional) Whether the agent requires approval before executing
5108+
actions. Default is always. Is either a MCPToolRequireApproval type or a str type.
5109+
:vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str
5110+
"""
5111+
5112+
project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
5113+
"""The ID of the FabricIQ project connection. Required."""
5114+
server_label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
5115+
"""(Optional) The label of the FabricIQ MCP server to connect to."""
5116+
server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
5117+
"""(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project
5118+
connection will be used."""
5119+
require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = rest_field(
5120+
visibility=["read", "create", "update", "delete", "query"]
5121+
)
5122+
"""(Optional) Whether the agent requires approval before executing actions. Default is always. Is
5123+
either a MCPToolRequireApproval type or a str type."""
5124+
5125+
@overload
5126+
def __init__(
5127+
self,
5128+
*,
5129+
project_connection_id: str,
5130+
server_label: Optional[str] = None,
5131+
server_url: Optional[str] = None,
5132+
require_approval: Optional[Union["_models.MCPToolRequireApproval", str]] = None,
5133+
) -> None: ...
5134+
5135+
@overload
5136+
def __init__(self, mapping: Mapping[str, Any]) -> None:
5137+
"""
5138+
:param mapping: raw JSON to initialize the model.
5139+
:type mapping: Mapping[str, Any]
5140+
"""
5141+
5142+
def __init__(self, *args: Any, **kwargs: Any) -> None:
5143+
super().__init__(*args, **kwargs)
5144+
5145+
50545146
class FieldMapping(_Model):
50555147
"""Field mapping configuration class.
50565148
@@ -5513,25 +5605,14 @@ class HeaderIsolationKeySource(IsolationKeySource, discriminator="Header"):
55135605
55145606
:ivar kind: Required. HEADER.
55155607
:vartype kind: str or ~azure.ai.projects.models.HEADER
5516-
:ivar user_isolation_key: The user isolation key header value. Required.
5517-
:vartype user_isolation_key: str
5518-
:ivar chat_isolation_key: The chat isolation key header value. Required.
5519-
:vartype chat_isolation_key: str
55205608
"""
55215609

55225610
kind: Literal[IsolationKeySourceKind.HEADER] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore
55235611
"""Required. HEADER."""
5524-
user_isolation_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
5525-
"""The user isolation key header value. Required."""
5526-
chat_isolation_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
5527-
"""The chat isolation key header value. Required."""
55285612

55295613
@overload
55305614
def __init__(
55315615
self,
5532-
*,
5533-
user_isolation_key: str,
5534-
chat_isolation_key: str,
55355616
) -> None: ...
55365617

55375618
@overload

sdk/ai/azure-ai-projects/tests/samples/llm_instructions.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
from typing import Final
2020

21-
agent_tools_instructions: Final[str] = """
21+
agent_tools_instructions: Final[str] = (
22+
"""
2223
We just ran Python code and captured print/log output in an attached log file (TXT).
2324
Validate whether sample execution/output is correct for a tool-driven assistant workflow.
2425
@@ -43,9 +44,11 @@
4344
4445
Always include `reason` with a concise explanation tied to the observed print output.
4546
""".strip()
47+
)
4648

4749

48-
memories_instructions: Final[str] = """
50+
memories_instructions: Final[str] = (
51+
"""
4952
We just ran Python code and captured print/log output in an attached log file (TXT).
5053
Validate whether sample execution/output is correct for a memories workflow.
5154
@@ -70,9 +73,11 @@
7073
7174
Always include `reason` with a concise explanation tied to the observed print output.
7275
""".strip()
76+
)
7377

7478

75-
agents_instructions: Final[str] = """
79+
agents_instructions: Final[str] = (
80+
"""
7681
We just ran Python code and captured print/log output in an attached log file (TXT).
7782
Validate whether sample execution/output is correct.
7883
@@ -103,9 +108,11 @@
103108
104109
Always include `reason` with a concise explanation tied to the observed print output.
105110
""".strip()
111+
)
106112

107113

108-
chat_completions_instructions: Final[str] = """
114+
chat_completions_instructions: Final[str] = (
115+
"""
109116
We just ran Python code and captured print/log output in an attached log file (TXT).
110117
Validate whether sample execution/output is correct for Chat Completions scenarios.
111118
@@ -124,9 +131,11 @@
124131
125132
Always include `reason` with a concise explanation tied to the observed print output.
126133
""".strip()
134+
)
127135

128136

129-
resource_management_instructions: Final[str] = """
137+
resource_management_instructions: Final[str] = (
138+
"""
130139
We just ran Python code and captured print/log output in an attached log file (TXT).
131140
Validate whether sample execution/output is correct for resource-management samples (for example
132141
connections, files, and deployments).
@@ -152,9 +161,11 @@
152161
153162
Always include `reason` with a concise explanation tied to the observed print output.
154163
""".strip()
164+
)
155165

156166

157-
fine_tuning_instructions: Final[str] = """
167+
fine_tuning_instructions: Final[str] = (
168+
"""
158169
We just ran Python code and captured print/log output in an attached log file (TXT).
159170
Validate whether sample execution/output is correct for a fine-tuning workflow.
160171
@@ -178,9 +189,11 @@
178189
179190
Always include `reason` with a concise explanation tied to the observed print output.
180191
""".strip()
192+
)
181193

182194

183-
evaluations_instructions: Final[str] = """
195+
evaluations_instructions: Final[str] = (
196+
"""
184197
We just ran Python code for an evaluation sample and captured print/log output in an attached log file (TXT).
185198
Your job: determine if the sample code executed to completion WITHOUT throwing an unhandled exception.
186199
@@ -202,9 +215,11 @@
202215
203216
Always respond with `reason` indicating the reason for the response.
204217
""".strip()
218+
)
205219

206220

207-
hosted_agents_instructions: Final[str] = """
221+
hosted_agents_instructions: Final[str] = (
222+
"""
208223
We just ran Python code for a hosted-agent sample and captured print/log output in an attached log file (TXT).
209224
Validate whether the sample executed correctly.
210225
@@ -226,6 +241,7 @@
226241
227242
Always include `reason` with a concise explanation tied to the observed print output.
228243
""".strip()
244+
)
229245

230246

231247
# Folder (under samples/) -> instructions.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
directory: specification/ai-foundry/data-plane/Foundry
2-
commit: 9f045138c73bf7aa13ee59b805cd9143dbb77835
2+
commit: 94f9262ac1a87141d3367df1dcb9cc6acf433dfc
33
repo: Azure/azure-rest-api-specs
44
additionalDirectories:

0 commit comments

Comments
 (0)