AssistantMessage
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| BaseModel pydantic.main !!! abstract "Usage Documentation" |
â‹” Inheritance diagram¶
graph TD
2152708347["messages.AssistantMessage"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
3879467795 --> 2152708347
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: BaseModel
Assistant message with content blocks.
Source code in src/clawd_code_sdk/models/messages.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
aborted
class-attribute
instance-attribute
¶
Set when the turn was aborted while this message was streaming.
api_error_origin
class-attribute
instance-attribute
¶
first_party when Anthropic's own API sent the error response.
api_error_params
class-attribute
instance-attribute
¶
api_error_params: ApiErrorParams | None = None
Parameters of the API error, for the error kinds that have any.
api_error_status
class-attribute
instance-attribute
¶
HTTP status code of the API error when is_api_error_message is true.
api_error_type
class-attribute
instance-attribute
¶
The error.type of the API error response body, e.g. rate_limit_error.
is_api_error_message
class-attribute
instance-attribute
¶
True when this assistant message wraps an API error (undocumented).
request_id
class-attribute
instance-attribute
¶
API request ID that produced this message.
supersedes
class-attribute
instance-attribute
¶
UUIDs of previously emitted assistant messages this one replaces.
thinking_display
class-attribute
instance-attribute
¶
Active thinking display mode (undocumented).
thinking_duration_ms
class-attribute
instance-attribute
¶
How long the model spent thinking for this message (undocumented).
tool_use_meta
class-attribute
instance-attribute
¶
tool_use_meta: list[ToolUseMeta] | None = None
Display metadata for the tool_use blocks in this message (undocumented).
user_message_uuid
class-attribute
instance-attribute
¶
UUID of the user message this assistant message responds to.
user_message_uuids
class-attribute
instance-attribute
¶
UUIDs of all user messages this assistant message responds to (batched turns).
wire_ingest_context
class-attribute
instance-attribute
¶
Per-tool_use ingest context (e.g. cwd), keyed by tool_use ID (undocumented).
wire_tool_inputs
class-attribute
instance-attribute
¶
Tool inputs as sent on the wire, keyed by tool_use ID (undocumented).
raise_if_api_error
¶
Raise the appropriate API exception if error is set.
Source code in src/clawd_code_sdk/models/messages.py
to_otel
¶
Convert SDK content block objects into semconv OutputMessages.