fix(im): persist session mode configuration

main
jacentsao 2026-08-10 11:07:42 +08:00 committed by lyingbug
parent afd1ef8cf3
commit 6d833abfc0
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,7 @@ func (h *IMHandler) CreateIMChannel(c *gin.Context) {
Name string `json:"name"`
Mode string `json:"mode"`
OutputMode string `json:"output_mode"`
SessionMode string `json:"session_mode"`
KnowledgeBaseID string `json:"knowledge_base_id"`
Credentials types.JSON `json:"credentials"`
Enabled *bool `json:"enabled"`
@ -86,6 +87,7 @@ func (h *IMHandler) CreateIMChannel(c *gin.Context) {
Name: req.Name,
Mode: req.Mode,
OutputMode: req.OutputMode,
SessionMode: req.SessionMode,
KnowledgeBaseID: req.KnowledgeBaseID,
Credentials: req.Credentials,
Enabled: true,
@ -207,6 +209,7 @@ func (h *IMHandler) UpdateIMChannel(c *gin.Context) {
Name *string `json:"name"`
Mode *string `json:"mode"`
OutputMode *string `json:"output_mode"`
SessionMode *string `json:"session_mode"`
KnowledgeBaseID *string `json:"knowledge_base_id"`
Credentials types.JSON `json:"credentials"`
Enabled *bool `json:"enabled"`
@ -226,6 +229,9 @@ func (h *IMHandler) UpdateIMChannel(c *gin.Context) {
if req.OutputMode != nil {
channel.OutputMode = *req.OutputMode
}
if req.SessionMode != nil {
channel.SessionMode = *req.SessionMode
}
if req.KnowledgeBaseID != nil {
channel.KnowledgeBaseID = *req.KnowledgeBaseID
}