This commit is contained in:
张成
2026-02-28 17:38:45 +08:00
parent 5ec4e7f440
commit a40219c7e4
5 changed files with 802 additions and 44 deletions

View File

@@ -0,0 +1,81 @@
const Sequelize = require('sequelize');
/**
* 沟通回复意图 AI 调用记录
* 记录 getReplyContentFromDetail 中 replyIntentAndContent 的入参与结果,便于排查与统计
*/
module.exports = (db) => {
const chat_reply_intent_log = db.define('chat_reply_intent_log', {
sn_code: {
comment: '设备SN码',
type: Sequelize.STRING(50),
allowNull: true,
defaultValue: ''
},
platform: {
comment: '平台: boss / liepin',
type: Sequelize.STRING(20),
allowNull: true,
defaultValue: 'boss'
},
friendId: {
comment: '好友/会话ID',
type: Sequelize.BIGINT,
allowNull: true
},
encrypt_friend_id: {
comment: '好友加密ID',
type: Sequelize.STRING(100),
allowNull: true,
defaultValue: ''
},
hr_message_text: {
comment: 'HR 最新消息原文AI 入参)',
type: Sequelize.TEXT,
allowNull: true
},
action: {
comment: 'AI 返回意图: no_reply/text/send_resume/exchange_wechat/exchange_phone',
type: Sequelize.STRING(30),
allowNull: true,
defaultValue: ''
},
reply_content: {
comment: 'AI 返回的回复文案',
type: Sequelize.TEXT,
allowNull: true
},
replied: {
comment: '是否执行了回复',
type: Sequelize.BOOLEAN,
allowNull: true,
defaultValue: false
},
reason: {
comment: '未回复时的原因',
type: Sequelize.STRING(200),
allowNull: true
},
job_name: {
comment: '职位名称(便于排查)',
type: Sequelize.STRING(200),
allowNull: true
},
create_time: {
comment: '创建时间',
type: Sequelize.DATE,
allowNull: true,
defaultValue: Sequelize.NOW
}
}, {
timestamps: false,
indexes: [
{ unique: false, fields: ['sn_code', 'platform', 'friendId'] },
{ unique: false, fields: ['create_time'] }
]
});
// chat_reply_intent_log.sync({ force: true });
return chat_reply_intent_log;
};