From e2f1b39803835da221f33a1ee2a76c1945a7c1c3 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 24 Mar 2025 13:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0spark=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proto/im.go | 1 + service/imService.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/proto/im.go b/proto/im.go index 0524738..a21c301 100644 --- a/proto/im.go +++ b/proto/im.go @@ -21,6 +21,7 @@ type ModelParam struct { type WSMessageReq struct { Type string `json:"type"` //接收及发送消息类型 + Function string `json:"function"` //功能名称 Msg string `json:"msg"` //消息内容,只进行转发,不做处理 SessionID int `json:"session_id"` //应用层会话id ToID int `json:"to_id"` //接收者id diff --git a/service/imService.go b/service/imService.go index 2f01766..c1fcee2 100644 --- a/service/imService.go +++ b/service/imService.go @@ -86,6 +86,7 @@ func WSReceiveMessageService(userID, sessionID int, channel string, msg proto.WS if msg.Type == "ollama" { resErr, resID = ReceiveOllamaSession(userID, sessionID, channel, msg) } else if msg.Type == "spark" { + resErr, resID = ReceiveSparkSession(userID, sessionID, channel, msg) } return resErr, resID @@ -150,6 +151,9 @@ func ReceiveOllamaSession(userID, sessionID int, channel string, msg proto.WSMes } func ReceiveSparkSession(userID, sessionID int, channel string, msg proto.WSMessageReq) (error, uint) { + var resErr error + var resID uint + //查找模型 - return nil, 0 + return resErr, resID }