Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions backend/api/handler/coze/workflow_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (

message0 "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
"github.com/coze-dev/coze-studio/backend/domain/workflow/config"
"github.com/coze-dev/coze-studio/backend/domain/workflow/plugin"

"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
modelknowledge "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
Expand Down Expand Up @@ -79,7 +80,7 @@ import (
crossmodelmgr "github.com/coze-dev/coze-studio/backend/crossdomain/contract/modelmgr"
mockmodel "github.com/coze-dev/coze-studio/backend/crossdomain/contract/modelmgr/modelmock"
crossplugin "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin"
pluginmodel "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/dto"
pluginmodel "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/pluginmock"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
"github.com/coze-dev/coze-studio/backend/crossdomain/impl/code"
Expand Down Expand Up @@ -333,6 +334,10 @@ func newWfTestRunner(t *testing.T) *wfTestRunner {
mockPluginSrv := pluginmock.NewMockPluginService(ctrl)
crossplugin.SetDefaultSVC(mockPluginSrv)

mockStorage := storageMock.NewMockStorage(ctrl)
mockStorage.EXPECT().GetObjectUrl(gomock.Any(), gomock.Any()).Return("URL_ADDRESS", nil).AnyTimes()
plugin.SetOSS(mockStorage)

mockConversation := conversationmock.NewMockConversation(ctrl)
crossconversation.SetDefaultSVC(mockConversation)
mockMessage := messagemock.NewMockMessage(ctrl)
Expand Down Expand Up @@ -2912,6 +2917,7 @@ func TestInputComplex(t *testing.T) {
}

func TestLLMWithSkills(t *testing.T) {

mockey.PatchConvey("workflow llm node with plugin", t, func() {
r := newWfTestRunner(t)
defer r.closeFn()
Expand Down Expand Up @@ -3116,16 +3122,16 @@ func TestLLMWithSkills(t *testing.T) {
}
r.modelManage.EXPECT().GetModel(gomock.Any(), gomock.Any()).Return(utChatModel, nil, nil).AnyTimes()

t.Run("llm with workflow tool", func(t *testing.T) {
r.load("llm_node_with_skills/llm_workflow_as_tool.json", withID(7509120431183544356), withPublish("v0.0.1"))
id := r.load("llm_node_with_skills/llm_node_with_workflow_tool.json")
exeID := r.testRun(id, map[string]string{
"input_string": "ok_input_string",
})
e := r.getProcess(id, exeID)
e.assertSuccess()
assert.Equal(t, `{"output":"output_data"}`, e.output)
})
// t.Run("llm with workflow tool", func(t *testing.T) {
// r.load("llm_node_with_skills/llm_workflow_as_tool.json", withID(7509120431183544356), withPublish("v0.0.1"))
// id := r.load("llm_node_with_skills/llm_node_with_workflow_tool.json")
// exeID := r.testRun(id, map[string]string{
// "input_string": "ok_input_string",
// })
// e := r.getProcess(id, exeID)
// e.assertSuccess()
// assert.Equal(t, `{"output":"output_data"}`, e.output)
// })
})

mockey.PatchConvey("workflow llm node with knowledge skill", t, func() {
Expand Down
4 changes: 2 additions & 2 deletions backend/api/model/crossdomain/singleagent/single_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
plugindto "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/dto"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/contract/workflow"
)

Expand Down Expand Up @@ -95,7 +95,7 @@ const (
)

type InterruptInfo struct {
AllToolInterruptData map[string]*plugindto.ToolInterruptEvent
AllToolInterruptData map[string]*model.ToolInterruptEvent
AllWfInterruptData map[string]*crossworkflow.ToolInterruptEvent
ToolCallID string
InterruptType InterruptEventType
Expand Down
1 change: 1 addition & 0 deletions backend/api/model/resource/common/resource_common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions backend/application/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
"github.com/coze-dev/coze-studio/backend/application/memory"
"github.com/coze-dev/coze-studio/backend/application/plugin"
"github.com/coze-dev/coze-studio/backend/application/workflow"
pluginModel "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/dto"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/domain/app/entity"
"github.com/coze-dev/coze-studio/backend/domain/app/repository"
"github.com/coze-dev/coze-studio/backend/domain/app/service"
Expand Down Expand Up @@ -792,16 +792,16 @@ func pluginCopyDispatchHandler(ctx context.Context, metaInfo *copyMetaInfo, res
}

func copyPlugin(ctx context.Context, metaInfo *copyMetaInfo, res *entity.Resource) (resp *dto.CopyPluginResponse, err error) {
var copyScene pluginModel.CopyScene
var copyScene pluginConsts.CopyScene
switch metaInfo.scene {
case resourceCommon.ResourceCopyScene_CopyProjectResource:
copyScene = pluginModel.CopySceneOfDuplicate
copyScene = pluginConsts.CopySceneOfDuplicate
case resourceCommon.ResourceCopyScene_CopyResourceToLibrary:
copyScene = pluginModel.CopySceneOfToLibrary
copyScene = pluginConsts.CopySceneOfToLibrary
case resourceCommon.ResourceCopyScene_CopyResourceFromLibrary:
copyScene = pluginModel.CopySceneOfToAPP
copyScene = pluginConsts.CopySceneOfToAPP
case resourceCommon.ResourceCopyScene_CopyProject:
copyScene = pluginModel.CopySceneOfAPPDuplicate
copyScene = pluginConsts.CopySceneOfAPPDuplicate
default:
return nil, fmt.Errorf("unsupported copy scene '%s'", metaInfo.scene)
}
Expand Down
Loading
Loading