Compare commits

...

2 Commits

3 changed files with 13 additions and 10 deletions

View File

@ -4100,13 +4100,13 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
assert.NoError(t, err)
validateSubWorkflowIDs(subworkflowCanvas.Nodes)
case entity.NodeTypeLLM:
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
assert.True(t, copiedIDMap[w.WorkflowID])
}
}
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.PluginFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.PluginFCParam != nil {
for _, p := range node.Data.Inputs.FCParam.PluginFCParam.PluginList {
if p.PluginVersion == "0" {
assert.Equal(t, "100100", p.PluginID)
@ -4114,7 +4114,7 @@ func TestCopyWorkflowAppToLibrary(t *testing.T) {
}
}
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.KnowledgeFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.KnowledgeFCParam != nil {
for _, k := range node.Data.Inputs.FCParam.KnowledgeFCParam.KnowledgeList {
assert.Equal(t, "100100", k.ID)
}

View File

@ -715,15 +715,18 @@ func (s *SingleAgentApplicationService) GetAgentOnlineInfo(ctx context.Context,
AgentID: ptr.Of(si.ObjectID),
Command: si.ShortcutCommand,
Components: slices.Transform(si.Components, func(i *playground.Components) *bot_common.ShortcutCommandComponent {
return &bot_common.ShortcutCommandComponent{
sc := &bot_common.ShortcutCommandComponent{
Name: i.Name,
Description: i.Description,
Type: i.InputType.String(),
ToolParameter: ptr.Of(i.Parameter),
Options: i.Options,
DefaultValue: ptr.Of(i.DefaultValue.Value),
IsHide: i.Hide,
}
if i.DefaultValue != nil {
sc.DefaultValue = ptr.Of(i.DefaultValue.Value)
}
return sc
}),
}
})

View File

@ -889,7 +889,7 @@ func (i *impl) CopyWorkflowFromAppToLibrary(ctx context.Context, workflowID int6
}
if node.Type == entity.NodeTypeLLM.IDStr() {
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
var (
v *vo.DraftInfo
@ -1120,7 +1120,7 @@ func (i *impl) DuplicateWorkflowsByAppID(ctx context.Context, sourceAppID, targe
}
if node.Type == entity.NodeTypeLLM.IDStr() {
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
for _, w := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
var (
v *vo.DraftInfo
@ -1368,7 +1368,7 @@ func (i *impl) GetWorkflowDependenceResource(ctx context.Context, workflowID int
ds.DatabaseIDs = append(ds.DatabaseIDs, dsID)
}
case entity.NodeTypeLLM:
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.PluginFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.PluginFCParam != nil {
for idx := range node.Data.Inputs.FCParam.PluginFCParam.PluginList {
if node.Data.Inputs.FCParam.PluginFCParam.PluginList[idx].IsDraft {
pl := node.Data.Inputs.FCParam.PluginFCParam.PluginList[idx]
@ -1382,7 +1382,7 @@ func (i *impl) GetWorkflowDependenceResource(ctx context.Context, workflowID int
}
}
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.KnowledgeFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.KnowledgeFCParam != nil {
for idx := range node.Data.Inputs.FCParam.KnowledgeFCParam.KnowledgeList {
kn := node.Data.Inputs.FCParam.KnowledgeFCParam.KnowledgeList[idx]
kid, err := strconv.ParseInt(kn.ID, 10, 64)
@ -1394,7 +1394,7 @@ func (i *impl) GetWorkflowDependenceResource(ctx context.Context, workflowID int
}
}
if node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
if node.Data.Inputs.LLM != nil && node.Data.Inputs.FCParam != nil && node.Data.Inputs.FCParam.WorkflowFCParam != nil {
for idx := range node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList {
if node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList[idx].IsDraft {
wID, err := strconv.ParseInt(node.Data.Inputs.FCParam.WorkflowFCParam.WorkflowList[idx].WorkflowID, 10, 64)