Skip to content

Commit 9766f85

Browse files
feat(api): error and error_code as types
1 parent 1187ec7 commit 9766f85

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-39e18bbb8b0af73eca7a880f56afbdecd69e3e5bab82a04c4d6429c32d7e6727.yml
33
openapi_spec_hash: 7a0de988bb37416d6e80f4a4bbe9d0d0
4-
config_hash: 0884847870200ee9d34bb00ce94aaa8e
4+
config_hash: 38ab203e1bd97a9bb22bbf744bcb5808

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ from oz_agent_sdk.types import (
77
AgentSkill,
88
AmbientAgentConfig,
99
CloudEnvironmentConfig,
10+
Error,
11+
ErrorCode,
1012
McpServerConfig,
1113
Scope,
1214
UserProfile,

src/oz_agent_sdk/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from .scope import Scope as Scope
6+
from .error_code import ErrorCode as ErrorCode
67
from .agent_skill import AgentSkill as AgentSkill
78
from .user_profile import UserProfile as UserProfile
89
from .agent_run_params import AgentRunParams as AgentRunParams

src/oz_agent_sdk/types/agent/run_item.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from typing import List, Optional
44
from datetime import datetime
5-
from typing_extensions import Literal
65

76
from ..scope import Scope
87
from ..._models import BaseModel
98
from .run_state import RunState
9+
from ..error_code import ErrorCode
1010
from ..user_profile import UserProfile
1111
from .artifact_item import ArtifactItem
1212
from .run_source_type import RunSourceType
@@ -69,26 +69,7 @@ class StatusMessage(BaseModel):
6969
message: str
7070
"""Human-readable status message"""
7171

72-
error_code: Optional[
73-
Literal[
74-
"insufficient_credits",
75-
"feature_not_available",
76-
"external_authentication_required",
77-
"not_authorized",
78-
"invalid_request",
79-
"resource_not_found",
80-
"budget_exceeded",
81-
"integration_disabled",
82-
"integration_not_configured",
83-
"operation_not_supported",
84-
"environment_setup_failed",
85-
"content_policy_violation",
86-
"conflict",
87-
"authentication_required",
88-
"resource_unavailable",
89-
"internal_error",
90-
]
91-
] = None
72+
error_code: Optional[ErrorCode] = None
9273
"""
9374
Machine-readable error code identifying the problem type. Used in the `type` URI
9475
of Error responses and in the `error_code` field of RunStatusMessage.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal, TypeAlias
4+
5+
__all__ = ["ErrorCode"]
6+
7+
ErrorCode: TypeAlias = Literal[
8+
"insufficient_credits",
9+
"feature_not_available",
10+
"external_authentication_required",
11+
"not_authorized",
12+
"invalid_request",
13+
"resource_not_found",
14+
"budget_exceeded",
15+
"integration_disabled",
16+
"integration_not_configured",
17+
"operation_not_supported",
18+
"environment_setup_failed",
19+
"content_policy_violation",
20+
"conflict",
21+
"authentication_required",
22+
"resource_unavailable",
23+
"internal_error",
24+
]

0 commit comments

Comments
 (0)