Skip to content

消息类型 ​

源码路径: nahida_bot_sdk.messaging

Normalized message types for nahida-bot plugin communication.


类 ​

InboundAttachment ​

First-class inbound media object from an external platform.

字段类型默认值描述
kindstr—
platform_idstr—
urlstr''
pathstr''
mime_typestr''
file_sizeint0
widthint0
heightint0
alt_textstr''
metadatadict[str, object]{}

SenderContext ​

Short, provider-safe facts about the sender of one inbound message.

字段类型默认值描述
display_namestr''
platform_user_idstr''
role_tagstuple[str, ...]()
is_botboolFalse
is_selfboolFalse

ChatContext ​

Short, provider-safe facts about the chat that produced one message.

字段类型默认值描述
platformstr''
chat_typestr'unknown'
platform_chat_idstr''
display_namestr''

MessageContext ​

Per-turn facts rendered as structured LLM-visible context data.

字段类型默认值描述
timestampfloat0.0
channelstr''
chat_typestr'unknown'
chat_idstr''
chat_display_namestr''
sender_idstr''
sender_display_namestr''
sender_role_tagstuple[str, ...]()
extra_tagstuple[str, ...]()

InboundMessage ​

Normalized message received from an external platform.

字段类型默认值描述
message_idstr—
platformstr—
chat_idstr—
user_idstr—
textstr—
raw_eventdict[str, Any]—
is_groupboolFalse
reply_tostr''
timestampfloat0.0
command_prefixstr'/'
attachmentslist[InboundAttachment][]
sender_context`SenderContextNone`None
chat_context`ChatContextNone`None
message_context`MessageContextNone`None
mentions_botboolFalse
mentioned_user_idstuple[str, ...]()

MediaDownloadResult ​

Result of downloading a media file from a platform.

字段类型默认值描述
pathstr—
file_namestr''
mime_typestr''
file_sizeint0

Attachment ​

A file attachment for an outbound message.

字段类型默认值描述
typestr—
pathstr—
filenamestr''
mime_typestr''
captionstr''
extradict[str, Any]{}

OutboundMessage ​

Normalized message to send to an external platform.

字段类型默认值描述
textstr—
reply_tostr''
reasoningstr''
extradict[str, Any]{}
attachmentslist[Attachment][]