Files
chat-deploy/internal/rpc/bot/update.go
kim.dev.6789 b7f8db7d08 复制项目
2026-01-14 22:35:45 +08:00

38 lines
741 B
Go

package bot
import "git.imall.cloud/openim/chat/pkg/protocol/bot"
func ToDBAgentUpdate(req *bot.UpdateAgentReq) map[string]any {
update := make(map[string]any)
if req.Key != nil {
update["key"] = req.Key
}
if req.Prompts != nil {
update["prompts"] = req.Prompts
}
if req.Model != nil {
update["model"] = req.Model
}
if req.FaceURL != nil {
update["face_url"] = req.FaceURL
}
if req.Nickname != nil {
update["nick_name"] = req.Nickname
}
if req.Identity != nil {
update["identity"] = req.Identity
}
if req.Url != nil {
update["url"] = req.Url
}
return update
}
func ToDBConversationRespIDUpdate(respID string) map[string]any {
update := map[string]any{
"previous_response_id": respID,
}
return update
}