Files
autoAiWorkSys/api/model/chat_reply_intent_log.js
张成 8a953eb769 1
2026-02-28 17:58:03 +08:00

88 lines
2.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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: ''
},
security_id: {
comment: 'HR 消息唯一 id用于去重同一消息只调用一次 AI',
type: Sequelize.STRING(500),
allowNull: true
},
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: true, fields: ['security_id'], name: 'uk_security_id' },
{ unique: false, fields: ['sn_code', 'platform', 'friendId'] },
{ unique: false, fields: ['create_time'] }
]
});
// chat_reply_intent_log.sync({ force: true });
return chat_reply_intent_log;
};