Compare commits
No commits in common. "6205837c2b19cbe276a7954077e1ef7f20ed18d3" and "e48ec38a961df9994b0a33d83adec6afb5004395" have entirely different histories.
6205837c2b
...
e48ec38a96
|
@ -7,9 +7,8 @@ import (
|
||||||
"ai_scheduler/internal/data/model"
|
"ai_scheduler/internal/data/model"
|
||||||
"ai_scheduler/internal/entitys"
|
"ai_scheduler/internal/entitys"
|
||||||
"context"
|
"context"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2/utils"
|
"github.com/gofiber/fiber/v2/utils"
|
||||||
|
"time"
|
||||||
|
|
||||||
"ai_scheduler/internal/config"
|
"ai_scheduler/internal/config"
|
||||||
)
|
)
|
||||||
|
@ -75,7 +74,6 @@ func (s *SessionBiz) SessionInit(ctx context.Context, req *entitys.SessionInitRe
|
||||||
}
|
}
|
||||||
result.Chat = append(result.Chat, chat)
|
result.Chat = append(result.Chat, chat)
|
||||||
result.SessionId = session.SessionID
|
result.SessionId = session.SessionID
|
||||||
result.SessionId = sysConfig.Prologue
|
|
||||||
|
|
||||||
// 开场白写入会话历史
|
// 开场白写入会话历史
|
||||||
s.chatRepo.AsyncCreate(ctx, model.AiChatHi{
|
s.chatRepo.AsyncCreate(ctx, model.AiChatHi{
|
||||||
|
@ -103,7 +101,6 @@ func (s *SessionBiz) SessionInit(ctx context.Context, req *entitys.SessionInitRe
|
||||||
SessionID: chat.SessionID,
|
SessionID: chat.SessionID,
|
||||||
Role: constants.Caller(chat.Role),
|
Role: constants.Caller(chat.Role),
|
||||||
Content: chat.Content,
|
Content: chat.Content,
|
||||||
Prologue: sysConfig.Prologue,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,4 @@ type ChatHistory struct {
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"session_id"`
|
||||||
Role constants.Caller `json:"role"`
|
Role constants.Caller `json:"role"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Prologue string `json:"prologue"`
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ type SessionInitRequest struct {
|
||||||
type SessionInitResponse struct {
|
type SessionInitResponse struct {
|
||||||
SessionId string `json:"session_id"`
|
SessionId string `json:"session_id"`
|
||||||
Chat []ChatHistory `json:"chat"`
|
Chat []ChatHistory `json:"chat"`
|
||||||
Prologue string `json:"prologue"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type SessionListRequest struct {
|
type SessionListRequest struct {
|
||||||
|
|
Loading…
Reference in New Issue