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