Files
customer-server/model/entity/ragflow_config.go
2026-03-14 10:02:49 +08:00

47 lines
2.3 KiB
Go
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.
// Package entity - RAGFlow配置实体
// 功能客服账号级RAGFlow配置每个客服账号一个独立的对话实例
// 架构说明:
// - 租户级一个知识库dataset存储所有话术
// - 客服级每个客服有独立的Chat实例通过document_ids筛选使用哪些话术
package entity
import (
"time"
"gitea.com/red-future/common/beans"
)
const RAGFlowConfigCollection = "ragflow_config"
// RAGFlowConfig RAGFlow配置实体客服账号级别
type RAGFlowConfig struct {
beans.MongoBaseDO `bson:",inline"` // TenantId继承自基础DO
// 客服账号标识
AccountName string `bson:"accountName" json:"accountName"` // 客服账号名称
Platform string `bson:"platform" json:"platform"` // 平台xiaohongshu、douyin
// 租户级知识库(整个租户共享)
DatasetId string `bson:"datasetId" json:"datasetId"` // 话术知识库IDRAGFlow
DatasetIds []string `bson:"datasetIds" json:"datasetIds"` // Chat绑定的知识库ID列表与RAGFlow API保持一致
DatasetName string `bson:"datasetName" json:"datasetName"` // 话术知识库名称
// 客服账号级对话实例(每个客服独立)
ChatId string `bson:"chatId" json:"chatId"` // RAGFlow对话实例ID
Prompt string `bson:"prompt" json:"prompt"` // 提示词内容(完整)
// 文档筛选(该客服使用哪些话术文档)
DocumentIds []string `bson:"documentIds" json:"documentIds"` // 绑定的话术文档ID列表从租户知识库中筛选
// 检索参数
SimilarityThreshold float64 `bson:"similarityThreshold" json:"similarityThreshold"` // 相似度阈值默认0.2
KeywordsSimilarityWeight float64 `bson:"keywordsSimilarityWeight" json:"keywordsSimilarityWeight"` // 关键词权重默认0.7
TopN int `bson:"topN" json:"topN"` // 返回chunk数量默认8
EmptyResponse string `bson:"emptyResponse" json:"emptyResponse"` // 无匹配时回复
// 同步状态
SyncStatus string `bson:"syncStatus" json:"syncStatus"` // synced/pending/failed
LastSyncTime *time.Time `bson:"lastSyncTime" json:"lastSyncTime"` // 最后同步时间
SyncError string `bson:"syncError" json:"syncError"` // 同步错误信息
}