2026-05-20 11:36:39 +08:00
|
|
|
|
package dto
|
2026-05-12 13:59:15 +08:00
|
|
|
|
|
|
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
|
|
|
2026-06-09 14:00:01 +08:00
|
|
|
|
// SessionCallbackReq 会话回调请求
|
2026-05-12 13:59:15 +08:00
|
|
|
|
type SessionCallbackReq struct {
|
2026-06-09 14:00:01 +08:00
|
|
|
|
g.Meta `path:"/callback" method:"post" tags:"会话管理" summary:"会话回调"`
|
2026-05-27 09:36:26 +08:00
|
|
|
|
Messages map[string]any `json:"messages" dc:"消息数组"`
|
|
|
|
|
|
EpicycleId int64 `json:"epicycleId" dc:"轮次ID"`
|
2026-05-12 13:59:15 +08:00
|
|
|
|
}
|
2026-05-18 19:19:17 +08:00
|
|
|
|
|
2026-06-09 14:00:01 +08:00
|
|
|
|
// SessionCallbackRes 会话回调响应
|
2026-05-18 19:19:17 +08:00
|
|
|
|
type SessionCallbackRes struct {
|
2026-05-27 09:36:26 +08:00
|
|
|
|
Status bool `json:"status" dc:"状态"`
|
|
|
|
|
|
SessionId string `json:"sessionId" dc:"会话ID"`
|
2026-05-18 19:19:17 +08:00
|
|
|
|
}
|
2026-06-09 14:00:01 +08:00
|
|
|
|
|
|
|
|
|
|
// GetHistoryMessagesReq 获取历史消息请求
|
|
|
|
|
|
type GetHistoryMessagesReq struct {
|
|
|
|
|
|
g.Meta `path:"/history" method:"get" tags:"会话管理" summary:"获取历史消息"`
|
|
|
|
|
|
SessionId string `json:"sessionId" v:"required" dc:"会话ID"`
|
|
|
|
|
|
NodeId string `json:"nodeId" dc:"节点ID"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetHistoryMessagesRes 获取历史消息响应
|
|
|
|
|
|
type GetHistoryMessagesRes struct {
|
|
|
|
|
|
Messages []HistoryRound `json:"messages" dc:"历史消息列表"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// HistoryRound 一轮对话
|
|
|
|
|
|
type HistoryRound struct {
|
|
|
|
|
|
Id int64 `json:"id" dc:"记录ID"`
|
|
|
|
|
|
User map[string]any `json:"user" dc:"用户消息"`
|
|
|
|
|
|
Assistant map[string]any `json:"assistant" dc:"助手回复"`
|
|
|
|
|
|
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteSessionReq 删除会话请求
|
|
|
|
|
|
type DeleteSessionReq struct {
|
|
|
|
|
|
g.Meta `path:"/delete" method:"post" tags:"会话管理" summary:"删除会话"`
|
|
|
|
|
|
TenantId uint64 `json:"tenantId" dc:"租户ID"`
|
|
|
|
|
|
SessionId string `json:"sessionId" v:"required" dc:"会话ID"`
|
|
|
|
|
|
NodeId string `json:"nodeId" dc:"节点ID"`
|
|
|
|
|
|
MsgIds []int64 `json:"msgIds" dc:"消息ID列表,传则删单条,不传删整个会话"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeleteSessionRes 删除会话响应
|
|
|
|
|
|
type DeleteSessionRes struct {
|
|
|
|
|
|
Ok bool `json:"ok" dc:"是否成功"`
|
|
|
|
|
|
}
|