normalizeAiAgentReplyFormat
归一化 ai_agents.reply_format 与 IM 落库消息 type 映射。
函数签名
typescript
type AiAgentReplyFormat = 'markdown' | 'text' | 'json'
function normalizeAiAgentReplyFormat(
replyFormatRaw: string | undefined | null,
): AiAgentReplyFormat
function imPersistedMessageTypeForReplyFormat(
format: AiAgentReplyFormat,
): 'markdown' | 'text'工作原理
- 未知值回退
markdown。 - 落库时
json与text均存为texttype(仅markdown保留 markdown)。