修改rag的实体类

This commit is contained in:
Cold
2025-12-02 14:59:07 +08:00
committed by 张斌
parent cd3571554f
commit 5d4c8c8711
6 changed files with 78 additions and 40 deletions

View File

@@ -43,10 +43,10 @@ type ListSessionsReq struct {
}
// ListSessionsRes 列出会话响应
// 注意API 不返回 total 字段,仅返回 data 数组
type ListSessionsRes struct {
Code int `json:"code"`
Data []*Session `json:"data"`
Total int `json:"total"` // API 文档未明确
Code int `json:"code"` // 状态码0 表示成功
Data []*Session `json:"data"` // 会话列表
}
// DeleteSessionsReq 删除会话请求
@@ -93,7 +93,7 @@ func (c *Client) CreateSession(ctx context.Context, chatId string, req *CreateSe
// ListSessions 列出会话
func (c *Client) ListSessions(ctx context.Context, chatId string, req *ListSessionsReq) (*ListSessionsRes, error) {
path := fmt.Sprintf("/api/v1/chats/%s/sessions?", chatId)
path := fmt.Sprintf("/api/v1/chats/%s/sessions", chatId)
params := map[string]interface{}{}
if req.Page > 0 {
params["page"] = req.Page