# -*- coding: utf-8 -*-"""The model response module."""fromdataclassesimportdataclass,fieldfromtypingimportLiteral,Sequencefromanthropic.typesimportThinkingBlockfrom._model_usageimportChatUsagefrom.._utils._commonimport_get_timestampfrom.._utils._mixinimportDictMixinfrom..messageimportTextBlock,ToolUseBlock
[docs]@dataclassclassChatResponse(DictMixin):"""The response of chat models."""content:Sequence[TextBlock|ToolUseBlock|ThinkingBlock]"""The content of the chat response, which can include text blocks, tool use blocks, or thinking blocks."""id:str=field(default_factory=lambda:_get_timestamp(True))"""The unique identifier formatter """created_at:str=field(default_factory=_get_timestamp)"""When the response was created"""type:Literal["chat"]=field(default_factory=lambda:"chat")"""The type of the response, which is always 'chat'."""usage:ChatUsage|None=field(default_factory=lambda:None)"""The usage information of the chat response, if available."""