mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-11 03:33:48 +08:00
修复 WebSocket 会话问题,使用自己实现的简易会话
This commit is contained in:
@@ -46,9 +46,9 @@ func (s *Server) ChatHandle(c *gin.Context) {
|
||||
// 将消息发送给 ChatGPT 并获取结果,通过 WebSocket 推送到客户端
|
||||
func (s *Server) sendMessage(userId string, text string, ws Client) error {
|
||||
var r = types.ApiRequest{
|
||||
Model: "gpt-3.5-turbo",
|
||||
Temperature: 0.9,
|
||||
MaxTokens: 1024,
|
||||
Model: s.Config.Chat.Model,
|
||||
Temperature: s.Config.Chat.Temperature,
|
||||
MaxTokens: s.Config.Chat.MaxTokens,
|
||||
Stream: true,
|
||||
}
|
||||
var history []types.Message
|
||||
|
||||
Reference in New Issue
Block a user