feat: 将用户提示词作为独立字段传递
重构用户提示词的传递方式,将其从嵌入到 userForm 中改为 ComposeCallbackReq 的独立字段 UserPrompt
This commit is contained in:
@@ -74,6 +74,7 @@ type ComposeMessagesReq struct {
|
|||||||
CallbackUrl string `json:"callbackUrl"`
|
CallbackUrl string `json:"callbackUrl"`
|
||||||
Form []map[string]any `json:"form"`
|
Form []map[string]any `json:"form"`
|
||||||
UserForm []map[string]any `json:"userForm"`
|
UserForm []map[string]any `json:"userForm"`
|
||||||
|
UserPrompt string `json:"userPrompt" dc:"用户提示词"`
|
||||||
Consult []Consult `json:"consult"`
|
Consult []Consult `json:"consult"`
|
||||||
SessionId string `json:"sessionId" dc:"会话ID"`
|
SessionId string `json:"sessionId" dc:"会话ID"`
|
||||||
NodeId string `json:"nodeId"`
|
NodeId string `json:"nodeId"`
|
||||||
|
|||||||
@@ -98,11 +98,6 @@ func GetModelInfo(ctx context.Context, req *flowDto.GetModelInfoReq) (res *flowD
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetComposeResult(ctx context.Context, buildType int, modelName, promptContent, skillName string, form []map[string]any, userForm []map[string]any, fileUrl []string, sessionId, nodeId string, cause string) (res *flowDto.ComposeCallbackReq, err error) {
|
func GetComposeResult(ctx context.Context, buildType int, modelName, promptContent, skillName string, form []map[string]any, userForm []map[string]any, fileUrl []string, sessionId, nodeId string, cause string) (res *flowDto.ComposeCallbackReq, err error) {
|
||||||
if !g.IsEmpty(promptContent) {
|
|
||||||
userForm = append(userForm, map[string]any{
|
|
||||||
"prompt": promptContent,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
var callbackUrl = utils.GetCallbackURL(ctx, "/flow/execution/composeCallBack")
|
var callbackUrl = utils.GetCallbackURL(ctx, "/flow/execution/composeCallBack")
|
||||||
var consult = make([]flowDto.Consult, 0)
|
var consult = make([]flowDto.Consult, 0)
|
||||||
var collectFileUrls func(val any) (fullyConsumed bool)
|
var collectFileUrls func(val any) (fullyConsumed bool)
|
||||||
@@ -169,6 +164,7 @@ func GetComposeResult(ctx context.Context, buildType int, modelName, promptConte
|
|||||||
Cause: cause,
|
Cause: cause,
|
||||||
Form: form,
|
Form: form,
|
||||||
UserForm: newUserForm,
|
UserForm: newUserForm,
|
||||||
|
UserPrompt: promptContent,
|
||||||
Consult: consult,
|
Consult: consult,
|
||||||
SessionId: sessionId,
|
SessionId: sessionId,
|
||||||
NodeId: nodeId,
|
NodeId: nodeId,
|
||||||
|
|||||||
Reference in New Issue
Block a user