Compare commits

..

2 Commits

Author SHA1 Message Date
jiangwei 7b8c148f3c
Merge 6bb8cb08ca into d3502e105a 2025-11-22 03:13:36 +00:00
jiangwel 6bb8cb08ca feat(chat): 添加 ChatRagOnlyRequset 结构并简化 ChatRagOnly 逻辑
重构 ChatRagOnly 方法,使用新的 ChatRagOnlyRequset 结构作为参数
移除对话管理相关代码,仅保留文档检索和敏感词检查功能
新增 MCPCall 结构用于记录调用信息
2025-11-22 11:12:59 +08:00
3 changed files with 15 additions and 12 deletions

15
backend/domain/mcp.go Normal file
View File

@ -0,0 +1,15 @@
package domain
import (
"time"
)
type MCPCall struct {
ID string `gorm:"primaryKey;column:id" json:"id,omitempty"`
ClientName string `gorm:"column:client_name" json:"client_name"`
ClientVersion string `gorm:"column:client_version" json:"client_version"`
Question string `gorm:"column:question" json:"question"`
Document string `gorm:"column:document" json:"document"`
RemoteIP string `gorm:"column:remote_ip" json:"remoate_ip"`
CreatedAt time.Time `gorm:"column:created_at;not null;default:now()" json:"created_at"`
}

View File

@ -1 +0,0 @@
DROP TABLE IF EXISTS mcp_calls;

View File

@ -1,11 +0,0 @@
CREATE TABLE IF NOT EXISTS mcp_calls (
id SERIAL PRIMARY KEY,
mcp_session_id TEXT NOT NULL,
kb_id TEXT NOT NULL,
remote_ip TEXT,
initialize_req JSONB,
initialize_resp JSONB,
tool_call_req JSONB,
tool_call_resp TEXT,
created_at timestamptz NOT NULL DEFAULT NOW()
);