Skip to content

Commit b0fb5b0

Browse files
Add AssistantMessageError type (#352)
This brings Python to parity with anthropics/claude-cli-internal#10358.
1 parent ab83878 commit b0fb5b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/claude_agent_sdk/types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,16 @@ class ToolResultBlock:
457457

458458

459459
# Message types
460+
AssistantMessageError = Literal[
461+
"authentication_failed",
462+
"billing_error",
463+
"rate_limit",
464+
"invalid_request",
465+
"server_error",
466+
"unknown",
467+
]
468+
469+
460470
@dataclass
461471
class UserMessage:
462472
"""User message."""
@@ -472,6 +482,7 @@ class AssistantMessage:
472482
content: list[ContentBlock]
473483
model: str
474484
parent_tool_use_id: str | None = None
485+
error: AssistantMessageError | None = None
475486

476487

477488
@dataclass

0 commit comments

Comments
 (0)