Skip to content

Commit 0ccf1d5

Browse files
authored
Update agent error details (#41092)
* update agent error details * update ChangeLog
1 parent 6c8e7cb commit 0ccf1d5

File tree

6 files changed

+57
-47
lines changed

6 files changed

+57
-47
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.0.0b3 (2025-05-14)
4+
5+
### Features Added
6+
7+
- Internal updates based on TypeSpec finalization.
8+
39
## 1.0.0b2 (2025-05-13)
410

511
### Breaking Changes

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"CrossLanguagePackageId": "Azure.AI.Agents",
33
"CrossLanguageDefinitionId": {
44
"azure.ai.agents.models.Agent": "Azure.AI.Agents.Agent",
5+
"azure.ai.agents.models.AgentErrorDetail": "Azure.AI.Agents.AgentErrorDetail",
56
"azure.ai.agents.models.AgentsNamedToolChoice": "Azure.AI.Agents.AgentsNamedToolChoice",
67
"azure.ai.agents.models.AgentsResponseFormat": "Azure.AI.Agents.AgentsResponseFormat",
78
"azure.ai.agents.models.AgentThread": "Azure.AI.Agents.AgentThread",
89
"azure.ai.agents.models.AgentThreadCreationOptions": "Azure.AI.Agents.AgentThreadCreationOptions",
910
"azure.ai.agents.models.AgentV1Error": "Azure.AI.Agents.AgentV1Error",
10-
"azure.ai.agents.models.AgentV1ErrorError": "Azure.AI.Agents.AgentV1Error.error.anonymous",
1111
"azure.ai.agents.models.AISearchIndexResource": "Azure.AI.Agents.AISearchIndexResource",
1212
"azure.ai.agents.models.ToolDefinition": "Azure.AI.Agents.ToolDefinition",
1313
"azure.ai.agents.models.AzureAISearchToolDefinition": "Azure.AI.Agents.AzureAISearchToolDefinition",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0b2"
9+
VERSION = "1.0.0b3"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
from ._models import ( # type: ignore
1717
AISearchIndexResource,
1818
Agent,
19+
AgentErrorDetail,
1920
AgentThread,
2021
AgentThreadCreationOptions,
2122
AgentV1Error,
22-
AgentV1ErrorError,
2323
AgentsNamedToolChoice,
2424
AgentsResponseFormat,
2525
AzureAISearchToolDefinition,
@@ -207,10 +207,10 @@
207207
__all__ = [
208208
"AISearchIndexResource",
209209
"Agent",
210+
"AgentErrorDetail",
210211
"AgentThread",
211212
"AgentThreadCreationOptions",
212213
"AgentV1Error",
213-
"AgentV1ErrorError",
214214
"AgentsNamedToolChoice",
215215
"AgentsResponseFormat",
216216
"AzureAISearchToolDefinition",

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

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
187187
self.object: Literal["assistant.deleted"] = "assistant.deleted"
188188

189189

190+
class AgentErrorDetail(_Model):
191+
"""Describes the error information returned by the agents API.
192+
193+
:ivar message: Human-readable description of the error.
194+
:vartype message: str
195+
:ivar type: Error type identifier (e.g. ``invalid_request_error``).
196+
:vartype type: str
197+
:ivar param: Name of the parameter that caused the error, if applicable.
198+
:vartype param: str
199+
:ivar code: Machine-readable error code.
200+
:vartype code: str
201+
"""
202+
203+
message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
204+
"""Human-readable description of the error."""
205+
type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
206+
"""Error type identifier (e.g. ``invalid_request_error``)."""
207+
param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
208+
"""Name of the parameter that caused the error, if applicable."""
209+
code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
210+
"""Machine-readable error code."""
211+
212+
@overload
213+
def __init__(
214+
self,
215+
*,
216+
message: Optional[str] = None,
217+
type: Optional[str] = None,
218+
param: Optional[str] = None,
219+
code: Optional[str] = None,
220+
) -> None: ...
221+
222+
@overload
223+
def __init__(self, mapping: Mapping[str, Any]) -> None:
224+
"""
225+
:param mapping: raw JSON to initialize the model.
226+
:type mapping: Mapping[str, Any]
227+
"""
228+
229+
def __init__(self, *args: Any, **kwargs: Any) -> None:
230+
super().__init__(*args, **kwargs)
231+
232+
190233
class AgentsNamedToolChoice(_Model):
191234
"""Specifies a tool the model should use. Use to force the model to call a specific tool.
192235
@@ -380,56 +423,17 @@ class AgentV1Error(_Model):
380423
"""Error payload returned by the agents API.
381424
382425
:ivar error: Represents the error. Required.
383-
:vartype error: ~azure.ai.agents.models.AgentV1ErrorError
426+
:vartype error: ~azure.ai.agents.models.AgentErrorDetail
384427
"""
385428

386-
error: "_models.AgentV1ErrorError" = rest_field(visibility=["read", "create", "update", "delete", "query"])
429+
error: "_models.AgentErrorDetail" = rest_field(visibility=["read", "create", "update", "delete", "query"])
387430
"""Represents the error. Required."""
388431

389432
@overload
390433
def __init__(
391434
self,
392435
*,
393-
error: "_models.AgentV1ErrorError",
394-
) -> None: ...
395-
396-
@overload
397-
def __init__(self, mapping: Mapping[str, Any]) -> None:
398-
"""
399-
:param mapping: raw JSON to initialize the model.
400-
:type mapping: Mapping[str, Any]
401-
"""
402-
403-
def __init__(self, *args: Any, **kwargs: Any) -> None:
404-
super().__init__(*args, **kwargs)
405-
406-
407-
class AgentV1ErrorError(_Model):
408-
"""AgentV1ErrorError.
409-
410-
:ivar message:
411-
:vartype message: str
412-
:ivar type:
413-
:vartype type: str
414-
:ivar param:
415-
:vartype param: str
416-
:ivar code:
417-
:vartype code: str
418-
"""
419-
420-
message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
421-
type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
422-
param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
423-
code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
424-
425-
@overload
426-
def __init__(
427-
self,
428-
*,
429-
message: Optional[str] = None,
430-
type: Optional[str] = None,
431-
param: Optional[str] = None,
432-
code: Optional[str] = None,
436+
error: "_models.AgentErrorDetail",
433437
) -> None: ...
434438

435439
@overload
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
directory: specification/ai/Azure.AI.Agents
2-
commit: fc0116e3fbb1ecd647a4f412f5e82eb30c11ad51
2+
commit: b9b2b55cc99daf6e107471448a281a03e83884ec
33
repo: Azure/azure-rest-api-specs
44
additionalDirectories:

0 commit comments

Comments
 (0)