feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
92
backend/domain/workflow/component_interface.go
Normal file
92
backend/domain/workflow/component_interface.go
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package workflow
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/eino/components/tool"
|
||||
"github.com/cloudwego/eino/compose"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type Executable interface {
|
||||
SyncExecute(ctx context.Context, config vo.ExecuteConfig, input map[string]any) (*entity.WorkflowExecution, vo.TerminatePlan, error)
|
||||
AsyncExecute(ctx context.Context, config vo.ExecuteConfig, input map[string]any) (int64, error)
|
||||
AsyncExecuteNode(ctx context.Context, nodeID string, config vo.ExecuteConfig, input map[string]any) (int64, error)
|
||||
AsyncResume(ctx context.Context, req *entity.ResumeRequest, config vo.ExecuteConfig) error
|
||||
StreamExecute(ctx context.Context, config vo.ExecuteConfig, input map[string]any) (*schema.StreamReader[*entity.Message], error)
|
||||
StreamResume(ctx context.Context, req *entity.ResumeRequest, config vo.ExecuteConfig) (
|
||||
*schema.StreamReader[*entity.Message], error)
|
||||
|
||||
GetExecution(ctx context.Context, wfExe *entity.WorkflowExecution, includeNodes bool) (*entity.WorkflowExecution, error)
|
||||
GetNodeExecution(ctx context.Context, exeID int64, nodeID string) (*entity.NodeExecution, *entity.NodeExecution, error)
|
||||
GetLatestTestRunInput(ctx context.Context, wfID int64, userID int64) (*entity.NodeExecution, bool, error)
|
||||
GetLatestNodeDebugInput(ctx context.Context, wfID int64, nodeID string, userID int64) (
|
||||
*entity.NodeExecution, *entity.NodeExecution, bool, error)
|
||||
|
||||
Cancel(ctx context.Context, wfExeID int64, wfID, spaceID int64) error
|
||||
}
|
||||
|
||||
type AsTool interface {
|
||||
WorkflowAsModelTool(ctx context.Context, policies []*vo.GetPolicy) ([]ToolFromWorkflow, error)
|
||||
WithMessagePipe() (compose.Option, *schema.StreamReader[*entity.Message])
|
||||
WithExecuteConfig(cfg vo.ExecuteConfig) compose.Option
|
||||
WithResumeToolWorkflow(resumingEvent *entity.ToolInterruptEvent, resumeData string,
|
||||
allInterruptEvents map[string]*entity.ToolInterruptEvent) compose.Option
|
||||
}
|
||||
|
||||
type InterruptEventStore interface {
|
||||
SaveInterruptEvents(ctx context.Context, wfExeID int64, events []*entity.InterruptEvent) error
|
||||
GetFirstInterruptEvent(ctx context.Context, wfExeID int64) (*entity.InterruptEvent, bool, error)
|
||||
UpdateFirstInterruptEvent(ctx context.Context, wfExeID int64, event *entity.InterruptEvent) error
|
||||
PopFirstInterruptEvent(ctx context.Context, wfExeID int64) (*entity.InterruptEvent, bool, error)
|
||||
ListInterruptEvents(ctx context.Context, wfExeID int64) ([]*entity.InterruptEvent, error)
|
||||
}
|
||||
|
||||
type CancelSignalStore interface {
|
||||
SetWorkflowCancelFlag(ctx context.Context, wfExeID int64) error
|
||||
GetWorkflowCancelFlag(ctx context.Context, wfExeID int64) (bool, error)
|
||||
}
|
||||
|
||||
type ExecuteHistoryStore interface {
|
||||
CreateWorkflowExecution(ctx context.Context, execution *entity.WorkflowExecution) error
|
||||
UpdateWorkflowExecution(ctx context.Context, execution *entity.WorkflowExecution, allowedStatus []entity.WorkflowExecuteStatus) (int64, entity.WorkflowExecuteStatus, error)
|
||||
TryLockWorkflowExecution(ctx context.Context, wfExeID, resumingEventID int64) (bool, entity.WorkflowExecuteStatus, error)
|
||||
GetWorkflowExecution(ctx context.Context, id int64) (*entity.WorkflowExecution, bool, error)
|
||||
CreateNodeExecution(ctx context.Context, execution *entity.NodeExecution) error
|
||||
UpdateNodeExecution(ctx context.Context, execution *entity.NodeExecution) error
|
||||
UpdateNodeExecutionStreaming(ctx context.Context, execution *entity.NodeExecution) error
|
||||
CancelAllRunningNodes(ctx context.Context, wfExeID int64) error
|
||||
GetNodeExecutionsByWfExeID(ctx context.Context, wfExeID int64) (result []*entity.NodeExecution, err error)
|
||||
GetNodeExecution(ctx context.Context, wfExeID int64, nodeID string) (*entity.NodeExecution, bool, error)
|
||||
GetNodeExecutionByParent(ctx context.Context, wfExeID int64, parentNodeID string) (
|
||||
[]*entity.NodeExecution, error)
|
||||
SetTestRunLatestExeID(ctx context.Context, wfID int64, uID int64, exeID int64) error
|
||||
GetTestRunLatestExeID(ctx context.Context, wfID int64, uID int64) (int64, error)
|
||||
SetNodeDebugLatestExeID(ctx context.Context, wfID int64, nodeID string, uID int64, exeID int64) error
|
||||
GetNodeDebugLatestExeID(ctx context.Context, wfID int64, nodeID string, uID int64) (int64, error)
|
||||
}
|
||||
|
||||
type ToolFromWorkflow interface {
|
||||
tool.BaseTool
|
||||
TerminatePlan() vo.TerminatePlan
|
||||
GetWorkflow() *entity.Workflow
|
||||
}
|
||||
50
backend/domain/workflow/crossdomain/code/code.go
Normal file
50
backend/domain/workflow/crossdomain/code/code.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package code
|
||||
|
||||
import "context"
|
||||
|
||||
type Language string
|
||||
|
||||
const (
|
||||
Python Language = "Python"
|
||||
JavaScript Language = "JavaScript"
|
||||
)
|
||||
|
||||
type RunRequest struct {
|
||||
Code string
|
||||
Params map[string]any
|
||||
Language Language
|
||||
}
|
||||
type RunResponse struct {
|
||||
Result map[string]any
|
||||
}
|
||||
|
||||
func GetCodeRunner() Runner {
|
||||
return runnerImpl
|
||||
}
|
||||
|
||||
func SetCodeRunner(runner Runner) {
|
||||
runnerImpl = runner
|
||||
}
|
||||
|
||||
var runnerImpl Runner
|
||||
|
||||
//go:generate mockgen -destination ../../../../internal/mock/domain/workflow/crossdomain/code/code_mock.go --package code -source code.go
|
||||
type Runner interface {
|
||||
Run(ctx context.Context, request *RunRequest) (*RunResponse, error)
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package conversation
|
||||
|
||||
import "context"
|
||||
|
||||
type ClearMessageRequest struct {
|
||||
Name string
|
||||
}
|
||||
type ClearMessageResponse struct {
|
||||
IsSuccess bool
|
||||
}
|
||||
type CreateConversationRequest struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type CreateConversationResponse struct {
|
||||
Result map[string]any
|
||||
}
|
||||
|
||||
type ListMessageRequest struct {
|
||||
ConversationName string
|
||||
Limit *int
|
||||
BeforeID *string
|
||||
AfterID *string
|
||||
}
|
||||
type Message struct {
|
||||
ID string `json:"id"`
|
||||
Role string `json:"role"`
|
||||
ContentType string `json:"contentType"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type ListMessageResponse struct {
|
||||
Messages []*Message
|
||||
FirstID string
|
||||
LastID string
|
||||
HasMore bool
|
||||
}
|
||||
|
||||
var ConversationManagerImpl ConversationManager
|
||||
|
||||
type ConversationManager interface {
|
||||
ClearMessage(context.Context, *ClearMessageRequest) (*ClearMessageResponse, error)
|
||||
CreateConversation(ctx context.Context, c *CreateConversationRequest) (*CreateConversationResponse, error)
|
||||
MessageList(ctx context.Context, req *ListMessageRequest) (*ListMessageResponse, error)
|
||||
}
|
||||
143
backend/domain/workflow/crossdomain/database/database.go
Normal file
143
backend/domain/workflow/crossdomain/database/database.go
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type SQLParam struct {
|
||||
Value string
|
||||
IsNull bool
|
||||
}
|
||||
type CustomSQLRequest struct {
|
||||
DatabaseInfoID int64
|
||||
SQL string
|
||||
Params []SQLParam
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
}
|
||||
|
||||
type Object = map[string]any
|
||||
|
||||
type Response struct {
|
||||
RowNumber *int64
|
||||
Objects []Object
|
||||
}
|
||||
|
||||
type Operator string
|
||||
type ClauseRelation string
|
||||
|
||||
const (
|
||||
ClauseRelationAND ClauseRelation = "and"
|
||||
ClauseRelationOR ClauseRelation = "or"
|
||||
)
|
||||
|
||||
const (
|
||||
OperatorEqual Operator = "="
|
||||
OperatorNotEqual Operator = "!="
|
||||
OperatorGreater Operator = ">"
|
||||
OperatorLesser Operator = "<"
|
||||
OperatorGreaterOrEqual Operator = ">="
|
||||
OperatorLesserOrEqual Operator = "<="
|
||||
OperatorIn Operator = "in"
|
||||
OperatorNotIn Operator = "not_in"
|
||||
OperatorIsNull Operator = "is_null"
|
||||
OperatorIsNotNull Operator = "is_not_null"
|
||||
OperatorLike Operator = "like"
|
||||
OperatorNotLike Operator = "not_like"
|
||||
)
|
||||
|
||||
type ClauseGroup struct {
|
||||
Single *Clause
|
||||
Multi *MultiClause
|
||||
}
|
||||
type Clause struct {
|
||||
Left string
|
||||
Operator Operator
|
||||
}
|
||||
type MultiClause struct {
|
||||
Clauses []*Clause
|
||||
Relation ClauseRelation
|
||||
}
|
||||
|
||||
type Condition struct {
|
||||
Left string
|
||||
Operator Operator
|
||||
Right any
|
||||
}
|
||||
|
||||
type ConditionGroup struct {
|
||||
Conditions []*Condition
|
||||
Relation ClauseRelation
|
||||
}
|
||||
|
||||
type DeleteRequest struct {
|
||||
DatabaseInfoID int64
|
||||
ConditionGroup *ConditionGroup
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
}
|
||||
|
||||
type QueryRequest struct {
|
||||
DatabaseInfoID int64
|
||||
SelectFields []string
|
||||
Limit int64
|
||||
ConditionGroup *ConditionGroup
|
||||
OrderClauses []*OrderClause
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
}
|
||||
|
||||
type OrderClause struct {
|
||||
FieldID string
|
||||
IsAsc bool
|
||||
}
|
||||
type UpdateRequest struct {
|
||||
DatabaseInfoID int64
|
||||
ConditionGroup *ConditionGroup
|
||||
Fields map[string]any
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
}
|
||||
|
||||
type InsertRequest struct {
|
||||
DatabaseInfoID int64
|
||||
Fields map[string]any
|
||||
IsDebugRun bool
|
||||
UserID int64
|
||||
}
|
||||
|
||||
func GetDatabaseOperator() DatabaseOperator {
|
||||
return databaseOperatorImpl
|
||||
}
|
||||
func SetDatabaseOperator(d DatabaseOperator) {
|
||||
databaseOperatorImpl = d
|
||||
}
|
||||
|
||||
var (
|
||||
databaseOperatorImpl DatabaseOperator
|
||||
)
|
||||
|
||||
//go:generate mockgen -destination databasemock/database_mock.go --package databasemock -source database.go
|
||||
type DatabaseOperator interface {
|
||||
Execute(ctx context.Context, request *CustomSQLRequest) (*Response, error)
|
||||
Query(ctx context.Context, request *QueryRequest) (*Response, error)
|
||||
Update(context.Context, *UpdateRequest) (*Response, error)
|
||||
Insert(ctx context.Context, request *InsertRequest) (*Response, error)
|
||||
Delete(context.Context, *DeleteRequest) (*Response, error)
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: database.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination databasemock/database_mock.go --package databasemock -source database.go
|
||||
//
|
||||
|
||||
// Package databasemock is a generated GoMock package.
|
||||
package databasemock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
database "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/database"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockDatabaseOperator is a mock of DatabaseOperator interface.
|
||||
type MockDatabaseOperator struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockDatabaseOperatorMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockDatabaseOperatorMockRecorder is the mock recorder for MockDatabaseOperator.
|
||||
type MockDatabaseOperatorMockRecorder struct {
|
||||
mock *MockDatabaseOperator
|
||||
}
|
||||
|
||||
// NewMockDatabaseOperator creates a new mock instance.
|
||||
func NewMockDatabaseOperator(ctrl *gomock.Controller) *MockDatabaseOperator {
|
||||
mock := &MockDatabaseOperator{ctrl: ctrl}
|
||||
mock.recorder = &MockDatabaseOperatorMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockDatabaseOperator) EXPECT() *MockDatabaseOperatorMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Delete mocks base method.
|
||||
func (m *MockDatabaseOperator) Delete(arg0 context.Context, arg1 *database.DeleteRequest) (*database.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delete", arg0, arg1)
|
||||
ret0, _ := ret[0].(*database.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Delete indicates an expected call of Delete.
|
||||
func (mr *MockDatabaseOperatorMockRecorder) Delete(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDatabaseOperator)(nil).Delete), arg0, arg1)
|
||||
}
|
||||
|
||||
// Execute mocks base method.
|
||||
func (m *MockDatabaseOperator) Execute(ctx context.Context, request *database.CustomSQLRequest) (*database.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Execute", ctx, request)
|
||||
ret0, _ := ret[0].(*database.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Execute indicates an expected call of Execute.
|
||||
func (mr *MockDatabaseOperatorMockRecorder) Execute(ctx, request any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDatabaseOperator)(nil).Execute), ctx, request)
|
||||
}
|
||||
|
||||
// Insert mocks base method.
|
||||
func (m *MockDatabaseOperator) Insert(ctx context.Context, request *database.InsertRequest) (*database.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Insert", ctx, request)
|
||||
ret0, _ := ret[0].(*database.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Insert indicates an expected call of Insert.
|
||||
func (mr *MockDatabaseOperatorMockRecorder) Insert(ctx, request any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockDatabaseOperator)(nil).Insert), ctx, request)
|
||||
}
|
||||
|
||||
// Query mocks base method.
|
||||
func (m *MockDatabaseOperator) Query(ctx context.Context, request *database.QueryRequest) (*database.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Query", ctx, request)
|
||||
ret0, _ := ret[0].(*database.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Query indicates an expected call of Query.
|
||||
func (mr *MockDatabaseOperatorMockRecorder) Query(ctx, request any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockDatabaseOperator)(nil).Query), ctx, request)
|
||||
}
|
||||
|
||||
// Update mocks base method.
|
||||
func (m *MockDatabaseOperator) Update(arg0 context.Context, arg1 *database.UpdateRequest) (*database.Response, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Update", arg0, arg1)
|
||||
ret0, _ := ret[0].(*database.Response)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Update indicates an expected call of Update.
|
||||
func (mr *MockDatabaseOperatorMockRecorder) Update(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockDatabaseOperator)(nil).Update), arg0, arg1)
|
||||
}
|
||||
143
backend/domain/workflow/crossdomain/knowledge/knowledge.go
Normal file
143
backend/domain/workflow/crossdomain/knowledge/knowledge.go
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package knowledge
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/infra/contract/document/parser"
|
||||
)
|
||||
|
||||
type ParseMode string
|
||||
|
||||
const (
|
||||
FastParseMode = "fast_mode"
|
||||
AccurateParseMode = "accurate_mode"
|
||||
)
|
||||
|
||||
type ChunkType string
|
||||
|
||||
const (
|
||||
ChunkTypeDefault ChunkType = "default"
|
||||
ChunkTypeCustom ChunkType = "custom"
|
||||
ChunkTypeLeveled ChunkType = "leveled"
|
||||
)
|
||||
|
||||
type ParsingStrategy struct {
|
||||
ParseMode ParseMode
|
||||
ExtractImage bool
|
||||
ExtractTable bool
|
||||
ImageOCR bool
|
||||
}
|
||||
type ChunkingStrategy struct {
|
||||
ChunkType ChunkType
|
||||
ChunkSize int64
|
||||
Separator string
|
||||
Overlap int64
|
||||
}
|
||||
|
||||
type CreateDocumentRequest struct {
|
||||
KnowledgeID int64
|
||||
ParsingStrategy *ParsingStrategy
|
||||
ChunkingStrategy *ChunkingStrategy
|
||||
FileURL string
|
||||
FileName string
|
||||
FileExtension parser.FileExtension
|
||||
}
|
||||
type CreateDocumentResponse struct {
|
||||
DocumentID int64
|
||||
FileName string
|
||||
FileURL string
|
||||
}
|
||||
|
||||
type SearchType string
|
||||
|
||||
const (
|
||||
SearchTypeSemantic SearchType = "semantic" // 语义
|
||||
SearchTypeFullText SearchType = "full_text" // 全文
|
||||
SearchTypeHybrid SearchType = "hybrid" // 混合
|
||||
)
|
||||
|
||||
type RetrievalStrategy struct {
|
||||
TopK *int64
|
||||
MinScore *float64
|
||||
SearchType SearchType
|
||||
|
||||
EnableNL2SQL bool
|
||||
EnableQueryRewrite bool
|
||||
EnableRerank bool
|
||||
IsPersonalOnly bool
|
||||
}
|
||||
|
||||
type RetrieveRequest struct {
|
||||
Query string
|
||||
KnowledgeIDs []int64
|
||||
RetrievalStrategy *RetrievalStrategy
|
||||
}
|
||||
|
||||
type Slice struct {
|
||||
DocumentID string `json:"documentId"`
|
||||
Output string `json:"output"`
|
||||
}
|
||||
|
||||
type RetrieveResponse struct {
|
||||
Slices []*Slice
|
||||
}
|
||||
|
||||
var (
|
||||
knowledgeOperatorImpl KnowledgeOperator
|
||||
)
|
||||
|
||||
func GetKnowledgeOperator() KnowledgeOperator {
|
||||
return knowledgeOperatorImpl
|
||||
}
|
||||
|
||||
func SetKnowledgeOperator(k KnowledgeOperator) {
|
||||
knowledgeOperatorImpl = k
|
||||
}
|
||||
|
||||
type KnowledgeDetail struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
IconURL string `json:"-"`
|
||||
FormatType int64 `json:"-"`
|
||||
}
|
||||
|
||||
type ListKnowledgeDetailRequest struct {
|
||||
KnowledgeIDs []int64
|
||||
}
|
||||
|
||||
type ListKnowledgeDetailResponse struct {
|
||||
KnowledgeDetails []*KnowledgeDetail
|
||||
}
|
||||
|
||||
type DeleteDocumentRequest struct {
|
||||
DocumentID string
|
||||
}
|
||||
|
||||
type DeleteDocumentResponse struct {
|
||||
IsSuccess bool
|
||||
}
|
||||
|
||||
//go:generate mockgen -destination knowledgemock/knowledge_mock.go --package knowledgemock -source knowledge.go
|
||||
type KnowledgeOperator interface {
|
||||
Store(ctx context.Context, document *CreateDocumentRequest) (*CreateDocumentResponse, error)
|
||||
Retrieve(context.Context, *RetrieveRequest) (*RetrieveResponse, error)
|
||||
Delete(context.Context, *DeleteDocumentRequest) (*DeleteDocumentResponse, error)
|
||||
ListKnowledgeDetail(context.Context, *ListKnowledgeDetailRequest) (*ListKnowledgeDetailResponse, error)
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: knowledge.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination knowledgemock/knowledge_mock.go --package knowledgemock -source knowledge.go
|
||||
//
|
||||
|
||||
// Package knowledgemock is a generated GoMock package.
|
||||
package knowledgemock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
knowledge "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/knowledge"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockKnowledgeOperator is a mock of KnowledgeOperator interface.
|
||||
type MockKnowledgeOperator struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockKnowledgeOperatorMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockKnowledgeOperatorMockRecorder is the mock recorder for MockKnowledgeOperator.
|
||||
type MockKnowledgeOperatorMockRecorder struct {
|
||||
mock *MockKnowledgeOperator
|
||||
}
|
||||
|
||||
// NewMockKnowledgeOperator creates a new mock instance.
|
||||
func NewMockKnowledgeOperator(ctrl *gomock.Controller) *MockKnowledgeOperator {
|
||||
mock := &MockKnowledgeOperator{ctrl: ctrl}
|
||||
mock.recorder = &MockKnowledgeOperatorMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockKnowledgeOperator) EXPECT() *MockKnowledgeOperatorMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Delete mocks base method.
|
||||
func (m *MockKnowledgeOperator) Delete(arg0 context.Context, arg1 *knowledge.DeleteDocumentRequest) (*knowledge.DeleteDocumentResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delete", arg0, arg1)
|
||||
ret0, _ := ret[0].(*knowledge.DeleteDocumentResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Delete indicates an expected call of Delete.
|
||||
func (mr *MockKnowledgeOperatorMockRecorder) Delete(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockKnowledgeOperator)(nil).Delete), arg0, arg1)
|
||||
}
|
||||
|
||||
// ListKnowledgeDetail mocks base method.
|
||||
func (m *MockKnowledgeOperator) ListKnowledgeDetail(arg0 context.Context, arg1 *knowledge.ListKnowledgeDetailRequest) (*knowledge.ListKnowledgeDetailResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ListKnowledgeDetail", arg0, arg1)
|
||||
ret0, _ := ret[0].(*knowledge.ListKnowledgeDetailResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ListKnowledgeDetail indicates an expected call of ListKnowledgeDetail.
|
||||
func (mr *MockKnowledgeOperatorMockRecorder) ListKnowledgeDetail(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKnowledgeDetail", reflect.TypeOf((*MockKnowledgeOperator)(nil).ListKnowledgeDetail), arg0, arg1)
|
||||
}
|
||||
|
||||
// Retrieve mocks base method.
|
||||
func (m *MockKnowledgeOperator) Retrieve(arg0 context.Context, arg1 *knowledge.RetrieveRequest) (*knowledge.RetrieveResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Retrieve", arg0, arg1)
|
||||
ret0, _ := ret[0].(*knowledge.RetrieveResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Retrieve indicates an expected call of Retrieve.
|
||||
func (mr *MockKnowledgeOperatorMockRecorder) Retrieve(arg0, arg1 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Retrieve", reflect.TypeOf((*MockKnowledgeOperator)(nil).Retrieve), arg0, arg1)
|
||||
}
|
||||
|
||||
// Store mocks base method.
|
||||
func (m *MockKnowledgeOperator) Store(ctx context.Context, document *knowledge.CreateDocumentRequest) (*knowledge.CreateDocumentResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Store", ctx, document)
|
||||
ret0, _ := ret[0].(*knowledge.CreateDocumentResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Store indicates an expected call of Store.
|
||||
func (mr *MockKnowledgeOperatorMockRecorder) Store(ctx, document any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Store", reflect.TypeOf((*MockKnowledgeOperator)(nil).Store), ctx, document)
|
||||
}
|
||||
63
backend/domain/workflow/crossdomain/model/model.go
Normal file
63
backend/domain/workflow/crossdomain/model/model.go
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/eino/components/model"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossmodelmgr"
|
||||
)
|
||||
|
||||
type LLMParams struct {
|
||||
ModelName string `json:"modelName"`
|
||||
ModelType int64 `json:"modelType"`
|
||||
Prompt string `json:"prompt"` // user prompt
|
||||
Temperature *float64 `json:"temperature"`
|
||||
FrequencyPenalty float64 `json:"frequencyPenalty"`
|
||||
PresencePenalty float64 `json:"presencePenalty"`
|
||||
MaxTokens int `json:"maxTokens"`
|
||||
TopP *float64 `json:"topP"`
|
||||
TopK *int `json:"topK"`
|
||||
EnableChatHistory bool `json:"enableChatHistory"`
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
ResponseFormat ResponseFormat `json:"responseFormat"`
|
||||
}
|
||||
|
||||
type ResponseFormat int64
|
||||
|
||||
const (
|
||||
ResponseFormatText ResponseFormat = 0
|
||||
ResponseFormatMarkdown ResponseFormat = 1
|
||||
ResponseFormatJSON ResponseFormat = 2
|
||||
)
|
||||
|
||||
var ManagerImpl Manager
|
||||
|
||||
func GetManager() Manager {
|
||||
return ManagerImpl
|
||||
}
|
||||
|
||||
func SetManager(m Manager) {
|
||||
ManagerImpl = m
|
||||
}
|
||||
|
||||
//go:generate mockgen -destination modelmock/model_mock.go --package mockmodel -source model.go
|
||||
type Manager interface {
|
||||
GetModel(ctx context.Context, params *LLMParams) (model.BaseChatModel, *crossmodelmgr.Model, error)
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: model.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination modelmock/model_mock.go --package mockmodel -source model.go
|
||||
//
|
||||
|
||||
// Package mockmodel is a generated GoMock package.
|
||||
package mockmodel
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
crossmodelmgr "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossmodelmgr"
|
||||
model "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model"
|
||||
model0 "github.com/cloudwego/eino/components/model"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockManager is a mock of Manager interface.
|
||||
type MockManager struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockManagerMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockManagerMockRecorder is the mock recorder for MockManager.
|
||||
type MockManagerMockRecorder struct {
|
||||
mock *MockManager
|
||||
}
|
||||
|
||||
// NewMockManager creates a new mock instance.
|
||||
func NewMockManager(ctrl *gomock.Controller) *MockManager {
|
||||
mock := &MockManager{ctrl: ctrl}
|
||||
mock.recorder = &MockManagerMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockManager) EXPECT() *MockManagerMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// GetModel mocks base method.
|
||||
func (m *MockManager) GetModel(ctx context.Context, params *model.LLMParams) (model0.BaseChatModel, *crossmodelmgr.Model, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModel", ctx, params)
|
||||
ret0, _ := ret[0].(model0.BaseChatModel)
|
||||
ret1, _ := ret[1].(*crossmodelmgr.Model)
|
||||
ret2, _ := ret[2].(error)
|
||||
return ret0, ret1, ret2
|
||||
}
|
||||
|
||||
// GetModel indicates an expected call of GetModel.
|
||||
func (mr *MockManagerMockRecorder) GetModel(ctx, params any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModel", reflect.TypeOf((*MockManager)(nil).GetModel), ctx, params)
|
||||
}
|
||||
121
backend/domain/workflow/crossdomain/plugin/plugin.go
Normal file
121
backend/domain/workflow/crossdomain/plugin/plugin.go
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/eino/components/tool"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
|
||||
workflow3 "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/internal/execute"
|
||||
)
|
||||
|
||||
//go:generate mockgen -destination pluginmock/plugin_mock.go --package pluginmock -source plugin.go
|
||||
type Service interface {
|
||||
GetPluginToolsInfo(ctx context.Context, req *ToolsInfoRequest) (*ToolsInfoResponse, error)
|
||||
GetPluginInvokableTools(ctx context.Context, req *ToolsInvokableRequest) (map[int64]InvokableTool, error)
|
||||
ExecutePlugin(ctx context.Context, input map[string]any, pe *Entity,
|
||||
toolID int64, cfg ExecConfig) (map[string]any, error)
|
||||
}
|
||||
|
||||
func GetPluginService() Service {
|
||||
return pluginSrvImpl
|
||||
}
|
||||
|
||||
func SetPluginService(ts Service) {
|
||||
pluginSrvImpl = ts
|
||||
}
|
||||
|
||||
var pluginSrvImpl Service
|
||||
|
||||
type Entity = vo.PluginEntity
|
||||
|
||||
type WorkflowAPIParameters = []*workflow3.APIParameter
|
||||
type ToolsInfoRequest struct {
|
||||
PluginEntity Entity
|
||||
ToolIDs []int64
|
||||
IsDraft bool
|
||||
}
|
||||
type ToolsInvokableInfo struct {
|
||||
ToolID int64
|
||||
RequestAPIParametersConfig WorkflowAPIParameters
|
||||
ResponseAPIParametersConfig WorkflowAPIParameters
|
||||
}
|
||||
|
||||
type ToolsInvokableRequest struct {
|
||||
PluginEntity Entity
|
||||
ToolsInvokableInfo map[int64]*ToolsInvokableInfo
|
||||
IsDraft bool
|
||||
}
|
||||
|
||||
type DebugExample struct {
|
||||
ReqExample string
|
||||
RespExample string
|
||||
}
|
||||
|
||||
type ToolInfo struct {
|
||||
ToolName string
|
||||
ToolID int64
|
||||
Description string
|
||||
DebugExample *DebugExample
|
||||
|
||||
Inputs []*workflow3.APIParameter
|
||||
Outputs []*workflow3.APIParameter
|
||||
}
|
||||
|
||||
type ToolsInfoResponse struct {
|
||||
PluginID int64
|
||||
SpaceID int64
|
||||
Version string
|
||||
PluginName string
|
||||
Description string
|
||||
IconURL string
|
||||
PluginType int64
|
||||
ToolInfoList map[int64]ToolInfo
|
||||
LatestVersion *string
|
||||
IsOfficial bool
|
||||
AppID int64
|
||||
}
|
||||
|
||||
type ExecConfig = vo.ExecuteConfig
|
||||
|
||||
type InvokableTool interface {
|
||||
Info(ctx context.Context) (*schema.ToolInfo, error)
|
||||
PluginInvoke(ctx context.Context, argumentsInJSON string, cfg ExecConfig) (string, error)
|
||||
}
|
||||
|
||||
type pluginInvokableTool struct {
|
||||
pluginInvokableTool InvokableTool
|
||||
}
|
||||
|
||||
func NewInvokableTool(pl InvokableTool) tool.InvokableTool {
|
||||
return &pluginInvokableTool{
|
||||
pluginInvokableTool: pl,
|
||||
}
|
||||
}
|
||||
|
||||
func (p pluginInvokableTool) Info(ctx context.Context) (*schema.ToolInfo, error) {
|
||||
return p.pluginInvokableTool.Info(ctx)
|
||||
}
|
||||
|
||||
func (p pluginInvokableTool) InvokableRun(ctx context.Context, argumentsInJSON string, opts ...tool.Option) (string, error) {
|
||||
execCfg := execute.GetExecuteConfig(opts...)
|
||||
return p.pluginInvokableTool.PluginInvoke(ctx, argumentsInJSON, execCfg)
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: plugin.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination pluginmock/plugin_mock.go --package pluginmock -source plugin.go
|
||||
//
|
||||
|
||||
// Package pluginmock is a generated GoMock package.
|
||||
package pluginmock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
plugin "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/plugin"
|
||||
schema "github.com/cloudwego/eino/schema"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockService is a mock of Service interface.
|
||||
type MockService struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockServiceMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockServiceMockRecorder is the mock recorder for MockService.
|
||||
type MockServiceMockRecorder struct {
|
||||
mock *MockService
|
||||
}
|
||||
|
||||
// NewMockService creates a new mock instance.
|
||||
func NewMockService(ctrl *gomock.Controller) *MockService {
|
||||
mock := &MockService{ctrl: ctrl}
|
||||
mock.recorder = &MockServiceMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockService) EXPECT() *MockServiceMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// ExecutePlugin mocks base method.
|
||||
func (m *MockService) ExecutePlugin(ctx context.Context, input map[string]any, pe *plugin.Entity, toolID int64, cfg plugin.ExecConfig) (map[string]any, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ExecutePlugin", ctx, input, pe, toolID, cfg)
|
||||
ret0, _ := ret[0].(map[string]any)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ExecutePlugin indicates an expected call of ExecutePlugin.
|
||||
func (mr *MockServiceMockRecorder) ExecutePlugin(ctx, input, pe, toolID, cfg any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecutePlugin", reflect.TypeOf((*MockService)(nil).ExecutePlugin), ctx, input, pe, toolID, cfg)
|
||||
}
|
||||
|
||||
// GetPluginInvokableTools mocks base method.
|
||||
func (m *MockService) GetPluginInvokableTools(ctx context.Context, req *plugin.ToolsInvokableRequest) (map[int64]plugin.InvokableTool, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPluginInvokableTools", ctx, req)
|
||||
ret0, _ := ret[0].(map[int64]plugin.InvokableTool)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetPluginInvokableTools indicates an expected call of GetPluginInvokableTools.
|
||||
func (mr *MockServiceMockRecorder) GetPluginInvokableTools(ctx, req any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPluginInvokableTools", reflect.TypeOf((*MockService)(nil).GetPluginInvokableTools), ctx, req)
|
||||
}
|
||||
|
||||
// GetPluginToolsInfo mocks base method.
|
||||
func (m *MockService) GetPluginToolsInfo(ctx context.Context, req *plugin.ToolsInfoRequest) (*plugin.ToolsInfoResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPluginToolsInfo", ctx, req)
|
||||
ret0, _ := ret[0].(*plugin.ToolsInfoResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetPluginToolsInfo indicates an expected call of GetPluginToolsInfo.
|
||||
func (mr *MockServiceMockRecorder) GetPluginToolsInfo(ctx, req any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPluginToolsInfo", reflect.TypeOf((*MockService)(nil).GetPluginToolsInfo), ctx, req)
|
||||
}
|
||||
|
||||
// MockInvokableTool is a mock of InvokableTool interface.
|
||||
type MockInvokableTool struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockInvokableToolMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockInvokableToolMockRecorder is the mock recorder for MockInvokableTool.
|
||||
type MockInvokableToolMockRecorder struct {
|
||||
mock *MockInvokableTool
|
||||
}
|
||||
|
||||
// NewMockInvokableTool creates a new mock instance.
|
||||
func NewMockInvokableTool(ctrl *gomock.Controller) *MockInvokableTool {
|
||||
mock := &MockInvokableTool{ctrl: ctrl}
|
||||
mock.recorder = &MockInvokableToolMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockInvokableTool) EXPECT() *MockInvokableToolMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Info mocks base method.
|
||||
func (m *MockInvokableTool) Info(ctx context.Context) (*schema.ToolInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Info", ctx)
|
||||
ret0, _ := ret[0].(*schema.ToolInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Info indicates an expected call of Info.
|
||||
func (mr *MockInvokableToolMockRecorder) Info(ctx any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockInvokableTool)(nil).Info), ctx)
|
||||
}
|
||||
|
||||
// PluginInvoke mocks base method.
|
||||
func (m *MockInvokableTool) PluginInvoke(ctx context.Context, argumentsInJSON string, cfg plugin.ExecConfig) (string, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "PluginInvoke", ctx, argumentsInJSON, cfg)
|
||||
ret0, _ := ret[0].(string)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// PluginInvoke indicates an expected call of PluginInvoke.
|
||||
func (mr *MockInvokableToolMockRecorder) PluginInvoke(ctx, argumentsInJSON, cfg any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginInvoke", reflect.TypeOf((*MockInvokableTool)(nil).PluginInvoke), ctx, argumentsInJSON, cfg)
|
||||
}
|
||||
66
backend/domain/workflow/crossdomain/search/search.go
Normal file
66
backend/domain/workflow/crossdomain/search/search.go
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package search
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type OpType string
|
||||
|
||||
const (
|
||||
Created OpType = "created"
|
||||
Updated OpType = "updated"
|
||||
Deleted OpType = "deleted"
|
||||
)
|
||||
|
||||
type PublishStatus int64
|
||||
|
||||
const (
|
||||
UnPublished PublishStatus = 1
|
||||
Published PublishStatus = 2
|
||||
)
|
||||
|
||||
type Resource struct {
|
||||
WorkflowID int64
|
||||
Name *string
|
||||
URI *string
|
||||
Desc *string
|
||||
APPID *int64
|
||||
SpaceID *int64
|
||||
OwnerID *int64
|
||||
PublishStatus *PublishStatus
|
||||
Mode *int32 // 0 workflow 3 chat_workflow
|
||||
CreatedAt *int64
|
||||
UpdatedAt *int64
|
||||
PublishedAt *int64
|
||||
}
|
||||
|
||||
func SetNotifier(n Notifier) {
|
||||
notifierImpl = n
|
||||
}
|
||||
|
||||
func GetNotifier() Notifier {
|
||||
return notifierImpl
|
||||
}
|
||||
|
||||
var notifierImpl Notifier
|
||||
|
||||
//go:generate mockgen -destination searchmock/search_mock.go --package searchmock -source search.go
|
||||
type Notifier interface {
|
||||
PublishWorkflowResource(ctx context.Context, OpType OpType, event *Resource) error
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: search.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination searchmock/search_mock.go --package searchmock -source search.go
|
||||
//
|
||||
|
||||
// Package searchmock is a generated GoMock package.
|
||||
package searchmock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
search "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/search"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockNotifier is a mock of Notifier interface.
|
||||
type MockNotifier struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockNotifierMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockNotifierMockRecorder is the mock recorder for MockNotifier.
|
||||
type MockNotifierMockRecorder struct {
|
||||
mock *MockNotifier
|
||||
}
|
||||
|
||||
// NewMockNotifier creates a new mock instance.
|
||||
func NewMockNotifier(ctrl *gomock.Controller) *MockNotifier {
|
||||
mock := &MockNotifier{ctrl: ctrl}
|
||||
mock.recorder = &MockNotifierMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockNotifier) EXPECT() *MockNotifierMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// PublishWorkflowResource mocks base method.
|
||||
func (m *MockNotifier) PublishWorkflowResource(ctx context.Context, OpType search.OpType, event *search.Resource) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "PublishWorkflowResource", ctx, OpType, event)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// PublishWorkflowResource indicates an expected call of PublishWorkflowResource.
|
||||
func (mr *MockNotifierMockRecorder) PublishWorkflowResource(ctx, OpType, event any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PublishWorkflowResource", reflect.TypeOf((*MockNotifier)(nil).PublishWorkflowResource), ctx, OpType, event)
|
||||
}
|
||||
124
backend/domain/workflow/crossdomain/variable/variable.go
Normal file
124
backend/domain/workflow/crossdomain/variable/variable.go
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package variable
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/cloudwego/eino/compose"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
var variableHandlerSingleton *Handler
|
||||
|
||||
func GetVariableHandler() *Handler {
|
||||
return variableHandlerSingleton
|
||||
}
|
||||
func SetVariableHandler(handler *Handler) {
|
||||
variableHandlerSingleton = handler
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
UserVarStore Store
|
||||
SystemVarStore Store
|
||||
AppVarStore Store
|
||||
}
|
||||
|
||||
func (v *Handler) Get(ctx context.Context, t vo.GlobalVarType, path compose.FieldPath, opts ...OptionFn) (any, error) {
|
||||
switch t {
|
||||
case vo.GlobalUser:
|
||||
return v.UserVarStore.Get(ctx, path, opts...)
|
||||
case vo.GlobalSystem:
|
||||
return v.SystemVarStore.Get(ctx, path, opts...)
|
||||
case vo.GlobalAPP:
|
||||
return v.AppVarStore.Get(ctx, path, opts...)
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown variable type: %v", t)
|
||||
}
|
||||
}
|
||||
|
||||
func (v *Handler) Set(ctx context.Context, t vo.GlobalVarType, path compose.FieldPath, value any, opts ...OptionFn) error {
|
||||
switch t {
|
||||
case vo.GlobalUser:
|
||||
return v.UserVarStore.Set(ctx, path, value, opts...)
|
||||
case vo.GlobalSystem:
|
||||
return v.SystemVarStore.Set(ctx, path, value, opts...)
|
||||
case vo.GlobalAPP:
|
||||
return v.AppVarStore.Set(ctx, path, value, opts...)
|
||||
default:
|
||||
return fmt.Errorf("unknown variable type: %v", t)
|
||||
}
|
||||
}
|
||||
|
||||
func (v *Handler) Init(ctx context.Context) context.Context {
|
||||
if v.UserVarStore != nil {
|
||||
v.UserVarStore.Init(ctx)
|
||||
}
|
||||
|
||||
if v.SystemVarStore != nil {
|
||||
v.SystemVarStore.Init(ctx)
|
||||
}
|
||||
|
||||
if v.AppVarStore != nil {
|
||||
v.AppVarStore.Init(ctx)
|
||||
}
|
||||
|
||||
return ctx
|
||||
}
|
||||
|
||||
type StoreInfo struct {
|
||||
AppID *int64
|
||||
AgentID *int64
|
||||
ConnectorID int64
|
||||
ConnectorUID string
|
||||
}
|
||||
|
||||
type StoreConfig struct {
|
||||
StoreInfo StoreInfo
|
||||
}
|
||||
|
||||
type OptionFn func(*StoreConfig)
|
||||
|
||||
func WithStoreInfo(info StoreInfo) OptionFn {
|
||||
return func(option *StoreConfig) {
|
||||
option.StoreInfo = info
|
||||
}
|
||||
}
|
||||
|
||||
//go:generate mockgen -destination varmock/var_mock.go --package mockvar -source variable.go
|
||||
type Store interface {
|
||||
Init(ctx context.Context)
|
||||
Get(ctx context.Context, path compose.FieldPath, opts ...OptionFn) (any, error)
|
||||
Set(ctx context.Context, path compose.FieldPath, value any, opts ...OptionFn) error
|
||||
}
|
||||
|
||||
var variablesMetaGetterImpl VariablesMetaGetter
|
||||
|
||||
func GetVariablesMetaGetter() VariablesMetaGetter {
|
||||
return variablesMetaGetterImpl
|
||||
}
|
||||
|
||||
func SetVariablesMetaGetter(v VariablesMetaGetter) {
|
||||
variablesMetaGetterImpl = v
|
||||
}
|
||||
|
||||
type VariablesMetaGetter interface {
|
||||
GetAppVariablesMeta(ctx context.Context, id, version string) (m map[string]*vo.TypeInfo, err error)
|
||||
GetAgentVariablesMeta(ctx context.Context, id int64, version string) (m map[string]*vo.TypeInfo, err error)
|
||||
}
|
||||
165
backend/domain/workflow/crossdomain/variable/varmock/var_mock.go
Normal file
165
backend/domain/workflow/crossdomain/variable/varmock/var_mock.go
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: variable.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination varmock/var_mock.go --package mockvar -source variable.go
|
||||
//
|
||||
|
||||
// Package mockvar is a generated GoMock package.
|
||||
package mockvar
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
variable "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable"
|
||||
vo "github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
compose "github.com/cloudwego/eino/compose"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockStore is a mock of Store interface.
|
||||
type MockStore struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockStoreMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockStoreMockRecorder is the mock recorder for MockStore.
|
||||
type MockStoreMockRecorder struct {
|
||||
mock *MockStore
|
||||
}
|
||||
|
||||
// NewMockStore creates a new mock instance.
|
||||
func NewMockStore(ctrl *gomock.Controller) *MockStore {
|
||||
mock := &MockStore{ctrl: ctrl}
|
||||
mock.recorder = &MockStoreMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockStore) EXPECT() *MockStoreMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Get mocks base method.
|
||||
func (m *MockStore) Get(ctx context.Context, path compose.FieldPath, opts ...variable.OptionFn) (any, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []any{ctx, path}
|
||||
for _, a := range opts {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Get", varargs...)
|
||||
ret0, _ := ret[0].(any)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Get indicates an expected call of Get.
|
||||
func (mr *MockStoreMockRecorder) Get(ctx, path any, opts ...any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]any{ctx, path}, opts...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStore)(nil).Get), varargs...)
|
||||
}
|
||||
|
||||
// Init mocks base method.
|
||||
func (m *MockStore) Init(ctx context.Context) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "Init", ctx)
|
||||
}
|
||||
|
||||
// Init indicates an expected call of Init.
|
||||
func (mr *MockStoreMockRecorder) Init(ctx any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockStore)(nil).Init), ctx)
|
||||
}
|
||||
|
||||
// Set mocks base method.
|
||||
func (m *MockStore) Set(ctx context.Context, path compose.FieldPath, value any, opts ...variable.OptionFn) error {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []any{ctx, path, value}
|
||||
for _, a := range opts {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Set", varargs...)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Set indicates an expected call of Set.
|
||||
func (mr *MockStoreMockRecorder) Set(ctx, path, value any, opts ...any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]any{ctx, path, value}, opts...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockStore)(nil).Set), varargs...)
|
||||
}
|
||||
|
||||
// MockVariablesMetaGetter is a mock of VariablesMetaGetter interface.
|
||||
type MockVariablesMetaGetter struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockVariablesMetaGetterMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockVariablesMetaGetterMockRecorder is the mock recorder for MockVariablesMetaGetter.
|
||||
type MockVariablesMetaGetterMockRecorder struct {
|
||||
mock *MockVariablesMetaGetter
|
||||
}
|
||||
|
||||
// NewMockVariablesMetaGetter creates a new mock instance.
|
||||
func NewMockVariablesMetaGetter(ctrl *gomock.Controller) *MockVariablesMetaGetter {
|
||||
mock := &MockVariablesMetaGetter{ctrl: ctrl}
|
||||
mock.recorder = &MockVariablesMetaGetterMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockVariablesMetaGetter) EXPECT() *MockVariablesMetaGetterMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// GetAgentVariablesMeta mocks base method.
|
||||
func (m *MockVariablesMetaGetter) GetAgentVariablesMeta(ctx context.Context, id int64, version string) (map[string]*vo.TypeInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAgentVariablesMeta", ctx, id, version)
|
||||
ret0, _ := ret[0].(map[string]*vo.TypeInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetAgentVariablesMeta indicates an expected call of GetAgentVariablesMeta.
|
||||
func (mr *MockVariablesMetaGetterMockRecorder) GetAgentVariablesMeta(ctx, id, version any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentVariablesMeta", reflect.TypeOf((*MockVariablesMetaGetter)(nil).GetAgentVariablesMeta), ctx, id, version)
|
||||
}
|
||||
|
||||
// GetAppVariablesMeta mocks base method.
|
||||
func (m *MockVariablesMetaGetter) GetAppVariablesMeta(ctx context.Context, id, version string) (map[string]*vo.TypeInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAppVariablesMeta", ctx, id, version)
|
||||
ret0, _ := ret[0].(map[string]*vo.TypeInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetAppVariablesMeta indicates an expected call of GetAppVariablesMeta.
|
||||
func (mr *MockVariablesMetaGetterMockRecorder) GetAppVariablesMeta(ctx, id, version any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppVariablesMeta", reflect.TypeOf((*MockVariablesMetaGetter)(nil).GetAppVariablesMeta), ctx, id, version)
|
||||
}
|
||||
74
backend/domain/workflow/entity/interrupt_event.go
Normal file
74
backend/domain/workflow/entity/interrupt_event.go
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bytedance/sonic"
|
||||
"github.com/cloudwego/eino/compose"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type InterruptEvent struct {
|
||||
ID int64 `json:"id"`
|
||||
NodeKey vo.NodeKey `json:"node_key"`
|
||||
InterruptData string `json:"interrupt_data,omitempty"`
|
||||
NodeType NodeType `json:"node_type"`
|
||||
NodeTitle string `json:"node_title,omitempty"`
|
||||
NodeIcon string `json:"node_icon,omitempty"`
|
||||
EventType InterruptEventType `json:"event_type"`
|
||||
NodePath []string `json:"node_path,omitempty"`
|
||||
|
||||
// index within composite node -> interrupt info for that index
|
||||
// TODO: separate the following fields with InterruptEvent
|
||||
NestedInterruptInfo map[int]*compose.InterruptInfo `json:"nested_interrupt_info,omitempty"`
|
||||
SubWorkflowInterruptInfo *compose.InterruptInfo `json:"sub_workflow_interrupt_info,omitempty"`
|
||||
ToolInterruptEvent *ToolInterruptEvent `json:"tool_interrupt_event,omitempty"`
|
||||
}
|
||||
|
||||
type InterruptEventType = workflow.EventType
|
||||
|
||||
const (
|
||||
InterruptEventQuestion = workflow.EventType_Question
|
||||
InterruptEventInput = workflow.EventType_InputNode
|
||||
InterruptEventLLM = 100 // interrupt events emitted by LLM node, which are emitted by nodes within workflow tools
|
||||
)
|
||||
|
||||
func (i *InterruptEvent) String() string {
|
||||
s, _ := sonic.MarshalIndent(i, "", " ")
|
||||
return string(s)
|
||||
}
|
||||
|
||||
type ResumeRequest struct {
|
||||
ExecuteID int64
|
||||
EventID int64
|
||||
ResumeData string
|
||||
}
|
||||
|
||||
func (r *ResumeRequest) GetResumeID() string {
|
||||
return fmt.Sprintf("%d_%d", r.ExecuteID, r.EventID)
|
||||
}
|
||||
|
||||
type ToolInterruptEvent struct {
|
||||
ToolCallID string
|
||||
ToolName string
|
||||
ExecuteID int64
|
||||
*InterruptEvent
|
||||
}
|
||||
95
backend/domain/workflow/entity/message.go
Normal file
95
backend/domain/workflow/entity/message.go
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/cloudwego/eino/schema"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
*StateMessage
|
||||
*DataMessage
|
||||
}
|
||||
|
||||
// StateMessage represents a status change for the workflow execution.
|
||||
type StateMessage struct {
|
||||
ExecuteID int64
|
||||
EventID int64 // the resuming event ID for current execution
|
||||
SpaceID int64
|
||||
Status WorkflowExecuteStatus
|
||||
Usage *TokenUsage
|
||||
LastError vo.WorkflowError
|
||||
InterruptEvent *InterruptEvent
|
||||
}
|
||||
|
||||
// DataMessage represents a full or chunked message during a run that should go into message history.
|
||||
type DataMessage struct {
|
||||
ExecuteID int64 // the root execute ID for current execution
|
||||
Role schema.RoleType
|
||||
Type MessageType
|
||||
Content string
|
||||
NodeID string
|
||||
NodeTitle string
|
||||
NodeType NodeType
|
||||
Last bool
|
||||
Usage *TokenUsage
|
||||
FunctionCall *FunctionCallInfo
|
||||
ToolResponse *ToolResponseInfo
|
||||
}
|
||||
|
||||
type MessageType string
|
||||
|
||||
const (
|
||||
Answer MessageType = "answer"
|
||||
FunctionCall MessageType = "function_call"
|
||||
ToolResponse MessageType = "tool_response"
|
||||
)
|
||||
|
||||
type FunctionInfo struct {
|
||||
Name string `json:"name"`
|
||||
Type ToolType `json:"plugin_type"`
|
||||
|
||||
PluginID int64 `json:"plugin_id,omitempty"`
|
||||
PluginName string `json:"plugin_name,omitempty"`
|
||||
APIID int64 `json:"api_id,omitempty"`
|
||||
APIName string `json:"api_name,omitempty"`
|
||||
|
||||
WorkflowName string `json:"workflow_name,omitempty"`
|
||||
WorkflowTerminatePlan vo.TerminatePlan `json:"terminate_plan,omitempty"`
|
||||
}
|
||||
|
||||
type FunctionCallInfo struct {
|
||||
FunctionInfo
|
||||
CallID string `json:"-"`
|
||||
Arguments string `json:"arguments"`
|
||||
}
|
||||
|
||||
type ToolResponseInfo struct {
|
||||
FunctionInfo
|
||||
CallID string
|
||||
Response string
|
||||
}
|
||||
|
||||
type ToolType = workflow.PluginType
|
||||
|
||||
const (
|
||||
PluginTool = workflow.PluginType_PLUGIN
|
||||
WorkflowTool = workflow.PluginType_WORKFLOW
|
||||
)
|
||||
133
backend/domain/workflow/entity/node_meta.go
Normal file
133
backend/domain/workflow/entity/node_meta.go
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
type NodeType string
|
||||
|
||||
type NodeTypeMeta struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type NodeType `json:"type"`
|
||||
Category string `json:"category"`
|
||||
Color string `json:"color"`
|
||||
Desc string `json:"desc"`
|
||||
IconURL string `json:"icon_url"`
|
||||
SupportBatch bool `json:"support_batch"`
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
EnUSName string `json:"en_us_name,omitempty"`
|
||||
EnUSDescription string `json:"en_us_description,omitempty"`
|
||||
|
||||
ExecutableMeta
|
||||
}
|
||||
|
||||
type Category struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
EnUSName string `json:"en_us_name"`
|
||||
}
|
||||
|
||||
type StreamingParadigm string
|
||||
|
||||
const (
|
||||
Invoke StreamingParadigm = "invoke"
|
||||
Stream StreamingParadigm = "stream"
|
||||
Collect StreamingParadigm = "collect"
|
||||
Transform StreamingParadigm = "transform"
|
||||
)
|
||||
|
||||
type ExecutableMeta struct {
|
||||
IsComposite bool `json:"is_composite,omitempty"`
|
||||
DefaultTimeoutMS int64 `json:"default_timeout_ms,omitempty"` // default timeout in milliseconds, 0 means no timeout
|
||||
PreFillZero bool `json:"pre_fill_zero,omitempty"`
|
||||
PostFillNil bool `json:"post_fill_nil,omitempty"`
|
||||
CallbackEnabled bool `json:"callback_enabled,omitempty"` // is false, Eino framework will inject callbacks for this node
|
||||
MayUseChatModel bool `json:"may_use_chat_model,omitempty"`
|
||||
InputSourceAware bool `json:"input_source_aware,omitempty"` // whether this node needs to know the runtime status of its input sources
|
||||
StreamingParadigms map[StreamingParadigm]bool `json:"streaming_paradigms,omitempty"`
|
||||
StreamSourceEOFAware bool `json:"needs_stream_source_eof,omitempty"` // whether this node needs to be aware stream sources' SourceEOF error
|
||||
/*
|
||||
IncrementalOutput indicates that the node's output is intended for progressive, user-facing streaming.
|
||||
This distinguishes nodes that actually stream text to the user (e.g., 'Exit', 'Output')
|
||||
from those that are merely capable of streaming internally (defined by StreamingParadigms),
|
||||
whose output is consumed by other nodes.
|
||||
In essence, nodes with IncrementalOutput are a subset of those defined in StreamingParadigms.
|
||||
When set to true, stream chunks from the node are persisted in real-time and can be fetched by get_process.
|
||||
*/
|
||||
IncrementalOutput bool `json:"incremental_output,omitempty"`
|
||||
}
|
||||
|
||||
type PluginNodeMeta struct {
|
||||
PluginID int64 `json:"plugin_id"`
|
||||
NodeType NodeType `json:"node_type"`
|
||||
Category string `json:"category"`
|
||||
ApiID int64 `json:"api_id"`
|
||||
ApiName string `json:"api_name"`
|
||||
Name string `json:"name"`
|
||||
Desc string `json:"desc"`
|
||||
IconURL string `json:"icon_url"`
|
||||
}
|
||||
|
||||
type PluginCategoryMeta struct {
|
||||
PluginCategoryMeta int64 `json:"plugin_category_meta"`
|
||||
NodeType NodeType `json:"node_type"`
|
||||
Category string `json:"category"`
|
||||
Name string `json:"name"`
|
||||
OnlyOfficial bool `json:"only_official"`
|
||||
IconURL string `json:"icon_url"`
|
||||
}
|
||||
|
||||
const (
|
||||
NodeTypeVariableAggregator NodeType = "VariableAggregator"
|
||||
NodeTypeIntentDetector NodeType = "IntentDetector"
|
||||
NodeTypeTextProcessor NodeType = "TextProcessor"
|
||||
NodeTypeHTTPRequester NodeType = "HTTPRequester"
|
||||
NodeTypeLoop NodeType = "Loop"
|
||||
NodeTypeContinue NodeType = "Continue"
|
||||
NodeTypeBreak NodeType = "Break"
|
||||
NodeTypeVariableAssigner NodeType = "VariableAssigner"
|
||||
NodeTypeVariableAssignerWithinLoop NodeType = "VariableAssignerWithinLoop"
|
||||
NodeTypeQuestionAnswer NodeType = "QuestionAnswer"
|
||||
NodeTypeInputReceiver NodeType = "InputReceiver"
|
||||
NodeTypeOutputEmitter NodeType = "OutputEmitter"
|
||||
NodeTypeDatabaseCustomSQL NodeType = "DatabaseCustomSQL"
|
||||
NodeTypeDatabaseQuery NodeType = "DatabaseQuery"
|
||||
NodeTypeDatabaseInsert NodeType = "DatabaseInsert"
|
||||
NodeTypeDatabaseDelete NodeType = "DatabaseDelete"
|
||||
NodeTypeDatabaseUpdate NodeType = "DatabaseUpdate"
|
||||
NodeTypeKnowledgeIndexer NodeType = "KnowledgeIndexer"
|
||||
NodeTypeKnowledgeRetriever NodeType = "KnowledgeRetriever"
|
||||
NodeTypeKnowledgeDeleter NodeType = "KnowledgeDeleter"
|
||||
NodeTypeEntry NodeType = "Entry"
|
||||
NodeTypeExit NodeType = "Exit"
|
||||
NodeTypeCodeRunner NodeType = "CodeRunner"
|
||||
NodeTypePlugin NodeType = "Plugin"
|
||||
NodeTypeCreateConversation NodeType = "CreateConversation"
|
||||
NodeTypeMessageList NodeType = "MessageList"
|
||||
NodeTypeClearMessage NodeType = "ClearMessage"
|
||||
NodeTypeLambda NodeType = "Lambda"
|
||||
NodeTypeLLM NodeType = "LLM"
|
||||
NodeTypeSelector NodeType = "Selector"
|
||||
NodeTypeBatch NodeType = "Batch"
|
||||
NodeTypeSubWorkflow NodeType = "SubWorkflow"
|
||||
NodeTypeJsonSerialization NodeType = "JsonSerialization"
|
||||
NodeTypeJsonDeserialization NodeType = "JsonDeserialization"
|
||||
)
|
||||
|
||||
const (
|
||||
EntryNodeKey = "100001"
|
||||
ExitNodeKey = "900001"
|
||||
)
|
||||
867
backend/domain/workflow/entity/node_type_literal.go
Normal file
867
backend/domain/workflow/entity/node_type_literal.go
Normal file
@@ -0,0 +1,867 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/i18n"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/ternary"
|
||||
)
|
||||
|
||||
var Categories = []Category{
|
||||
{
|
||||
Key: "", // this is the default category. some of the most important nodes belong here, such as LLM, plugin, sub-workflow
|
||||
Name: "",
|
||||
EnUSName: "",
|
||||
},
|
||||
{
|
||||
Key: "logic",
|
||||
Name: "业务逻辑",
|
||||
EnUSName: "Logic",
|
||||
},
|
||||
{
|
||||
Key: "input&output",
|
||||
Name: "输入&输出",
|
||||
EnUSName: "Input&Output",
|
||||
},
|
||||
{
|
||||
Key: "database",
|
||||
Name: "数据库",
|
||||
EnUSName: "Database",
|
||||
},
|
||||
{
|
||||
Key: "data",
|
||||
Name: "知识库&数据",
|
||||
EnUSName: "Data",
|
||||
},
|
||||
{
|
||||
Key: "image",
|
||||
Name: "图像处理",
|
||||
EnUSName: "Image",
|
||||
},
|
||||
{
|
||||
Key: "audio&video",
|
||||
Name: "音视频处理",
|
||||
EnUSName: "Audio&Video",
|
||||
},
|
||||
{
|
||||
Key: "utilities",
|
||||
Name: "组件",
|
||||
EnUSName: "Utilities",
|
||||
},
|
||||
{
|
||||
Key: "conversation_management",
|
||||
Name: "会话管理",
|
||||
EnUSName: "Conversation management",
|
||||
},
|
||||
{
|
||||
Key: "conversation_history",
|
||||
Name: "会话历史",
|
||||
EnUSName: "Conversation history",
|
||||
},
|
||||
{
|
||||
Key: "message",
|
||||
Name: "消息",
|
||||
EnUSName: "Message",
|
||||
},
|
||||
}
|
||||
|
||||
// NodeTypeMetas holds the metadata for all available node types.
|
||||
// It is initialized with built-in types and potentially extended by loading from external sources.
|
||||
var NodeTypeMetas = []*NodeTypeMeta{
|
||||
{
|
||||
ID: 1,
|
||||
Name: "开始",
|
||||
Type: NodeTypeEntry,
|
||||
Category: "input&output", // Mapped from cate_list
|
||||
Desc: "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
Color: "#5C62FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Start",
|
||||
EnUSDescription: "The starting node of the workflow, used to set the information needed to initiate the workflow.",
|
||||
},
|
||||
{
|
||||
ID: 2,
|
||||
Name: "结束",
|
||||
Type: NodeTypeExit,
|
||||
Category: "input&output", // Mapped from cate_list
|
||||
Desc: "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
Color: "#5C62FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
InputSourceAware: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true, Transform: true},
|
||||
StreamSourceEOFAware: true,
|
||||
IncrementalOutput: true,
|
||||
},
|
||||
EnUSName: "End",
|
||||
EnUSDescription: "The final node of the workflow, used to return the result information after the workflow runs.",
|
||||
},
|
||||
{
|
||||
ID: 3,
|
||||
Name: "大模型",
|
||||
Type: NodeTypeLLM,
|
||||
Category: "", // Mapped from cate_list
|
||||
Desc: "调用大语言模型,使用变量和提示词生成回复",
|
||||
Color: "#5C62FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
SupportBatch: true, // supportBatch: 2
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 3 * 60 * 1000, // 3 minutes
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
InputSourceAware: true,
|
||||
MayUseChatModel: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true, Stream: true},
|
||||
},
|
||||
EnUSName: "LLM",
|
||||
EnUSDescription: "Invoke the large language model, generate responses using variables and prompt words.",
|
||||
},
|
||||
|
||||
{
|
||||
ID: 4,
|
||||
Name: "插件",
|
||||
Type: NodeTypePlugin,
|
||||
Category: "", // Mapped from cate_list
|
||||
Desc: "通过添加工具访问实时数据和执行外部操作",
|
||||
Color: "#CA61FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
SupportBatch: true, // supportBatch: 2
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 3 * 60 * 1000, // 3 minutes
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Plugin",
|
||||
EnUSDescription: "Used to access external real-time data and perform operations",
|
||||
},
|
||||
{
|
||||
ID: 5,
|
||||
Name: "代码",
|
||||
Type: NodeTypeCodeRunner,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "编写代码,处理输入变量来生成返回值",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Code-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Code",
|
||||
EnUSDescription: "Write code to process input variables to generate return values.",
|
||||
},
|
||||
{
|
||||
ID: 6,
|
||||
Name: "知识库检索",
|
||||
Type: NodeTypeKnowledgeRetriever,
|
||||
Category: "data", // Mapped from cate_list
|
||||
Desc: "在选定的知识中,根据输入变量召回最匹配的信息,并以列表形式返回",
|
||||
Color: "#FF811A",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeQuery-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Knowledge retrieval",
|
||||
EnUSDescription: "In the selected knowledge, the best matching information is recalled based on the input variable and returned as an Array.",
|
||||
},
|
||||
{
|
||||
ID: 8,
|
||||
Name: "选择器",
|
||||
Type: NodeTypeSelector,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "连接多个下游分支,若设定的条件成立则仅运行对应的分支,若均不成立则只运行“否则”分支",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Condition-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Condition",
|
||||
EnUSDescription: "Connect multiple downstream branches. Only the corresponding branch will be executed if the set conditions are met. If none are met, only the 'else' branch will be executed.",
|
||||
},
|
||||
{
|
||||
ID: 9,
|
||||
Name: "工作流",
|
||||
Type: NodeTypeSubWorkflow,
|
||||
Category: "", // Mapped from cate_list
|
||||
Desc: "集成已发布工作流,可以执行嵌套子任务",
|
||||
Color: "#00B83E",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
SupportBatch: true, // supportBatch: 2
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Workflow",
|
||||
EnUSDescription: "Add published workflows to execute subtasks",
|
||||
},
|
||||
{
|
||||
ID: 12,
|
||||
Name: "SQL自定义",
|
||||
Type: NodeTypeDatabaseCustomSQL,
|
||||
Category: "database", // Mapped from cate_list
|
||||
Desc: "基于用户自定义的 SQL 完成对数据库的增删改查操作",
|
||||
Color: "#FF811A",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Database-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 2
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "SQL Customization",
|
||||
EnUSDescription: "Complete the operations of adding, deleting, modifying and querying the database based on user-defined SQL",
|
||||
},
|
||||
{
|
||||
ID: 13,
|
||||
Name: "输出",
|
||||
Type: NodeTypeOutputEmitter,
|
||||
Category: "input&output", // Mapped from cate_list
|
||||
Desc: "节点从“消息”更名为“输出”,支持中间过程的消息输出,支持流式和非流式两种方式",
|
||||
Color: "#5C62FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Output-v2.jpg",
|
||||
SupportBatch: false,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
InputSourceAware: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true, Stream: true},
|
||||
StreamSourceEOFAware: true,
|
||||
IncrementalOutput: true,
|
||||
},
|
||||
EnUSName: "Output",
|
||||
EnUSDescription: "The node is renamed from \"message\" to \"output\", Supports message output in the intermediate process and streaming and non-streaming methods",
|
||||
},
|
||||
{
|
||||
ID: 15,
|
||||
Name: "文本处理",
|
||||
Type: NodeTypeTextProcessor,
|
||||
Category: "utilities", // Mapped from cate_list
|
||||
Desc: "用于处理多个字符串类型变量的格式",
|
||||
Color: "#3071F2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 2
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
InputSourceAware: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Text Processing",
|
||||
EnUSDescription: "The format used for handling multiple string-type variables.",
|
||||
},
|
||||
{
|
||||
ID: 18,
|
||||
Name: "问答",
|
||||
Type: NodeTypeQuestionAnswer,
|
||||
Category: "utilities", // Mapped from cate_list
|
||||
Desc: "支持中间向用户提问问题,支持预置选项提问和开放式问题提问两种方式",
|
||||
Color: "#3071F2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Direct-Question-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
MayUseChatModel: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Question",
|
||||
EnUSDescription: "Support asking questions to the user in the middle of the conversation, with both preset options and open-ended questions",
|
||||
},
|
||||
{
|
||||
ID: 19,
|
||||
Name: "终止循环",
|
||||
Type: NodeTypeBreak,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "用于立即终止当前所在的循环,跳出循环体",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Break-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Break",
|
||||
EnUSDescription: "Used to immediately terminate the current loop and jump out of the loop",
|
||||
},
|
||||
{
|
||||
ID: 20,
|
||||
Name: "设置变量",
|
||||
Type: NodeTypeVariableAssignerWithinLoop,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "用于重置循环变量的值,使其下次循环使用重置后的值",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LoopSetVariable-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Set Variable",
|
||||
EnUSDescription: "Used to reset the value of the loop variable so that it uses the reset value in the next iteration",
|
||||
},
|
||||
{
|
||||
ID: 21,
|
||||
Name: "循环",
|
||||
Type: NodeTypeLoop,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "用于通过设定循环次数和逻辑,重复执行一系列任务",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Loop-v2.jpg",
|
||||
SupportBatch: false,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
IsComposite: true,
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Loop",
|
||||
EnUSDescription: "Used to repeatedly execute a series of tasks by setting the number of iterations and logic",
|
||||
},
|
||||
{
|
||||
ID: 22,
|
||||
Name: "意图识别",
|
||||
Type: NodeTypeIntentDetector,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "用于用户输入的意图识别,并将其与预设意图选项进行匹配。",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Intent-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
MayUseChatModel: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Intent recognition",
|
||||
EnUSDescription: "Used for recognizing the intent in user input and matching it with preset intent options.",
|
||||
},
|
||||
{
|
||||
ID: 27,
|
||||
Name: "知识库写入",
|
||||
Type: NodeTypeKnowledgeIndexer,
|
||||
Category: "data", // Mapped from cate_list
|
||||
Desc: "写入节点可以添加 文本类型 的知识库,仅可以添加一个知识库",
|
||||
Color: "#FF811A",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeWriting-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Knowledge writing",
|
||||
EnUSDescription: "The write node can add a knowledge base of type text. Only one knowledge base can be added.",
|
||||
},
|
||||
{
|
||||
ID: 28,
|
||||
Name: "批处理",
|
||||
Type: NodeTypeBatch,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "通过设定批量运行次数和逻辑,运行批处理体内的任务",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Batch-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1 (Corrected from previous assumption)
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
IsComposite: true,
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Batch",
|
||||
EnUSDescription: "By setting the number of batch runs and logic, run the tasks in the batch body.",
|
||||
},
|
||||
{
|
||||
ID: 29,
|
||||
Name: "继续循环",
|
||||
Type: NodeTypeContinue,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "用于终止当前循环,执行下次循环",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Continue-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Continue",
|
||||
EnUSDescription: "Used to immediately terminate the current loop and execute next loop",
|
||||
},
|
||||
{
|
||||
ID: 30,
|
||||
Name: "输入",
|
||||
Type: NodeTypeInputReceiver,
|
||||
Category: "input&output", // Mapped from cate_list
|
||||
Desc: "支持中间过程的信息输入",
|
||||
Color: "#5C62FF",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Input-v2.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Input",
|
||||
EnUSDescription: "Support intermediate information input",
|
||||
},
|
||||
{
|
||||
ID: 31,
|
||||
Name: "注释",
|
||||
Type: "",
|
||||
Category: "", // Not found in cate_list
|
||||
Desc: "comment_desc", // Placeholder from JSON
|
||||
Color: "",
|
||||
IconURL: "comment_icon", // Placeholder from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
EnUSName: "Comment",
|
||||
},
|
||||
{
|
||||
ID: 32,
|
||||
Name: "变量聚合",
|
||||
Type: NodeTypeVariableAggregator,
|
||||
Category: "logic", // Mapped from cate_list
|
||||
Desc: "对多个分支的输出进行聚合处理",
|
||||
Color: "#00B2B2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/VariableMerge-icon.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
InputSourceAware: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true, Transform: true},
|
||||
},
|
||||
EnUSName: "Variable Merge",
|
||||
EnUSDescription: "Aggregate the outputs of multiple branches.",
|
||||
},
|
||||
{
|
||||
ID: 37,
|
||||
Name: "查询消息列表",
|
||||
Type: NodeTypeMessageList,
|
||||
Category: "message", // Mapped from cate_list
|
||||
Desc: "用于查询消息列表",
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Conversation-List.jpeg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
Disabled: true,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Query message list",
|
||||
EnUSDescription: "Used to query the message list",
|
||||
},
|
||||
{
|
||||
ID: 38,
|
||||
Name: "清除上下文",
|
||||
Type: NodeTypeClearMessage,
|
||||
Category: "conversation_history", // Mapped from cate_list
|
||||
Desc: "用于清空会话历史,清空后LLM看到的会话历史为空",
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Conversation-Delete.jpeg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
Disabled: true,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Clear conversation history",
|
||||
EnUSDescription: "Used to clear conversation history. After clearing, the conversation history visible to the LLM node will be empty.",
|
||||
},
|
||||
{
|
||||
ID: 39,
|
||||
Name: "创建会话",
|
||||
Type: NodeTypeCreateConversation,
|
||||
Category: "conversation_management", // Mapped from cate_list
|
||||
Desc: "用于创建会话",
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Conversation-Create.jpeg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
Disabled: true,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Create conversation",
|
||||
EnUSDescription: "This node is used to create a conversation.",
|
||||
},
|
||||
{
|
||||
ID: 40,
|
||||
Name: "变量赋值",
|
||||
Type: NodeTypeVariableAssigner,
|
||||
Category: "data", // Mapped from cate_list
|
||||
Desc: "用于给支持写入的变量赋值,包括应用变量、用户变量",
|
||||
Color: "#FF811A",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/Variable.jpg",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Variable assign",
|
||||
EnUSDescription: "Assigns values to variables that support the write operation, including app and user variables.",
|
||||
},
|
||||
{
|
||||
ID: 42,
|
||||
Name: "更新数据",
|
||||
Type: NodeTypeDatabaseUpdate,
|
||||
Category: "database", // Mapped from cate_list
|
||||
Desc: "修改表中已存在的数据记录,用户指定更新条件和内容来更新数据",
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-update.jpg", // Corrected Icon URL from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Update Data",
|
||||
EnUSDescription: "Modify the existing data records in the table, and the user specifies the update conditions and contents to update the data",
|
||||
},
|
||||
{
|
||||
ID: 43,
|
||||
Name: "查询数据", // Corrected Name from JSON (was "插入数据")
|
||||
Type: NodeTypeDatabaseQuery,
|
||||
Category: "database", // Mapped from cate_list
|
||||
Desc: "从表获取数据,用户可定义查询条件、选择列等,输出符合条件的数据", // Corrected Desc from JSON
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icaon-database-select.jpg", // Corrected Icon URL from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Query Data",
|
||||
EnUSDescription: "Query data from the table, and the user can define query conditions, select columns, etc., and output the data that meets the conditions",
|
||||
},
|
||||
{
|
||||
ID: 44,
|
||||
Name: "删除数据",
|
||||
Type: NodeTypeDatabaseDelete,
|
||||
Category: "database", // Mapped from cate_list
|
||||
Desc: "从表中删除数据记录,用户指定删除条件来删除符合条件的记录", // Corrected Desc from JSON
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-delete.jpg", // Corrected Icon URL from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Delete Data",
|
||||
EnUSDescription: "Delete data records from the table, and the user specifies the deletion conditions to delete the records that meet the conditions",
|
||||
},
|
||||
{
|
||||
ID: 45,
|
||||
Name: "HTTP 请求",
|
||||
Type: NodeTypeHTTPRequester,
|
||||
Category: "utilities", // Mapped from cate_list
|
||||
Desc: "用于发送API请求,从接口返回数据", // Corrected Desc from JSON
|
||||
Color: "#3071F2",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png", // Corrected Icon URL from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "HTTP request",
|
||||
EnUSDescription: "It is used to send API requests and return data from the interface.",
|
||||
},
|
||||
{
|
||||
ID: 46,
|
||||
Name: "新增数据", // Corrected Name from JSON (was "查询数据")
|
||||
Type: NodeTypeDatabaseInsert,
|
||||
Category: "database", // Mapped from cate_list
|
||||
Desc: "向表添加新数据记录,用户输入数据内容后插入数据库", // Corrected Desc from JSON
|
||||
Color: "#F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-insert.jpg", // Corrected Icon URL from JSON
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Add Data",
|
||||
EnUSDescription: "Add new data records to the table, and insert them into the database after the user enters the data content",
|
||||
},
|
||||
{
|
||||
ID: 58,
|
||||
Name: "JSON 序列化",
|
||||
Type: NodeTypeJsonSerialization,
|
||||
Category: "utilities",
|
||||
Desc: "用于把变量转化为JSON字符串",
|
||||
Color: "F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-to_json.png",
|
||||
SupportBatch: false,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "JSON serialization",
|
||||
EnUSDescription: "Convert variable to JSON string",
|
||||
},
|
||||
{
|
||||
ID: 59,
|
||||
Name: "JSON 反序列化",
|
||||
Type: NodeTypeJsonDeserialization,
|
||||
Category: "utilities",
|
||||
Desc: "用于将JSON字符串解析为变量",
|
||||
Color: "F2B600",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-from_json.png",
|
||||
SupportBatch: false,
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
CallbackEnabled: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "JSON deserialization",
|
||||
EnUSDescription: "Parse JSON string to variable",
|
||||
},
|
||||
{
|
||||
ID: 60,
|
||||
Name: "知识库删除",
|
||||
Type: NodeTypeKnowledgeDeleter,
|
||||
Category: "data", // Mapped from cate_list
|
||||
Desc: "用于删除知识库中的文档",
|
||||
Color: "#FF811A",
|
||||
IconURL: "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icons-dataset-delete.png",
|
||||
SupportBatch: false, // supportBatch: 1
|
||||
ExecutableMeta: ExecutableMeta{
|
||||
DefaultTimeoutMS: 60 * 1000, // 1 minute
|
||||
PreFillZero: true,
|
||||
PostFillNil: true,
|
||||
StreamingParadigms: map[StreamingParadigm]bool{Invoke: true},
|
||||
},
|
||||
EnUSName: "Knowledge delete",
|
||||
EnUSDescription: "The delete node can delete a document in knowledge base.",
|
||||
},
|
||||
// --- End of nodes parsed from template_list ---
|
||||
}
|
||||
|
||||
// PluginNodeMetas holds metadata for specific plugin API entity.
|
||||
var PluginNodeMetas []*PluginNodeMeta
|
||||
|
||||
// PluginCategoryMetas holds metadata for plugin category entity.
|
||||
var PluginCategoryMetas []*PluginCategoryMeta
|
||||
|
||||
func NodeMetaByNodeType(t NodeType) *NodeTypeMeta {
|
||||
for _, meta := range NodeTypeMetas {
|
||||
if meta.Type == t {
|
||||
return meta
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const defaultZhCNInitCanvasJsonSchema = `{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}`
|
||||
|
||||
const defaultEnUSInitCanvasJsonSchema = `{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The starting node of the workflow, used to set the information needed to initiate the workflow.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "Start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The final node of the workflow, used to return the result information after the workflow runs.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "End"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}`
|
||||
|
||||
func GetDefaultInitCanvasJsonSchema(locale i18n.Locale) string {
|
||||
return ternary.IFElse(locale == i18n.LocaleEN, defaultEnUSInitCanvasJsonSchema, defaultZhCNInitCanvasJsonSchema)
|
||||
}
|
||||
634
backend/domain/workflow/entity/vo/canvas.go
Normal file
634
backend/domain/workflow/entity/vo/canvas.go
Normal file
@@ -0,0 +1,634 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model"
|
||||
)
|
||||
|
||||
type Canvas struct {
|
||||
Nodes []*Node `json:"nodes"`
|
||||
Edges []*Edge `json:"edges"`
|
||||
Versions any `json:"versions"`
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
ID string `json:"id"`
|
||||
Type BlockType `json:"type"`
|
||||
Meta any `json:"meta"`
|
||||
Data *Data `json:"data"`
|
||||
Blocks []*Node `json:"blocks,omitempty"`
|
||||
Edges []*Edge `json:"edges,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
|
||||
parent *Node
|
||||
}
|
||||
|
||||
func (n *Node) SetParent(parent *Node) {
|
||||
n.parent = parent
|
||||
}
|
||||
|
||||
func (n *Node) Parent() *Node {
|
||||
return n.parent
|
||||
}
|
||||
|
||||
type NodeMeta struct {
|
||||
Title string `json:"title,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
SubTitle string `json:"subTitle,omitempty"`
|
||||
MainColor string `json:"mainColor,omitempty"`
|
||||
}
|
||||
|
||||
type Edge struct {
|
||||
SourceNodeID string `json:"sourceNodeID"`
|
||||
TargetNodeID string `json:"targetNodeID"`
|
||||
SourcePortID string `json:"sourcePortID,omitempty"`
|
||||
TargetPortID string `json:"targetPortID,omitempty"`
|
||||
}
|
||||
|
||||
type Data struct {
|
||||
Meta *NodeMeta `json:"nodeMeta,omitempty"`
|
||||
Outputs []any `json:"outputs,omitempty"` // either []*Variable or []*Param
|
||||
Inputs *Inputs `json:"inputs,omitempty"`
|
||||
Size any `json:"size,omitempty"`
|
||||
}
|
||||
|
||||
type Inputs struct {
|
||||
InputParameters []*Param `json:"inputParameters"`
|
||||
Content *BlockInput `json:"content"`
|
||||
TerminatePlan *TerminatePlan `json:"terminatePlan,omitempty"`
|
||||
StreamingOutput bool `json:"streamingOutput,omitempty"`
|
||||
CallTransferVoice bool `json:"callTransferVoice,omitempty"`
|
||||
ChatHistoryWriting string `json:"chatHistoryWriting,omitempty"`
|
||||
LLMParam any `json:"llmParam,omitempty"` // The LLMParam type may be one of the LLMParam or IntentDetectorLLMParam type or QALLMParam type
|
||||
FCParam *FCParam `json:"fcParam,omitempty"`
|
||||
SettingOnError *SettingOnError `json:"settingOnError,omitempty"`
|
||||
|
||||
LoopType LoopType `json:"loopType,omitempty"`
|
||||
LoopCount *BlockInput `json:"loopCount,omitempty"`
|
||||
VariableParameters []*Param `json:"variableParameters,omitempty"`
|
||||
|
||||
Branches []*struct {
|
||||
Condition struct {
|
||||
Logic LogicType `json:"logic"`
|
||||
Conditions []*Condition `json:"conditions"`
|
||||
} `json:"condition"`
|
||||
} `json:"branches,omitempty"`
|
||||
|
||||
NodeBatchInfo *NodeBatch `json:"batch,omitempty"` // node in batch mode
|
||||
|
||||
*TextProcessor
|
||||
*SubWorkflow
|
||||
*IntentDetector
|
||||
*DatabaseNode
|
||||
*HttpRequestNode
|
||||
*KnowledgeIndexer
|
||||
*CodeRunner
|
||||
*PluginAPIParam
|
||||
*VariableAggregator
|
||||
*VariableAssigner
|
||||
*QA
|
||||
*Batch
|
||||
*Comment
|
||||
|
||||
OutputSchema string `json:"outputSchema,omitempty"`
|
||||
}
|
||||
|
||||
type Comment struct {
|
||||
SchemaType string `json:"schemaType,omitempty"`
|
||||
Note any `json:"note,omitempty"`
|
||||
}
|
||||
|
||||
type TextProcessor struct {
|
||||
Method TextProcessingMethod `json:"method,omitempty"`
|
||||
ConcatParams []*Param `json:"concatParams,omitempty"`
|
||||
SplitParams []*Param `json:"splitParams,omitempty"`
|
||||
}
|
||||
|
||||
type VariableAssigner struct {
|
||||
VariableTypeMap map[string]any `json:"variableTypeMap,omitempty"`
|
||||
}
|
||||
|
||||
type LLMParam = []*Param
|
||||
type IntentDetectorLLMParam = map[string]any
|
||||
type QALLMParam struct {
|
||||
GenerationDiversity string `json:"generationDiversity"`
|
||||
MaxTokens int `json:"maxTokens"`
|
||||
ModelName string `json:"modelName"`
|
||||
ModelType int64 `json:"modelType"`
|
||||
ResponseFormat model.ResponseFormat `json:"responseFormat"`
|
||||
SystemPrompt string `json:"systemPrompt"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
TopP float64 `json:"topP"`
|
||||
}
|
||||
|
||||
type QA struct {
|
||||
AnswerType QAAnswerType `json:"answer_type"`
|
||||
Limit int `json:"limit,omitempty"`
|
||||
ExtractOutput bool `json:"extra_output,omitempty"`
|
||||
OptionType QAOptionType `json:"option_type,omitempty"`
|
||||
Options []struct {
|
||||
Name string `json:"name"`
|
||||
} `json:"options,omitempty"`
|
||||
Question string `json:"question,omitempty"`
|
||||
DynamicOption *BlockInput `json:"dynamic_option,omitempty"`
|
||||
}
|
||||
|
||||
type QAAnswerType string
|
||||
|
||||
const (
|
||||
QAAnswerTypeOption QAAnswerType = "option"
|
||||
QAAnswerTypeText QAAnswerType = "text"
|
||||
)
|
||||
|
||||
type QAOptionType string
|
||||
|
||||
const (
|
||||
QAOptionTypeStatic QAOptionType = "static"
|
||||
QAOptionTypeDynamic QAOptionType = "dynamic"
|
||||
)
|
||||
|
||||
type RequestParameter struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type FCParam struct {
|
||||
WorkflowFCParam *struct {
|
||||
WorkflowList []struct {
|
||||
WorkflowID string `json:"workflow_id"`
|
||||
WorkflowVersion string `json:"workflow_version"`
|
||||
PluginID string `json:"plugin_id"`
|
||||
PluginVersion string `json:"plugin_version"`
|
||||
IsDraft bool `json:"is_draft"`
|
||||
FCSetting *struct {
|
||||
RequestParameters []*workflow.APIParameter `json:"request_params"`
|
||||
ResponseParameters []*workflow.APIParameter `json:"response_params"`
|
||||
} `json:"fc_setting,omitempty"`
|
||||
} `json:"workflowList,omitempty"`
|
||||
} `json:"workflowFCParam,omitempty"`
|
||||
PluginFCParam *struct {
|
||||
PluginList []struct {
|
||||
PluginID string `json:"plugin_id"`
|
||||
ApiId string `json:"api_id"`
|
||||
ApiName string `json:"api_name"`
|
||||
PluginVersion string `json:"plugin_version"`
|
||||
IsDraft bool `json:"is_draft"`
|
||||
FCSetting *struct {
|
||||
RequestParameters []*workflow.APIParameter `json:"request_params"`
|
||||
ResponseParameters []*workflow.APIParameter `json:"response_params"`
|
||||
} `json:"fc_setting,omitempty"`
|
||||
}
|
||||
} `json:"pluginFCParam,omitempty"`
|
||||
|
||||
KnowledgeFCParam *struct {
|
||||
GlobalSetting *struct {
|
||||
SearchMode int64 `json:"search_mode"`
|
||||
TopK int64 `json:"top_k"`
|
||||
MinScore float64 `json:"min_score"`
|
||||
UseNL2SQL bool `json:"use_nl2_sql"`
|
||||
UseRewrite bool `json:"use_rewrite"`
|
||||
UseRerank bool `json:"use_rerank"`
|
||||
NoRecallReplyCustomizePrompt string `json:"no_recall_reply_customize_prompt"`
|
||||
NoRecallReplyMode int64 `json:"no_recall_reply_mode"`
|
||||
} `json:"global_setting,omitempty"`
|
||||
KnowledgeList []*struct {
|
||||
ID string `json:"id"`
|
||||
} `json:"knowledgeList,omitempty"`
|
||||
} `json:"knowledgeFCParam,omitempty"`
|
||||
}
|
||||
|
||||
type Batch struct {
|
||||
BatchSize *BlockInput `json:"batchSize,omitempty"`
|
||||
ConcurrentSize *BlockInput `json:"concurrentSize,omitempty"`
|
||||
}
|
||||
|
||||
type NodeBatch struct {
|
||||
BatchEnable bool `json:"batchEnable"`
|
||||
BatchSize int64 `json:"batchSize"`
|
||||
ConcurrentSize int64 `json:"concurrentSize"`
|
||||
InputLists []*Param `json:"inputLists,omitempty"`
|
||||
}
|
||||
|
||||
type IntentDetectorLLMConfig struct {
|
||||
ModelName string `json:"modelName"`
|
||||
ModelType int `json:"modelType"`
|
||||
Temperature *float64 `json:"temperature"`
|
||||
TopP *float64 `json:"topP"`
|
||||
MaxTokens int `json:"maxTokens"`
|
||||
ResponseFormat int64 `json:"responseFormat"`
|
||||
SystemPrompt BlockInput `json:"systemPrompt"`
|
||||
}
|
||||
|
||||
type VariableAggregator struct {
|
||||
MergeGroups []*Param `json:"mergeGroups,omitempty"`
|
||||
}
|
||||
|
||||
type PluginAPIParam struct {
|
||||
APIParams []*Param `json:"apiParam"`
|
||||
}
|
||||
|
||||
type CodeRunner struct {
|
||||
Code string `json:"code"`
|
||||
Language int64 `json:"language"`
|
||||
}
|
||||
|
||||
type KnowledgeIndexer struct {
|
||||
DatasetParam []*Param `json:"datasetParam,omitempty"`
|
||||
StrategyParam StrategyParam `json:"strategyParam,omitempty"`
|
||||
}
|
||||
|
||||
type StrategyParam struct {
|
||||
ParsingStrategy struct {
|
||||
ParsingType string `json:"parsingType,omitempty"`
|
||||
ImageExtraction bool `json:"imageExtraction"`
|
||||
TableExtraction bool `json:"tableExtraction"`
|
||||
ImageOcr bool `json:"imageOcr"`
|
||||
} `json:"parsingStrategy,omitempty"`
|
||||
ChunkStrategy struct {
|
||||
ChunkType string `json:"chunkType,omitempty"`
|
||||
SeparatorType string `json:"separatorType,omitempty"`
|
||||
Separator string `json:"separator,omitempty"`
|
||||
MaxToken int64 `json:"maxToken,omitempty"`
|
||||
Overlap float64 `json:"overlap,omitempty"`
|
||||
} `json:"chunkStrategy,omitempty"`
|
||||
IndexStrategy any `json:"indexStrategy"`
|
||||
}
|
||||
|
||||
type HttpRequestNode struct {
|
||||
APIInfo APIInfo `json:"apiInfo,omitempty"`
|
||||
Body Body `json:"body,omitempty"`
|
||||
Headers []*Param `json:"headers"`
|
||||
Params []*Param `json:"params"`
|
||||
Auth *Auth `json:"auth"`
|
||||
Setting *HttpRequestSetting `json:"setting"`
|
||||
}
|
||||
|
||||
type APIInfo struct {
|
||||
Method string `json:"method"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
type Body struct {
|
||||
BodyType string `json:"bodyType"`
|
||||
BodyData *BodyData `json:"bodyData"`
|
||||
}
|
||||
type BodyData struct {
|
||||
Json string `json:"json,omitempty"`
|
||||
FormData *struct {
|
||||
Data []*Param `json:"data"`
|
||||
} `json:"formData,omitempty"`
|
||||
FormURLEncoded []*Param `json:"formURLEncoded,omitempty"`
|
||||
RawText string `json:"rawText,omitempty"`
|
||||
Binary struct {
|
||||
FileURL *BlockInput `json:"fileURL"`
|
||||
} `json:"binary"`
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
AuthType string `json:"authType"`
|
||||
AuthData struct {
|
||||
CustomData struct {
|
||||
AddTo string `json:"addTo"`
|
||||
Data []*Param `json:"data,omitempty"`
|
||||
} `json:"customData"`
|
||||
BearerTokenData []*Param `json:"bearerTokenData,omitempty"`
|
||||
} `json:"authData"`
|
||||
|
||||
AuthOpen bool `json:"authOpen"`
|
||||
}
|
||||
|
||||
type HttpRequestSetting struct {
|
||||
Timeout int64 `json:"timeout"`
|
||||
RetryTimes int64 `json:"retryTimes"`
|
||||
}
|
||||
|
||||
type DatabaseNode struct {
|
||||
DatabaseInfoList []*DatabaseInfo `json:"databaseInfoList,omitempty"`
|
||||
SQL string `json:"sql,omitempty"`
|
||||
SelectParam *SelectParam `json:"selectParam,omitempty"`
|
||||
|
||||
InsertParam *InsertParam `json:"insertParam,omitempty"`
|
||||
|
||||
DeleteParam *DeleteParam `json:"deleteParam,omitempty"`
|
||||
|
||||
UpdateParam *UpdateParam `json:"updateParam,omitempty"`
|
||||
}
|
||||
|
||||
type DatabaseLogicType string
|
||||
|
||||
const (
|
||||
DatabaseLogicAnd DatabaseLogicType = "AND"
|
||||
DatabaseLogicOr DatabaseLogicType = "OR"
|
||||
)
|
||||
|
||||
type DBCondition struct {
|
||||
ConditionList [][]*Param `json:"conditionList,omitempty"`
|
||||
Logic DatabaseLogicType `json:"logic"`
|
||||
}
|
||||
|
||||
type UpdateParam struct {
|
||||
Condition DBCondition `json:"condition"`
|
||||
FieldInfo [][]*Param `json:"fieldInfo"`
|
||||
}
|
||||
|
||||
type DeleteParam struct {
|
||||
Condition DBCondition `json:"condition"`
|
||||
}
|
||||
|
||||
type InsertParam struct {
|
||||
FieldInfo [][]*Param `json:"fieldInfo"`
|
||||
}
|
||||
|
||||
type SelectParam struct {
|
||||
Condition *DBCondition `json:"condition,omitempty"` // may be nil
|
||||
OrderByList []struct {
|
||||
FieldID int64 `json:"fieldID"`
|
||||
IsAsc bool `json:"isAsc"`
|
||||
} `json:"orderByList,omitempty"`
|
||||
Limit int64 `json:"limit"`
|
||||
FieldList []struct {
|
||||
FieldID int64 `json:"fieldID"`
|
||||
IsDistinct bool `json:"isDistinct"`
|
||||
} `json:"fieldList,omitempty"`
|
||||
}
|
||||
|
||||
type DatabaseInfo struct {
|
||||
DatabaseInfoID string `json:"databaseInfoID"`
|
||||
}
|
||||
|
||||
type IntentDetector struct {
|
||||
ChatHistorySetting *ChatHistorySetting `json:"chatHistorySetting,omitempty"`
|
||||
Intents []*Intent `json:"intents,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
}
|
||||
type ChatHistorySetting struct {
|
||||
EnableChatHistory bool `json:"enableChatHistory,omitempty"`
|
||||
ChatHistoryRound int64 `json:"chatHistoryRound,omitempty"`
|
||||
}
|
||||
|
||||
type Intent struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
type Param struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Input *BlockInput `json:"input,omitempty"`
|
||||
Left *BlockInput `json:"left,omitempty"`
|
||||
Right *BlockInput `json:"right,omitempty"`
|
||||
Variables []*BlockInput `json:"variables,omitempty"`
|
||||
}
|
||||
|
||||
type Variable struct {
|
||||
Name string `json:"name"`
|
||||
Type VariableType `json:"type"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
AssistType AssistType `json:"assistType,omitempty"`
|
||||
Schema any `json:"schema,omitempty"` // either []*Variable (for object) or *Variable (for list)
|
||||
Description string `json:"description,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
DefaultValue any `json:"defaultValue,omitempty"`
|
||||
}
|
||||
|
||||
type BlockInput struct {
|
||||
Type VariableType `json:"type,omitempty" yaml:"Type,omitempty"`
|
||||
AssistType AssistType `json:"assistType,omitempty" yaml:"AssistType,omitempty"`
|
||||
Schema any `json:"schema,omitempty" yaml:"Schema,omitempty"` // either *BlockInput(or *Variable) for list or []*Variable (for object)
|
||||
Value *BlockInputValue `json:"value,omitempty" yaml:"Value,omitempty"`
|
||||
}
|
||||
|
||||
type BlockInputValue struct {
|
||||
Type BlockInputValueType `json:"type"`
|
||||
Content any `json:"content,omitempty"` // either string for text such as template, or BlockInputReference
|
||||
RawMeta any `json:"rawMeta,omitempty"`
|
||||
}
|
||||
|
||||
type BlockInputReference struct {
|
||||
BlockID string `json:"blockID"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Path []string `json:"path,omitempty"`
|
||||
Source RefSourceType `json:"source"`
|
||||
}
|
||||
|
||||
type Condition struct {
|
||||
Operator OperatorType `json:"operator"`
|
||||
Left *Param `json:"left"`
|
||||
Right *Param `json:"right,omitempty"`
|
||||
}
|
||||
|
||||
type SubWorkflow struct {
|
||||
WorkflowID string `json:"workflowId,omitempty"`
|
||||
WorkflowVersion string `json:"workflowVersion,omitempty"`
|
||||
TerminationType int `json:"type,omitempty"`
|
||||
SpaceID string `json:"spaceId,omitempty"`
|
||||
}
|
||||
|
||||
// BlockType is the enumeration of node types for front-end canvas schema.
|
||||
// To add a new BlockType, start from a really big number such as 1000, to avoid conflict with future extensions.
|
||||
type BlockType string
|
||||
|
||||
func (b BlockType) String() string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
const (
|
||||
BlockTypeBotStart BlockType = "1"
|
||||
BlockTypeBotEnd BlockType = "2"
|
||||
BlockTypeBotLLM BlockType = "3"
|
||||
BlockTypeBotAPI BlockType = "4"
|
||||
BlockTypeBotCode BlockType = "5"
|
||||
BlockTypeBotDataset BlockType = "6"
|
||||
BlockTypeCondition BlockType = "8"
|
||||
BlockTypeBotSubWorkflow BlockType = "9"
|
||||
BlockTypeDatabase BlockType = "12"
|
||||
BlockTypeBotMessage BlockType = "13"
|
||||
BlockTypeBotText BlockType = "15"
|
||||
BlockTypeQuestion BlockType = "18"
|
||||
BlockTypeBotBreak BlockType = "19"
|
||||
BlockTypeBotLoopSetVariable BlockType = "20"
|
||||
BlockTypeBotLoop BlockType = "21"
|
||||
BlockTypeBotIntent BlockType = "22"
|
||||
BlockTypeBotDatasetWrite BlockType = "27"
|
||||
BlockTypeBotInput BlockType = "30"
|
||||
BlockTypeBotBatch BlockType = "28"
|
||||
BlockTypeBotContinue BlockType = "29"
|
||||
BlockTypeBotComment BlockType = "31"
|
||||
BlockTypeBotVariableMerge BlockType = "32"
|
||||
BlockTypeBotAssignVariable BlockType = "40"
|
||||
BlockTypeDatabaseUpdate BlockType = "42"
|
||||
BlockTypeDatabaseSelect BlockType = "43"
|
||||
BlockTypeDatabaseDelete BlockType = "44"
|
||||
BlockTypeBotHttp BlockType = "45"
|
||||
BlockTypeDatabaseInsert BlockType = "46"
|
||||
BlockTypeJsonSerialization BlockType = "58"
|
||||
BlockTypeJsonDeserialization BlockType = "59"
|
||||
BlockTypeBotDatasetDelete BlockType = "60"
|
||||
)
|
||||
|
||||
type VariableType string
|
||||
|
||||
const (
|
||||
VariableTypeString VariableType = "string"
|
||||
VariableTypeInteger VariableType = "integer"
|
||||
VariableTypeFloat VariableType = "float"
|
||||
VariableTypeBoolean VariableType = "boolean"
|
||||
VariableTypeObject VariableType = "object"
|
||||
VariableTypeList VariableType = "list"
|
||||
)
|
||||
|
||||
type AssistType = int64
|
||||
|
||||
const (
|
||||
AssistTypeNotSet AssistType = 0
|
||||
AssistTypeDefault AssistType = 1
|
||||
AssistTypeImage AssistType = 2
|
||||
AssistTypeDoc AssistType = 3
|
||||
AssistTypeCode AssistType = 4
|
||||
AssistTypePPT AssistType = 5
|
||||
AssistTypeTXT AssistType = 6
|
||||
AssistTypeExcel AssistType = 7
|
||||
AssistTypeAudio AssistType = 8
|
||||
AssistTypeZip AssistType = 9
|
||||
AssistTypeVideo AssistType = 10
|
||||
AssistTypeSvg AssistType = 11
|
||||
AssistTypeVoice AssistType = 12
|
||||
|
||||
AssistTypeTime AssistType = 10000
|
||||
)
|
||||
|
||||
type BlockInputValueType string
|
||||
|
||||
const (
|
||||
BlockInputValueTypeLiteral BlockInputValueType = "literal"
|
||||
BlockInputValueTypeRef BlockInputValueType = "ref"
|
||||
BlockInputValueTypeObjectRef BlockInputValueType = "object_ref"
|
||||
)
|
||||
|
||||
type RefSourceType string
|
||||
|
||||
const (
|
||||
RefSourceTypeBlockOutput RefSourceType = "block-output" // 代表引用了某个 Block 的输出隐式声明的变量
|
||||
RefSourceTypeGlobalApp RefSourceType = "global_variable_app"
|
||||
RefSourceTypeGlobalSystem RefSourceType = "global_variable_system"
|
||||
RefSourceTypeGlobalUser RefSourceType = "global_variable_user"
|
||||
)
|
||||
|
||||
type TerminatePlan string
|
||||
|
||||
const (
|
||||
ReturnVariables TerminatePlan = "returnVariables"
|
||||
UseAnswerContent TerminatePlan = "useAnswerContent"
|
||||
)
|
||||
|
||||
type ErrorProcessType int
|
||||
|
||||
const (
|
||||
ErrorProcessTypeThrow ErrorProcessType = 1
|
||||
ErrorProcessTypeDefault ErrorProcessType = 2
|
||||
ErrorProcessTypeExceptionBranch ErrorProcessType = 3
|
||||
)
|
||||
|
||||
type SettingOnError struct {
|
||||
DataOnErr string `json:"dataOnErr,omitempty"`
|
||||
Switch bool `json:"switch,omitempty"`
|
||||
ProcessType *ErrorProcessType `json:"processType,omitempty"`
|
||||
RetryTimes int64 `json:"retryTimes,omitempty"`
|
||||
TimeoutMs int64 `json:"timeoutMs,omitempty"`
|
||||
Ext *struct {
|
||||
BackupLLMParam string `json:"backupLLMParam,omitempty"` // only for LLM Node, marshaled from QALLMParam
|
||||
} `json:"ext,omitempty"`
|
||||
}
|
||||
|
||||
type LogicType int
|
||||
|
||||
const (
|
||||
_ LogicType = iota
|
||||
OR
|
||||
AND
|
||||
)
|
||||
|
||||
type OperatorType int
|
||||
|
||||
const (
|
||||
_ OperatorType = iota
|
||||
Equal
|
||||
NotEqual
|
||||
LengthGreaterThan
|
||||
LengthGreaterThanEqual
|
||||
LengthLessThan
|
||||
LengthLessThanEqual
|
||||
Contain
|
||||
NotContain
|
||||
Empty
|
||||
NotEmpty
|
||||
True
|
||||
False
|
||||
GreaterThan
|
||||
GreaterThanEqual
|
||||
LessThan
|
||||
LessThanEqual
|
||||
)
|
||||
|
||||
type TextProcessingMethod string
|
||||
|
||||
const (
|
||||
Concat TextProcessingMethod = "concat"
|
||||
Split TextProcessingMethod = "split"
|
||||
)
|
||||
|
||||
type LoopType string
|
||||
|
||||
const (
|
||||
LoopTypeArray LoopType = "array"
|
||||
LoopTypeCount LoopType = "count"
|
||||
LoopTypeInfinite LoopType = "infinite"
|
||||
)
|
||||
|
||||
type WorkflowIdentity struct {
|
||||
ID string `json:"id"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func (c *Canvas) GetAllSubWorkflowIdentities() []*WorkflowIdentity {
|
||||
workflowEntities := make([]*WorkflowIdentity, 0)
|
||||
|
||||
var collectSubWorkFlowEntities func(nodes []*Node)
|
||||
collectSubWorkFlowEntities = func(nodes []*Node) {
|
||||
for _, n := range nodes {
|
||||
if n.Type == BlockTypeBotSubWorkflow {
|
||||
workflowEntities = append(workflowEntities, &WorkflowIdentity{
|
||||
ID: n.Data.Inputs.WorkflowID,
|
||||
Version: n.Data.Inputs.WorkflowVersion,
|
||||
})
|
||||
}
|
||||
if len(n.Blocks) > 0 {
|
||||
collectSubWorkFlowEntities(n.Blocks)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
collectSubWorkFlowEntities(c.Nodes)
|
||||
|
||||
return workflowEntities
|
||||
}
|
||||
|
||||
func GenerateNodeIDForBatchMode(key string) string {
|
||||
return key + "_inner"
|
||||
}
|
||||
|
||||
func IsGeneratedNodeForBatchMode(key string, parentKey string) bool {
|
||||
return key == GenerateNodeIDForBatchMode(parentKey)
|
||||
}
|
||||
103
backend/domain/workflow/entity/vo/curd.go
Normal file
103
backend/domain/workflow/entity/vo/curd.go
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
type Page struct {
|
||||
Size int32 `json:"size"`
|
||||
Page int32 `json:"page"`
|
||||
}
|
||||
|
||||
func (p *Page) Offset() int {
|
||||
if p.Page == 0 {
|
||||
return 0
|
||||
}
|
||||
return int((p.Page - 1) * p.Size)
|
||||
}
|
||||
|
||||
func (p *Page) Limit() int {
|
||||
return int(p.Size)
|
||||
}
|
||||
|
||||
type PublishStatus string
|
||||
|
||||
const (
|
||||
UnPublished PublishStatus = "UnPublished"
|
||||
HasPublished PublishStatus = "HasPublished"
|
||||
)
|
||||
|
||||
type WorkFlowType string
|
||||
|
||||
const (
|
||||
User WorkFlowType = "user"
|
||||
Official WorkFlowType = "official"
|
||||
)
|
||||
|
||||
type QueryToolInfoOption struct {
|
||||
Page *Page
|
||||
IDs []int64
|
||||
}
|
||||
|
||||
type Locator uint8
|
||||
|
||||
const (
|
||||
FromDraft Locator = iota
|
||||
FromSpecificVersion
|
||||
FromLatestVersion
|
||||
)
|
||||
|
||||
type GetPolicy struct {
|
||||
ID int64
|
||||
QType Locator
|
||||
MetaOnly bool
|
||||
Version string
|
||||
CommitID string
|
||||
}
|
||||
|
||||
type DeletePolicy struct {
|
||||
ID *int64
|
||||
IDs []int64
|
||||
AppID *int64
|
||||
}
|
||||
|
||||
type MGetPolicy struct {
|
||||
MetaQuery
|
||||
|
||||
QType Locator
|
||||
MetaOnly bool
|
||||
Versions map[int64]string
|
||||
}
|
||||
|
||||
type MGetReferencePolicy struct {
|
||||
ReferredIDs []int64
|
||||
ReferringIDs []int64
|
||||
ReferringBizType []ReferringBizType
|
||||
ReferType []ReferType
|
||||
}
|
||||
|
||||
type ReferType uint8
|
||||
|
||||
const (
|
||||
ReferTypeSubWorkflow ReferType = 1
|
||||
ReferTypeTool ReferType = 2
|
||||
)
|
||||
|
||||
type ReferringBizType uint8
|
||||
|
||||
const (
|
||||
ReferringBizTypeWorkflow ReferringBizType = 1
|
||||
ReferringBizTypeAgent ReferringBizType = 2
|
||||
)
|
||||
70
backend/domain/workflow/entity/vo/draft.go
Normal file
70
backend/domain/workflow/entity/vo/draft.go
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
)
|
||||
|
||||
type DraftInfo struct {
|
||||
*DraftMeta
|
||||
|
||||
Canvas string
|
||||
InputParamsStr string
|
||||
OutputParamsStr string
|
||||
|
||||
CommitID string
|
||||
}
|
||||
|
||||
type CanvasInfo struct {
|
||||
Canvas string
|
||||
InputParams []*NamedTypeInfo
|
||||
OutputParams []*NamedTypeInfo
|
||||
InputParamsStr string
|
||||
OutputParamsStr string
|
||||
}
|
||||
|
||||
func (c *CanvasInfo) Unmarshal() error {
|
||||
if c.InputParamsStr != "" && len(c.InputParams) == 0 {
|
||||
var input []*NamedTypeInfo
|
||||
err := sonic.UnmarshalString(c.InputParamsStr, &input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.InputParams = input
|
||||
}
|
||||
|
||||
if c.OutputParamsStr != "" && len(c.OutputParams) == 0 {
|
||||
var output []*NamedTypeInfo
|
||||
err := sonic.UnmarshalString(c.OutputParamsStr, &output)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.OutputParams = output
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type DraftMeta struct {
|
||||
TestRunSuccess bool
|
||||
Modified bool
|
||||
Timestamp time.Time
|
||||
IsSnapshot bool // if true, this is a snapshot of a previous draft content, not the latest draft
|
||||
}
|
||||
67
backend/domain/workflow/entity/vo/execution.go
Normal file
67
backend/domain/workflow/entity/vo/execution.go
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
type ExecuteConfig struct {
|
||||
ID int64
|
||||
From Locator
|
||||
Version string
|
||||
CommitID string
|
||||
Operator int64
|
||||
Mode ExecuteMode
|
||||
AppID *int64
|
||||
AgentID *int64
|
||||
ConnectorID int64
|
||||
ConnectorUID string
|
||||
TaskType TaskType
|
||||
SyncPattern SyncPattern
|
||||
InputFailFast bool // whether to fail fast if input conversion has warnings
|
||||
BizType BizType
|
||||
Cancellable bool
|
||||
}
|
||||
|
||||
type ExecuteMode string
|
||||
|
||||
const (
|
||||
ExecuteModeDebug ExecuteMode = "debug"
|
||||
ExecuteModeRelease ExecuteMode = "release"
|
||||
ExecuteModeNodeDebug ExecuteMode = "node_debug"
|
||||
)
|
||||
|
||||
type TaskType string
|
||||
|
||||
const (
|
||||
TaskTypeForeground TaskType = "foreground"
|
||||
TaskTypeBackground TaskType = "background"
|
||||
)
|
||||
|
||||
type SyncPattern string
|
||||
|
||||
const (
|
||||
SyncPatternSync SyncPattern = "sync"
|
||||
SyncPatternAsync SyncPattern = "async"
|
||||
SyncPatternStream SyncPattern = "stream"
|
||||
)
|
||||
|
||||
var DebugURLTpl = "http://127.0.0.1:3000/work_flow?execute_id=%d&space_id=%d&workflow_id=%d&execute_mode=2"
|
||||
|
||||
type BizType string
|
||||
|
||||
const (
|
||||
BizTypeAgent BizType = "agent"
|
||||
BizTypeWorkflow BizType = "workflow"
|
||||
)
|
||||
83
backend/domain/workflow/entity/vo/meta.go
Normal file
83
backend/domain/workflow/entity/vo/meta.go
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
)
|
||||
|
||||
type ContentType = workflow.WorkFlowType
|
||||
type Tag = workflow.Tag
|
||||
type Mode = workflow.WorkflowMode
|
||||
|
||||
type Meta struct {
|
||||
// the following fields are immutable
|
||||
SpaceID int64
|
||||
CreatorID int64
|
||||
CreatedAt time.Time
|
||||
ContentType ContentType
|
||||
Tag *Tag
|
||||
AppID *int64
|
||||
SourceID *int64
|
||||
AuthorID int64
|
||||
|
||||
// the following fields are mutable
|
||||
Name string
|
||||
Desc string
|
||||
IconURI string
|
||||
IconURL string
|
||||
Mode Mode
|
||||
UpdatedAt *time.Time
|
||||
UpdaterID *int64
|
||||
DeletedAt *time.Time
|
||||
HasPublished bool
|
||||
LatestPublishedVersion *string
|
||||
}
|
||||
|
||||
type MetaCreate struct {
|
||||
Name string
|
||||
Desc string
|
||||
IconURI string
|
||||
SpaceID int64
|
||||
CreatorID int64
|
||||
ContentType ContentType
|
||||
AppID *int64
|
||||
Mode Mode
|
||||
InitCanvasSchema string
|
||||
}
|
||||
|
||||
type MetaUpdate struct {
|
||||
Name *string
|
||||
Desc *string
|
||||
IconURI *string
|
||||
HasPublished *bool
|
||||
LatestPublishedVersion *string
|
||||
}
|
||||
|
||||
type MetaQuery struct {
|
||||
IDs []int64
|
||||
SpaceID *int64
|
||||
Page *Page
|
||||
Name *string
|
||||
PublishStatus *PublishStatus
|
||||
AppID *int64
|
||||
LibOnly bool
|
||||
NeedTotalNumber bool
|
||||
DescByUpdate bool
|
||||
}
|
||||
602
backend/domain/workflow/entity/vo/node.go
Normal file
602
backend/domain/workflow/entity/vo/node.go
Normal file
@@ -0,0 +1,602 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/cloudwego/eino/compose"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||
)
|
||||
|
||||
type NodeKey string
|
||||
|
||||
type FieldInfo struct {
|
||||
Path compose.FieldPath `json:"path"`
|
||||
Source FieldSource `json:"source"`
|
||||
}
|
||||
|
||||
type Reference struct {
|
||||
FromNodeKey NodeKey `json:"from_node_key,omitempty"`
|
||||
FromPath compose.FieldPath `json:"from_path"`
|
||||
|
||||
VariableType *GlobalVarType `json:"variable_type,omitempty"`
|
||||
}
|
||||
|
||||
type FieldSource struct {
|
||||
Ref *Reference `json:"ref,omitempty"`
|
||||
Val any `json:"val,omitempty"`
|
||||
}
|
||||
|
||||
type ImplicitNodeDependency struct {
|
||||
NodeID string
|
||||
FieldPath compose.FieldPath
|
||||
TypeInfo *TypeInfo
|
||||
}
|
||||
|
||||
type TypeInfo struct {
|
||||
Type DataType `json:"type"`
|
||||
ElemTypeInfo *TypeInfo `json:"elem_type_info,omitempty"`
|
||||
FileType *FileSubType `json:"file_type,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
Desc string `json:"desc,omitempty"`
|
||||
Properties map[string]*TypeInfo `json:"properties,omitempty"`
|
||||
}
|
||||
type NamedTypeInfo struct {
|
||||
Name string `json:"name"`
|
||||
Type DataType `json:"type"`
|
||||
ElemTypeInfo *NamedTypeInfo `json:"elem_type_info,omitempty"`
|
||||
FileType *FileSubType `json:"file_type,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
Desc string `json:"desc,omitempty"`
|
||||
Properties []*NamedTypeInfo `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
type ErrorLevel string
|
||||
|
||||
const (
|
||||
LevelWarn ErrorLevel = "Warn"
|
||||
LevelError ErrorLevel = "Error"
|
||||
LevelCancel ErrorLevel = "pending" // forget about why it's called 'pending', somebody named it and it's now part of the protocol
|
||||
)
|
||||
|
||||
type WorkflowError interface {
|
||||
errorx.StatusError
|
||||
DebugURL() string
|
||||
Level() ErrorLevel
|
||||
OpenAPICode() int
|
||||
AppendDebug(exeID, spaceID, workflowID int64) WorkflowError
|
||||
ChangeErrLevel(newLevel ErrorLevel) WorkflowError
|
||||
}
|
||||
|
||||
type wfErr struct {
|
||||
errorx.StatusError
|
||||
exeID int64
|
||||
spaceID int64
|
||||
workflowID int64
|
||||
cause error
|
||||
}
|
||||
|
||||
func (w *wfErr) DebugURL() string {
|
||||
if w.StatusError.Extra() == nil {
|
||||
return fmt.Sprintf(DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
}
|
||||
|
||||
debugURL, ok := w.StatusError.Extra()["debug_url"]
|
||||
if ok {
|
||||
return debugURL
|
||||
}
|
||||
|
||||
return fmt.Sprintf(DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
}
|
||||
|
||||
func (w *wfErr) Level() ErrorLevel {
|
||||
if w.StatusError.Extra() == nil {
|
||||
return LevelError
|
||||
}
|
||||
|
||||
level, ok := w.StatusError.Extra()["level"]
|
||||
if ok {
|
||||
return ErrorLevel(level)
|
||||
}
|
||||
|
||||
return LevelError
|
||||
}
|
||||
|
||||
func (w *wfErr) Error() string {
|
||||
if w.cause == nil {
|
||||
return w.StatusError.Error()
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s, cause: %s", w.StatusError.Error(), w.cause.Error())
|
||||
}
|
||||
|
||||
func (w *wfErr) OpenAPICode() int {
|
||||
return errno.CodeForOpenAPI(w)
|
||||
}
|
||||
|
||||
func (w *wfErr) AppendDebug(exeID, spaceID, workflowID int64) WorkflowError {
|
||||
w.exeID = exeID
|
||||
w.spaceID = spaceID
|
||||
w.workflowID = workflowID
|
||||
return w
|
||||
}
|
||||
|
||||
func (w *wfErr) Unwrap() error {
|
||||
return w.cause
|
||||
}
|
||||
|
||||
func (w *wfErr) ChangeErrLevel(newLevel ErrorLevel) WorkflowError {
|
||||
w.StatusError.Extra()["level"] = string(newLevel)
|
||||
return w
|
||||
}
|
||||
|
||||
func NewError(code int, opts ...errorx.Option) WorkflowError {
|
||||
opts = append(opts, errorx.Extra("level", string(LevelError)))
|
||||
e := errorx.New(int32(code), opts...)
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
}
|
||||
|
||||
return wfe
|
||||
}
|
||||
|
||||
func WrapError(code int, err error, opts ...errorx.Option) WorkflowError {
|
||||
opts = append(opts, errorx.Extra("level", string(LevelError)))
|
||||
e := errorx.WrapByCode(err, int32(code), opts...)
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
cause: err,
|
||||
}
|
||||
return wfe
|
||||
}
|
||||
|
||||
func WrapWithDebug(code int, err error, exeID, spaceID, workflowID int64, opts ...errorx.Option) WorkflowError {
|
||||
debugURL := fmt.Sprintf(DebugURLTpl, exeID, spaceID, workflowID)
|
||||
opts = append(opts, errorx.Extra("debug_url", debugURL))
|
||||
return WrapError(code, err, opts...)
|
||||
}
|
||||
|
||||
func NewWarn(code int, opts ...errorx.Option) WorkflowError {
|
||||
opts = append(opts, errorx.Extra("level", string(LevelWarn)))
|
||||
e := errorx.New(int32(code), opts...)
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
}
|
||||
|
||||
return wfe
|
||||
}
|
||||
|
||||
func WrapWarn(code int, err error, opts ...errorx.Option) WorkflowError {
|
||||
opts = append(opts, errorx.Extra("level", string(LevelWarn)))
|
||||
e := errorx.WrapByCode(err, int32(code), opts...)
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
cause: err,
|
||||
}
|
||||
return wfe
|
||||
}
|
||||
|
||||
func WrapIfNeeded(code int, err error, opts ...errorx.Option) WorkflowError {
|
||||
var wfe WorkflowError
|
||||
if errors.As(err, &wfe) {
|
||||
return wfe
|
||||
}
|
||||
return WrapError(code, err, opts...)
|
||||
}
|
||||
|
||||
var CancelErr = newCancel()
|
||||
|
||||
func newCancel() WorkflowError {
|
||||
e := errorx.New(errno.ErrWorkflowCanceledByUser, errorx.Extra("level", string(LevelCancel)))
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
}
|
||||
return wfe
|
||||
}
|
||||
|
||||
var NodeTimeoutErr = newNodeTimeout()
|
||||
|
||||
func newNodeTimeout() WorkflowError {
|
||||
e := errorx.New(errno.ErrNodeTimeout, errorx.Extra("level", string(LevelError)))
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
}
|
||||
return wfe
|
||||
}
|
||||
|
||||
var WorkflowTimeoutErr = newWorkflowTimeout()
|
||||
|
||||
func newWorkflowTimeout() WorkflowError {
|
||||
e := errorx.New(errno.ErrWorkflowTimeout, errorx.Extra("level", string(LevelError)))
|
||||
var sErr errorx.StatusError
|
||||
_ = errors.As(e, &sErr)
|
||||
wfe := &wfErr{
|
||||
StatusError: sErr,
|
||||
}
|
||||
return wfe
|
||||
}
|
||||
|
||||
func UnwrapRootErr(err error) error {
|
||||
var (
|
||||
rootE = err
|
||||
currentE error
|
||||
)
|
||||
for {
|
||||
currentE = errors.Unwrap(rootE)
|
||||
if currentE == nil {
|
||||
break
|
||||
}
|
||||
rootE = currentE
|
||||
}
|
||||
|
||||
return rootE
|
||||
}
|
||||
|
||||
type DataType string
|
||||
|
||||
const (
|
||||
DataTypeString DataType = "string" // string
|
||||
DataTypeInteger DataType = "integer" // int64
|
||||
DataTypeNumber DataType = "number" // float64
|
||||
DataTypeBoolean DataType = "boolean" // bool
|
||||
DataTypeTime DataType = "time" // time.Time
|
||||
DataTypeObject DataType = "object" // map[string]any
|
||||
DataTypeArray DataType = "list" // []any
|
||||
DataTypeFile DataType = "file" // string (url)
|
||||
)
|
||||
|
||||
// Zero creates a zero value
|
||||
func (t *TypeInfo) Zero() any {
|
||||
switch t.Type {
|
||||
case DataTypeString:
|
||||
return ""
|
||||
case DataTypeInteger:
|
||||
return int64(0)
|
||||
case DataTypeNumber:
|
||||
return float64(0)
|
||||
case DataTypeBoolean:
|
||||
return false
|
||||
case DataTypeTime:
|
||||
return ""
|
||||
case DataTypeObject:
|
||||
var m map[string]any
|
||||
return m
|
||||
case DataTypeArray:
|
||||
var a []any
|
||||
return a
|
||||
case DataTypeFile:
|
||||
return ""
|
||||
default:
|
||||
panic("impossible")
|
||||
}
|
||||
}
|
||||
|
||||
func (n *NamedTypeInfo) ToParameterInfo() (*schema.ParameterInfo, error) {
|
||||
param := &schema.ParameterInfo{
|
||||
Type: convertDataType(n.Type),
|
||||
Desc: n.Desc,
|
||||
Required: n.Required,
|
||||
}
|
||||
|
||||
if n.Type == DataTypeObject {
|
||||
param.SubParams = make(map[string]*schema.ParameterInfo, len(n.Properties))
|
||||
for _, subT := range n.Properties {
|
||||
subParam, err := subT.ToParameterInfo()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param.SubParams[subT.Name] = subParam
|
||||
}
|
||||
} else if n.Type == DataTypeArray {
|
||||
elemParam, err := n.ElemTypeInfo.ToParameterInfo()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param.ElemInfo = elemParam
|
||||
}
|
||||
|
||||
return param, nil
|
||||
}
|
||||
|
||||
func (n *NamedTypeInfo) ToVariable() (*Variable, error) {
|
||||
|
||||
variableType, err := convertVariableType(n.Type)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
v := &Variable{
|
||||
Name: n.Name,
|
||||
Type: variableType,
|
||||
Required: n.Required,
|
||||
}
|
||||
|
||||
if n.Type == DataTypeFile && n.FileType != nil {
|
||||
v.AssistType = toAssistType(*n.FileType)
|
||||
}
|
||||
|
||||
if n.Type == DataTypeArray && n.ElemTypeInfo != nil {
|
||||
ele, err := n.ElemTypeInfo.ToVariable()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
v.Schema = ele
|
||||
}
|
||||
|
||||
if n.Type == DataTypeObject && len(n.Properties) > 0 {
|
||||
varList := make([]*Variable, 0, len(n.Properties))
|
||||
for _, p := range n.Properties {
|
||||
v, err := p.ToVariable()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
varList = append(varList, v)
|
||||
}
|
||||
v.Schema = varList
|
||||
}
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func toAssistType(f FileSubType) AssistType {
|
||||
switch f {
|
||||
case FileTypeDefault:
|
||||
return AssistTypeDefault
|
||||
case FileTypeImage:
|
||||
return AssistTypeImage
|
||||
case FileTypeSVG:
|
||||
return AssistTypeSvg
|
||||
case FileTypeAudio:
|
||||
return AssistTypeAudio
|
||||
case FileTypeVideo:
|
||||
return AssistTypeVideo
|
||||
case FileTypeDocument:
|
||||
return AssistTypeDoc
|
||||
case FileTypePPT:
|
||||
return AssistTypePPT
|
||||
case FileTypeExcel:
|
||||
return AssistTypeExcel
|
||||
case FileTypeTxt:
|
||||
return AssistTypeTXT
|
||||
case FileTypeCode:
|
||||
return AssistTypeCode
|
||||
case FileTypeZip:
|
||||
return AssistTypeZip
|
||||
default:
|
||||
return AssistTypeNotSet
|
||||
}
|
||||
}
|
||||
|
||||
func convertVariableType(d DataType) (VariableType, error) {
|
||||
switch d {
|
||||
case DataTypeString, DataTypeTime, DataTypeFile:
|
||||
return VariableTypeString, nil
|
||||
case DataTypeNumber:
|
||||
return VariableTypeFloat, nil
|
||||
case DataTypeInteger:
|
||||
return VariableTypeInteger, nil
|
||||
case DataTypeBoolean:
|
||||
return VariableTypeBoolean, nil
|
||||
case DataTypeObject:
|
||||
return VariableTypeObject, nil
|
||||
case DataTypeArray:
|
||||
return VariableTypeList, nil
|
||||
default:
|
||||
return "", fmt.Errorf("unknown variable type: %v", d)
|
||||
}
|
||||
}
|
||||
|
||||
func convertDataType(d DataType) schema.DataType {
|
||||
switch d {
|
||||
case DataTypeString, DataTypeTime, DataTypeFile:
|
||||
return schema.String
|
||||
case DataTypeNumber:
|
||||
return schema.Number
|
||||
case DataTypeInteger:
|
||||
return schema.Integer
|
||||
case DataTypeBoolean:
|
||||
return schema.Boolean
|
||||
case DataTypeObject:
|
||||
return schema.Object
|
||||
case DataTypeArray:
|
||||
return schema.Array
|
||||
default:
|
||||
panic("unknown data type")
|
||||
}
|
||||
}
|
||||
|
||||
func TypeInfoToJSONSchema(tis map[string]*TypeInfo, structName *string) (string, error) {
|
||||
schema_ := map[string]any{
|
||||
"type": "object",
|
||||
"properties": make(map[string]any),
|
||||
"required": []string{},
|
||||
}
|
||||
|
||||
if structName != nil {
|
||||
schema_["title"] = *structName
|
||||
}
|
||||
|
||||
properties := schema_["properties"].(map[string]any)
|
||||
for key, typeInfo := range tis {
|
||||
if typeInfo == nil {
|
||||
continue
|
||||
}
|
||||
sc, err := typeInfoToJSONSchema(typeInfo)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
properties[key] = sc
|
||||
if typeInfo.Required {
|
||||
schema_["required"] = append(schema_["required"].([]string), key)
|
||||
}
|
||||
}
|
||||
|
||||
jsonBytes, err := sonic.Marshal(schema_)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(jsonBytes), nil
|
||||
}
|
||||
|
||||
func typeInfoToJSONSchema(info *TypeInfo) (map[string]interface{}, error) {
|
||||
|
||||
sc := make(map[string]interface{})
|
||||
|
||||
switch info.Type {
|
||||
case DataTypeString:
|
||||
sc["type"] = "string"
|
||||
case DataTypeInteger:
|
||||
sc["type"] = "integer"
|
||||
case DataTypeNumber:
|
||||
sc["type"] = "number"
|
||||
case DataTypeBoolean:
|
||||
sc["type"] = "boolean"
|
||||
case DataTypeTime:
|
||||
sc["type"] = "string"
|
||||
sc["format"] = "date-time"
|
||||
case DataTypeObject:
|
||||
sc["type"] = "object"
|
||||
case DataTypeArray:
|
||||
sc["type"] = "array"
|
||||
case DataTypeFile:
|
||||
sc["type"] = "string"
|
||||
if info.FileType != nil {
|
||||
sc["contentMediaType"] = string(*info.FileType)
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("impossible")
|
||||
}
|
||||
|
||||
if info.Desc != "" {
|
||||
sc["description"] = info.Desc
|
||||
}
|
||||
|
||||
if info.Type == DataTypeArray && info.ElemTypeInfo != nil {
|
||||
itemsSchema, err := typeInfoToJSONSchema(info.ElemTypeInfo)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to convert array element type: %v", err)
|
||||
}
|
||||
sc["items"] = itemsSchema
|
||||
}
|
||||
if info.Type == DataTypeObject && info.Properties != nil {
|
||||
properties := make(map[string]interface{})
|
||||
required := make([]string, 0)
|
||||
|
||||
for name, propInfo := range info.Properties {
|
||||
propSchema, err := typeInfoToJSONSchema(propInfo)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to convert property %s: %v", name, err)
|
||||
}
|
||||
|
||||
properties[name] = propSchema
|
||||
|
||||
if propInfo.Required {
|
||||
required = append(required, name)
|
||||
}
|
||||
}
|
||||
|
||||
sc["properties"] = properties
|
||||
|
||||
if len(required) > 0 {
|
||||
sc["required"] = required
|
||||
}
|
||||
}
|
||||
|
||||
return sc, nil
|
||||
}
|
||||
|
||||
type FileSubType string
|
||||
|
||||
const (
|
||||
FileTypeDefault FileSubType = "default"
|
||||
FileTypeImage FileSubType = "image"
|
||||
FileTypeSVG FileSubType = "svg"
|
||||
FileTypeAudio FileSubType = "audio"
|
||||
FileTypeVideo FileSubType = "video"
|
||||
FileTypeVoice FileSubType = "voice"
|
||||
FileTypeDocument FileSubType = "doc"
|
||||
FileTypePPT FileSubType = "ppt"
|
||||
FileTypeExcel FileSubType = "excel"
|
||||
FileTypeTxt FileSubType = "txt"
|
||||
FileTypeCode FileSubType = "code"
|
||||
FileTypeZip FileSubType = "zip"
|
||||
)
|
||||
|
||||
type NodeProperty struct {
|
||||
Type string
|
||||
IsEnableChatHistory bool
|
||||
IsEnableUserQuery bool
|
||||
IsRefGlobalVariable bool
|
||||
SubWorkflow map[string]*NodeProperty
|
||||
}
|
||||
|
||||
func (f *FieldInfo) IsRefGlobalVariable() bool {
|
||||
if f.Source.Ref != nil && f.Source.Ref.VariableType != nil {
|
||||
return *f.Source.Ref.VariableType == GlobalUser || *f.Source.Ref.VariableType == GlobalSystem || *f.Source.Ref.VariableType == GlobalAPP
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func ParseVariable(v any) (*Variable, error) {
|
||||
if va, ok := v.(*Variable); ok {
|
||||
return va, nil
|
||||
}
|
||||
|
||||
m, ok := v.(map[string]any)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("invalid content type: %T when parse Variable", v)
|
||||
}
|
||||
|
||||
marshaled, err := sonic.Marshal(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p := &Variable{}
|
||||
if err := sonic.Unmarshal(marshaled, p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
type GlobalVarType string
|
||||
|
||||
const (
|
||||
ParentIntermediate GlobalVarType = "parent_intermediate"
|
||||
GlobalUser GlobalVarType = "global_user"
|
||||
GlobalSystem GlobalVarType = "global_system"
|
||||
GlobalAPP GlobalVarType = "global_app"
|
||||
)
|
||||
147
backend/domain/workflow/entity/vo/node_test.go
Normal file
147
backend/domain/workflow/entity/vo/node_test.go
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTypeInfoToJSONSchema(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
typeInfo map[string]*TypeInfo
|
||||
validate func(t *testing.T, schema string)
|
||||
}{
|
||||
{
|
||||
name: "Basic Data Types",
|
||||
typeInfo: map[string]*TypeInfo{
|
||||
"stringField": {Type: DataTypeString},
|
||||
"intField": {Type: DataTypeInteger},
|
||||
"numField": {Type: DataTypeNumber},
|
||||
"boolField": {Type: DataTypeBoolean},
|
||||
"timeField": {Type: DataTypeTime},
|
||||
},
|
||||
validate: func(t *testing.T, schema string) {
|
||||
var schemaObj map[string]any
|
||||
err := json.Unmarshal([]byte(schema), &schemaObj)
|
||||
assert.NoError(t, err)
|
||||
|
||||
props := schemaObj["properties"].(map[string]any)
|
||||
|
||||
// 验证字符串字段
|
||||
stringProp := props["stringField"].(map[string]any)
|
||||
assert.Equal(t, "string", stringProp["type"])
|
||||
|
||||
// 验证整数字段
|
||||
intProp := props["intField"].(map[string]any)
|
||||
assert.Equal(t, "integer", intProp["type"])
|
||||
|
||||
// 验证数字字段
|
||||
numProp := props["numField"].(map[string]any)
|
||||
assert.Equal(t, "number", numProp["type"])
|
||||
|
||||
// 验证布尔字段
|
||||
boolProp := props["boolField"].(map[string]any)
|
||||
assert.Equal(t, "boolean", boolProp["type"])
|
||||
|
||||
// 验证时间字段
|
||||
timeProp := props["timeField"].(map[string]any)
|
||||
assert.Equal(t, "string", timeProp["type"])
|
||||
assert.Equal(t, "date-time", timeProp["format"])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Complex Data Types",
|
||||
typeInfo: map[string]*TypeInfo{
|
||||
"objectField": {Type: DataTypeObject},
|
||||
"arrayField": {
|
||||
Type: DataTypeArray,
|
||||
ElemTypeInfo: &TypeInfo{Type: DataTypeString},
|
||||
},
|
||||
"fileField": {
|
||||
Type: DataTypeFile,
|
||||
FileType: fileSubTypePtr(FileTypeImage),
|
||||
},
|
||||
},
|
||||
validate: func(t *testing.T, schema string) {
|
||||
var schemaObj map[string]any
|
||||
err := json.Unmarshal([]byte(schema), &schemaObj)
|
||||
assert.NoError(t, err)
|
||||
|
||||
props := schemaObj["properties"].(map[string]any)
|
||||
|
||||
// 验证对象字段
|
||||
objProp := props["objectField"].(map[string]any)
|
||||
assert.Equal(t, "object", objProp["type"])
|
||||
|
||||
// 验证数组字段
|
||||
arrProp := props["arrayField"].(map[string]any)
|
||||
assert.Equal(t, "array", arrProp["type"])
|
||||
items := arrProp["items"].(map[string]any)
|
||||
assert.Equal(t, "string", items["type"])
|
||||
|
||||
// 验证文件字段
|
||||
fileProp := props["fileField"].(map[string]any)
|
||||
assert.Equal(t, "string", fileProp["type"])
|
||||
assert.Equal(t, "image", fileProp["contentMediaType"])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Nested Array",
|
||||
typeInfo: map[string]*TypeInfo{
|
||||
"nestedArray": {
|
||||
Type: DataTypeArray,
|
||||
ElemTypeInfo: &TypeInfo{Type: DataTypeObject},
|
||||
},
|
||||
},
|
||||
validate: func(t *testing.T, schema string) {
|
||||
var schemaObj map[string]any
|
||||
err := json.Unmarshal([]byte(schema), &schemaObj)
|
||||
assert.NoError(t, err)
|
||||
|
||||
props := schemaObj["properties"].(map[string]any)
|
||||
|
||||
// 验证嵌套数组字段
|
||||
arrProp := props["nestedArray"].(map[string]any)
|
||||
assert.Equal(t, "array", arrProp["type"])
|
||||
items := arrProp["items"].(map[string]any)
|
||||
assert.Equal(t, "object", items["type"])
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
schema, err := TypeInfoToJSONSchema(tt.typeInfo, nil)
|
||||
assert.NoError(t, err)
|
||||
tt.validate(t, schema)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 辅助函数,用于创建 DataType 指针
|
||||
func stringPtr(dt DataType) *DataType {
|
||||
return &dt
|
||||
}
|
||||
|
||||
// 辅助函数,用于创建 FileSubType 指针
|
||||
func fileSubTypePtr(fst FileSubType) *FileSubType {
|
||||
return &fst
|
||||
}
|
||||
50
backend/domain/workflow/entity/vo/plugin_tool_info.go
Normal file
50
backend/domain/workflow/entity/vo/plugin_tool_info.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
)
|
||||
|
||||
type WorkFlowAsToolInfo struct {
|
||||
ID int64
|
||||
Name string
|
||||
Desc string
|
||||
IconURL string
|
||||
PublishStatus PublishStatus
|
||||
VersionName string
|
||||
CreatorID int64
|
||||
InputParams []*NamedTypeInfo
|
||||
CreatedAt int64
|
||||
UpdatedAt *int64
|
||||
}
|
||||
|
||||
type ToolDetailInfo struct {
|
||||
ApiDetailData *workflow.ApiDetailData
|
||||
ToolInputs any
|
||||
ToolOutputs any
|
||||
}
|
||||
|
||||
func (t *ToolDetailInfo) MarshalJSON() ([]byte, error) {
|
||||
bs, _ := sonic.Marshal(t.ApiDetailData)
|
||||
result := make(map[string]any)
|
||||
_ = sonic.Unmarshal(bs, &result)
|
||||
result["inputs"] = t.ToolInputs
|
||||
result["outputs"] = t.ToolOutputs
|
||||
return sonic.Marshal(result)
|
||||
}
|
||||
29
backend/domain/workflow/entity/vo/validate_info.go
Normal file
29
backend/domain/workflow/entity/vo/validate_info.go
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
type ValidateTreeConfig struct {
|
||||
CanvasSchema string
|
||||
AppID *int64
|
||||
AgentID *int64
|
||||
}
|
||||
|
||||
type ValidateIssue struct {
|
||||
WorkflowName string
|
||||
WorkflowID int64
|
||||
IssueMessages []string
|
||||
}
|
||||
43
backend/domain/workflow/entity/vo/version_info.go
Normal file
43
backend/domain/workflow/entity/vo/version_info.go
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import "time"
|
||||
|
||||
type VersionInfo struct {
|
||||
*VersionMeta
|
||||
|
||||
CanvasInfo
|
||||
|
||||
CommitID string
|
||||
}
|
||||
|
||||
type PublishPolicy struct {
|
||||
ID int64
|
||||
Version string
|
||||
VersionDescription string
|
||||
CreatorID int64
|
||||
CommitID string
|
||||
Force bool
|
||||
}
|
||||
|
||||
type VersionMeta struct {
|
||||
Version string
|
||||
VersionDescription string
|
||||
VersionCreatedAt time.Time
|
||||
VersionCreatorID int64
|
||||
}
|
||||
43
backend/domain/workflow/entity/vo/workflow_copy.go
Normal file
43
backend/domain/workflow/entity/vo/workflow_copy.go
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
type PluginEntity struct {
|
||||
PluginID int64
|
||||
PluginVersion *string // nil or "0" means draft, "" means latest/online version, otherwise is specific version
|
||||
}
|
||||
|
||||
type DependenceResource struct {
|
||||
PluginIDs []int64
|
||||
KnowledgeIDs []int64
|
||||
DatabaseIDs []int64
|
||||
}
|
||||
|
||||
type ExternalResourceRelated struct {
|
||||
PluginMap map[int64]*PluginEntity
|
||||
PluginToolMap map[int64]int64
|
||||
|
||||
KnowledgeMap map[int64]int64
|
||||
DatabaseMap map[int64]int64
|
||||
}
|
||||
|
||||
type CopyWorkflowPolicy struct {
|
||||
TargetSpaceID *int64
|
||||
TargetAppID *int64
|
||||
ModifiedCanvasSchema *string
|
||||
ShouldModifyWorkflowName bool
|
||||
}
|
||||
98
backend/domain/workflow/entity/vo/workflow_info.go
Normal file
98
backend/domain/workflow/entity/vo/workflow_info.go
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
)
|
||||
|
||||
type ReleasedWorkflowData struct {
|
||||
WorkflowList []*workflow.ReleasedWorkflow
|
||||
Inputs map[string]any
|
||||
Outputs map[string]any
|
||||
}
|
||||
|
||||
func (r *ReleasedWorkflowData) MarshalJSON() ([]byte, error) {
|
||||
inputs := r.Inputs
|
||||
outputs := r.Outputs
|
||||
bs, _ := sonic.Marshal(r.WorkflowList)
|
||||
workflowsListMap := make([]map[string]any, 0, len(r.WorkflowList))
|
||||
_ = sonic.Unmarshal(bs, &workflowsListMap)
|
||||
for _, m := range workflowsListMap {
|
||||
if wId, ok := m["workflow_id"]; ok {
|
||||
m["inputs"] = inputs[wId.(string)]
|
||||
m["outputs"] = outputs[wId.(string)]
|
||||
}
|
||||
}
|
||||
|
||||
result := map[string]interface{}{
|
||||
"workflow_list": workflowsListMap,
|
||||
"total": len(r.WorkflowList),
|
||||
}
|
||||
|
||||
return sonic.Marshal(result)
|
||||
|
||||
}
|
||||
|
||||
type WorkflowDetailDataList struct {
|
||||
List []*workflow.WorkflowDetailData
|
||||
Inputs map[string]any
|
||||
Outputs map[string]any
|
||||
}
|
||||
|
||||
func (r *WorkflowDetailDataList) MarshalJSON() ([]byte, error) {
|
||||
inputs := r.Inputs
|
||||
outputs := r.Outputs
|
||||
bs, _ := sonic.Marshal(r.List)
|
||||
wfList := make([]map[string]any, 0, len(r.List))
|
||||
_ = sonic.Unmarshal(bs, &wfList)
|
||||
|
||||
for _, m := range wfList {
|
||||
if wId, ok := m["workflow_id"]; ok {
|
||||
m["inputs"] = inputs[wId.(string)]
|
||||
m["outputs"] = outputs[wId.(string)]
|
||||
}
|
||||
}
|
||||
|
||||
return sonic.Marshal(wfList)
|
||||
|
||||
}
|
||||
|
||||
type WorkflowDetailInfoDataList struct {
|
||||
List []*workflow.WorkflowDetailInfoData
|
||||
|
||||
Inputs map[string]any
|
||||
Outputs map[string]any
|
||||
}
|
||||
|
||||
func (r *WorkflowDetailInfoDataList) MarshalJSON() ([]byte, error) {
|
||||
inputs := r.Inputs
|
||||
outputs := r.Outputs
|
||||
bs, _ := sonic.Marshal(r.List)
|
||||
wfList := make([]map[string]any, 0, len(r.List))
|
||||
_ = sonic.Unmarshal(bs, &wfList)
|
||||
|
||||
for _, m := range wfList {
|
||||
if wId, ok := m["workflow_id"]; ok {
|
||||
m["inputs"] = inputs[wId.(string)]
|
||||
m["outputs"] = outputs[wId.(string)]
|
||||
}
|
||||
}
|
||||
return sonic.Marshal(wfList)
|
||||
|
||||
}
|
||||
24
backend/domain/workflow/entity/vo/workflow_publish.go
Normal file
24
backend/domain/workflow/entity/vo/workflow_publish.go
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
type ReleaseWorkflowConfig struct {
|
||||
Version string
|
||||
PluginIDs []int64
|
||||
|
||||
ConnectorIDs []int64
|
||||
}
|
||||
24
backend/domain/workflow/entity/vo/workflow_tool.go
Normal file
24
backend/domain/workflow/entity/vo/workflow_tool.go
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import "github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
|
||||
type WorkflowToolConfig struct {
|
||||
InputParametersConfig []*workflow.APIParameter
|
||||
OutputParametersConfig []*workflow.APIParameter
|
||||
}
|
||||
85
backend/domain/workflow/entity/workflow.go
Normal file
85
backend/domain/workflow/entity/workflow.go
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type ContentType = workflow.WorkFlowType
|
||||
type Tag = workflow.Tag
|
||||
type Mode = workflow.WorkflowMode
|
||||
|
||||
type Workflow struct {
|
||||
ID int64
|
||||
CommitID string
|
||||
|
||||
*vo.Meta
|
||||
*vo.CanvasInfo
|
||||
*vo.DraftMeta
|
||||
*vo.VersionMeta
|
||||
}
|
||||
|
||||
func (w *Workflow) GetBasic() *WorkflowBasic {
|
||||
var version string
|
||||
if w.VersionMeta != nil {
|
||||
version = w.VersionMeta.Version
|
||||
}
|
||||
return &WorkflowBasic{
|
||||
ID: w.ID,
|
||||
Version: version,
|
||||
SpaceID: w.SpaceID,
|
||||
AppID: w.AppID,
|
||||
CommitID: w.CommitID,
|
||||
}
|
||||
}
|
||||
|
||||
func (w *Workflow) GetLatestVersion() string {
|
||||
if w.LatestPublishedVersion == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return *w.LatestPublishedVersion
|
||||
}
|
||||
|
||||
func (w *Workflow) GetVersion() string {
|
||||
if w.VersionMeta == nil {
|
||||
return ""
|
||||
}
|
||||
return w.VersionMeta.Version
|
||||
}
|
||||
|
||||
type IDVersionPair struct {
|
||||
ID int64
|
||||
Version string
|
||||
}
|
||||
|
||||
type Stage uint8
|
||||
|
||||
const (
|
||||
StageDraft Stage = 1
|
||||
StagePublished Stage = 2
|
||||
)
|
||||
|
||||
type WorkflowBasic struct {
|
||||
ID int64
|
||||
Version string
|
||||
SpaceID int64
|
||||
AppID *int64
|
||||
CommitID string
|
||||
}
|
||||
118
backend/domain/workflow/entity/workflow_execution.go
Normal file
118
backend/domain/workflow/entity/workflow_execution.go
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type WorkflowExecuteStatus workflow.WorkflowExeStatus
|
||||
type NodeExecuteStatus workflow.NodeExeStatus
|
||||
|
||||
type WorkflowExecution struct {
|
||||
ID int64
|
||||
WorkflowID int64
|
||||
Version string
|
||||
SpaceID int64
|
||||
vo.ExecuteConfig
|
||||
CreatedAt time.Time
|
||||
LogID string
|
||||
NodeCount int32
|
||||
CommitID string
|
||||
|
||||
Status WorkflowExecuteStatus
|
||||
Duration time.Duration
|
||||
Input *string
|
||||
Output *string
|
||||
ErrorCode *string
|
||||
FailReason *string
|
||||
TokenInfo *TokenUsage
|
||||
UpdatedAt *time.Time
|
||||
|
||||
ParentNodeID *string
|
||||
ParentNodeExecuteID *int64
|
||||
NodeExecutions []*NodeExecution
|
||||
RootExecutionID int64
|
||||
CurrentResumingEventID *int64
|
||||
|
||||
InterruptEvents []*InterruptEvent
|
||||
}
|
||||
|
||||
const (
|
||||
WorkflowRunning = WorkflowExecuteStatus(workflow.WorkflowExeStatus_Running)
|
||||
WorkflowSuccess = WorkflowExecuteStatus(workflow.WorkflowExeStatus_Success)
|
||||
WorkflowFailed = WorkflowExecuteStatus(workflow.WorkflowExeStatus_Fail)
|
||||
WorkflowCancel = WorkflowExecuteStatus(workflow.WorkflowExeStatus_Cancel)
|
||||
WorkflowInterrupted = WorkflowExecuteStatus(5)
|
||||
)
|
||||
|
||||
const (
|
||||
NodeRunning = NodeExecuteStatus(workflow.NodeExeStatus_Running)
|
||||
NodeSuccess = NodeExecuteStatus(workflow.NodeExeStatus_Success)
|
||||
NodeFailed = NodeExecuteStatus(workflow.NodeExeStatus_Fail)
|
||||
)
|
||||
|
||||
type TokenUsage struct {
|
||||
InputTokens int64
|
||||
OutputTokens int64
|
||||
}
|
||||
|
||||
type NodeExecution struct {
|
||||
ID int64
|
||||
ExecuteID int64
|
||||
NodeID string
|
||||
NodeName string
|
||||
NodeType NodeType
|
||||
CreatedAt time.Time
|
||||
|
||||
Status NodeExecuteStatus
|
||||
Duration time.Duration
|
||||
Input *string
|
||||
Output *string
|
||||
RawOutput *string
|
||||
ErrorInfo *string
|
||||
ErrorLevel *string
|
||||
TokenInfo *TokenUsage
|
||||
UpdatedAt *time.Time
|
||||
|
||||
Index int
|
||||
Items *string
|
||||
|
||||
ParentNodeID *string
|
||||
SubWorkflowExecution *WorkflowExecution
|
||||
IndexedExecutions []*NodeExecution
|
||||
|
||||
Extra *NodeExtra
|
||||
}
|
||||
|
||||
type NodeExtra struct {
|
||||
CurrentSubExecuteID int64 `json:"current_sub_execute_id,omitempty"`
|
||||
ResponseExtra map[string]any `json:"response_extra,omitempty"`
|
||||
SubExecuteID int64 `json:"subExecuteID,omitempty"` // for subworkflow node, the execute id of the sub workflow
|
||||
}
|
||||
|
||||
type FCCalled struct {
|
||||
Input string `json:"input,omitempty"`
|
||||
Output string `json:"output,omitempty"`
|
||||
}
|
||||
|
||||
type FCCalledDetail struct {
|
||||
FCCalledList []*FCCalled `json:"fc_called_list,omitempty"`
|
||||
}
|
||||
37
backend/domain/workflow/entity/workflow_reference.go
Normal file
37
backend/domain/workflow/entity/workflow_reference.go
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
)
|
||||
|
||||
type WorkflowReference struct {
|
||||
ID int64
|
||||
WorkflowReferenceKey
|
||||
CreatedAt time.Time
|
||||
Enabled bool
|
||||
}
|
||||
|
||||
type WorkflowReferenceKey struct {
|
||||
ReferredID int64
|
||||
ReferringID int64
|
||||
vo.ReferType
|
||||
vo.ReferringBizType
|
||||
}
|
||||
109
backend/domain/workflow/interface.go
Normal file
109
backend/domain/workflow/interface.go
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package workflow
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/eino/compose"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/ocean/cloud/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
|
||||
)
|
||||
|
||||
//go:generate mockgen -destination ../../internal/mock/domain/workflow/interface.go --package mockWorkflow -source interface.go
|
||||
type Service interface {
|
||||
ListNodeMeta(ctx context.Context, nodeTypes map[entity.NodeType]bool) (map[string][]*entity.NodeTypeMeta, []entity.Category, error)
|
||||
Create(ctx context.Context, meta *vo.MetaCreate) (int64, error)
|
||||
Save(ctx context.Context, id int64, schema string) error
|
||||
Get(ctx context.Context, policy *vo.GetPolicy) (*entity.Workflow, error)
|
||||
MGet(ctx context.Context, policy *vo.MGetPolicy) ([]*entity.Workflow, int64, error)
|
||||
Delete(ctx context.Context, policy *vo.DeletePolicy) (err error)
|
||||
Publish(ctx context.Context, policy *vo.PublishPolicy) (err error)
|
||||
UpdateMeta(ctx context.Context, id int64, metaUpdate *vo.MetaUpdate) (err error)
|
||||
CopyWorkflow(ctx context.Context, workflowID int64, policy vo.CopyWorkflowPolicy) (*entity.Workflow, error)
|
||||
|
||||
QueryNodeProperties(ctx context.Context, id int64) (map[string]*vo.NodeProperty, error) // only draft
|
||||
ValidateTree(ctx context.Context, id int64, validateConfig vo.ValidateTreeConfig) ([]*workflow.ValidateTreeInfo, error)
|
||||
|
||||
GetWorkflowReference(ctx context.Context, id int64) (map[int64]*vo.Meta, error)
|
||||
|
||||
Executable
|
||||
AsTool
|
||||
|
||||
ReleaseApplicationWorkflows(ctx context.Context, appID int64, config *vo.ReleaseWorkflowConfig) ([]*vo.ValidateIssue, error)
|
||||
CopyWorkflowFromAppToLibrary(ctx context.Context, workflowID int64, appID int64, related vo.ExternalResourceRelated) (map[int64]entity.IDVersionPair, []*vo.ValidateIssue, error)
|
||||
DuplicateWorkflowsByAppID(ctx context.Context, sourceAPPID, targetAppID int64, related vo.ExternalResourceRelated) error
|
||||
GetWorkflowDependenceResource(ctx context.Context, workflowID int64) (*vo.DependenceResource, error)
|
||||
SyncRelatedWorkflowResources(ctx context.Context, appID int64, relatedWorkflows map[int64]entity.IDVersionPair, related vo.ExternalResourceRelated) error
|
||||
}
|
||||
|
||||
type Repository interface {
|
||||
CreateMeta(ctx context.Context, meta *vo.Meta) (int64, error)
|
||||
CreateVersion(ctx context.Context, id int64, info *vo.VersionInfo, newRefs map[entity.WorkflowReferenceKey]struct{}) (err error)
|
||||
CreateOrUpdateDraft(ctx context.Context, id int64, draft *vo.DraftInfo) error
|
||||
Delete(ctx context.Context, id int64) error
|
||||
MDelete(ctx context.Context, ids []int64) error
|
||||
GetMeta(ctx context.Context, id int64) (*vo.Meta, error)
|
||||
UpdateMeta(ctx context.Context, id int64, metaUpdate *vo.MetaUpdate) error
|
||||
GetVersion(ctx context.Context, id int64, version string) (*vo.VersionInfo, error)
|
||||
|
||||
GetEntity(ctx context.Context, policy *vo.GetPolicy) (*entity.Workflow, error)
|
||||
|
||||
GetLatestVersion(ctx context.Context, id int64) (*vo.VersionInfo, error)
|
||||
|
||||
DraftV2(ctx context.Context, id int64, commitID string) (*vo.DraftInfo, error)
|
||||
|
||||
UpdateWorkflowDraftTestRunSuccess(ctx context.Context, id int64) error
|
||||
|
||||
MGetReferences(ctx context.Context, policy *vo.MGetReferencePolicy) (
|
||||
[]*entity.WorkflowReference, error)
|
||||
MGetMetas(ctx context.Context, query *vo.MetaQuery) (map[int64]*vo.Meta, int64, error)
|
||||
MGetDrafts(ctx context.Context, policy *vo.MGetPolicy) ([]*entity.Workflow, int64, error)
|
||||
MGetLatestVersion(ctx context.Context, policy *vo.MGetPolicy) ([]*entity.Workflow, int64, error)
|
||||
|
||||
CreateSnapshotIfNeeded(ctx context.Context, id int64, commitID string) error
|
||||
|
||||
InterruptEventStore
|
||||
CancelSignalStore
|
||||
ExecuteHistoryStore
|
||||
|
||||
WorkflowAsTool(ctx context.Context, policy vo.GetPolicy, wfToolConfig vo.WorkflowToolConfig) (ToolFromWorkflow, error)
|
||||
|
||||
CopyWorkflow(ctx context.Context, workflowID int64, policy vo.CopyWorkflowPolicy) (*entity.Workflow, error)
|
||||
|
||||
GetDraftWorkflowsByAppID(ctx context.Context, AppID int64) (map[int64]*vo.DraftInfo, map[int64]string, error)
|
||||
|
||||
BatchCreateConnectorWorkflowVersion(ctx context.Context, appID, connectorID int64, workflowIDs []int64, version string) error
|
||||
|
||||
IsApplicationConnectorWorkflowVersion(ctx context.Context, connectorID, workflowID int64, version string) (b bool, err error)
|
||||
|
||||
compose.CheckPointStore
|
||||
idgen.IDGenerator
|
||||
}
|
||||
|
||||
var repositorySingleton Repository
|
||||
|
||||
func GetRepository() Repository {
|
||||
return repositorySingleton
|
||||
}
|
||||
|
||||
func SetRepository(repository Repository) {
|
||||
repositorySingleton = repository
|
||||
}
|
||||
837
backend/domain/workflow/internal/canvas/adaptor/canvas_test.go
Normal file
837
backend/domain/workflow/internal/canvas/adaptor/canvas_test.go
Normal file
@@ -0,0 +1,837 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package adaptor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/bytedance/mockey"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/mock/gomock"
|
||||
|
||||
userentity "github.com/coze-dev/coze-studio/backend/domain/user/entity"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/code"
|
||||
crossdatabase "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/database"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/database/databasemock"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/knowledge"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/knowledge/knowledgemock"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model"
|
||||
mockmodel "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model/modelmock"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/plugin"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/plugin/pluginmock"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable"
|
||||
mockvar "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable/varmock"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/internal/compose"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/internal/execute"
|
||||
mockWorkflow "github.com/coze-dev/coze-studio/backend/internal/mock/domain/workflow"
|
||||
mockcode "github.com/coze-dev/coze-studio/backend/internal/mock/domain/workflow/crossdomain/code"
|
||||
"github.com/coze-dev/coze-studio/backend/internal/testutil"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/ctxcache"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
"github.com/coze-dev/coze-studio/backend/types/consts"
|
||||
)
|
||||
|
||||
func TestIntentDetectorAndDatabase(t *testing.T) {
|
||||
mockey.PatchConvey("intent detector & database custom sql", t, func() {
|
||||
data, err := os.ReadFile("../examples/intent_detector_database_custom_sql.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
assert.NoError(t, err)
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
mockey.Mock(execute.GetExeCtx).Return(&execute.Context{
|
||||
RootCtx: execute.RootCtx{
|
||||
ExeCfg: vo.ExecuteConfig{
|
||||
Mode: vo.ExecuteModeDebug,
|
||||
Operator: 123,
|
||||
BizType: vo.BizTypeWorkflow,
|
||||
},
|
||||
},
|
||||
}).Build()
|
||||
|
||||
mockModelManager := mockmodel.NewMockManager(ctrl)
|
||||
mockey.Mock(model.GetManager).Return(mockModelManager).Build()
|
||||
|
||||
chatModel := &testutil.UTChatModel{
|
||||
InvokeResultProvider: func(_ int, in []*schema.Message) (*schema.Message, error) {
|
||||
return &schema.Message{
|
||||
Role: schema.Assistant,
|
||||
Content: `{"classificationId":1,"reason":"choice branch 1 "}`,
|
||||
ResponseMeta: &schema.ResponseMeta{
|
||||
Usage: &schema.TokenUsage{
|
||||
PromptTokens: 1,
|
||||
CompletionTokens: 2,
|
||||
TotalTokens: 3,
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
},
|
||||
}
|
||||
mockModelManager.EXPECT().GetModel(gomock.Any(), gomock.Any()).Return(chatModel, nil, nil).AnyTimes()
|
||||
|
||||
mockDatabaseOperator := databasemock.NewMockDatabaseOperator(ctrl)
|
||||
n := int64(2)
|
||||
resp := &crossdatabase.Response{
|
||||
Objects: []crossdatabase.Object{
|
||||
{
|
||||
"v2": "123",
|
||||
},
|
||||
{
|
||||
"v2": "345",
|
||||
},
|
||||
},
|
||||
RowNumber: &n,
|
||||
}
|
||||
mockDatabaseOperator.EXPECT().Execute(gomock.Any(), gomock.Any()).Return(resp, nil).AnyTimes()
|
||||
mockey.Mock(crossdatabase.GetDatabaseOperator).Return(mockDatabaseOperator).Build()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC, compose.WithIDAsName(2))
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"input": "what's your name?",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
output := response["output"]
|
||||
bs, _ := sonic.Marshal(output)
|
||||
ret := make([]map[string]interface{}, 0)
|
||||
err = sonic.Unmarshal(bs, &ret)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, ret[0]["v2"], int64(123))
|
||||
assert.Equal(t, ret[1]["v2"], int64(345))
|
||||
|
||||
number := response["number"].(int64)
|
||||
assert.Equal(t, int64(2), number)
|
||||
})
|
||||
}
|
||||
|
||||
func mockUpdate(t *testing.T) func(context.Context, *crossdatabase.UpdateRequest) (*crossdatabase.Response, error) {
|
||||
return func(ctx context.Context, req *crossdatabase.UpdateRequest) (*crossdatabase.Response, error) {
|
||||
assert.Equal(t, req.ConditionGroup.Conditions[0], &crossdatabase.Condition{
|
||||
Left: "v2",
|
||||
Operator: "=",
|
||||
Right: int64(1),
|
||||
})
|
||||
|
||||
assert.Equal(t, req.ConditionGroup.Conditions[1], &crossdatabase.Condition{
|
||||
Left: "v1",
|
||||
Operator: "=",
|
||||
Right: "abc",
|
||||
})
|
||||
assert.Equal(t, req.ConditionGroup.Relation, crossdatabase.ClauseRelationAND)
|
||||
assert.Equal(t, req.Fields, map[string]interface{}{
|
||||
"1783392627713": int64(123),
|
||||
})
|
||||
|
||||
return &crossdatabase.Response{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func mockInsert(t *testing.T) func(ctx context.Context, request *crossdatabase.InsertRequest) (*crossdatabase.Response, error) {
|
||||
return func(ctx context.Context, req *crossdatabase.InsertRequest) (*crossdatabase.Response, error) {
|
||||
v := req.Fields["1785960530945"]
|
||||
assert.Equal(t, v, int64(123))
|
||||
vs := req.Fields["1783122026497"]
|
||||
assert.Equal(t, vs, "input for database curd")
|
||||
n := int64(10)
|
||||
return &crossdatabase.Response{
|
||||
RowNumber: &n,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func mockQuery(t *testing.T) func(ctx context.Context, request *crossdatabase.QueryRequest) (*crossdatabase.Response, error) {
|
||||
return func(ctx context.Context, req *crossdatabase.QueryRequest) (*crossdatabase.Response, error) {
|
||||
assert.Equal(t, req.ConditionGroup.Conditions[0], &crossdatabase.Condition{
|
||||
Left: "v1",
|
||||
Operator: "=",
|
||||
Right: "abc",
|
||||
})
|
||||
|
||||
assert.Equal(t, req.SelectFields, []string{
|
||||
"1783122026497", "1784288924673", "1783392627713",
|
||||
})
|
||||
n := int64(10)
|
||||
return &crossdatabase.Response{
|
||||
RowNumber: &n,
|
||||
Objects: []crossdatabase.Object{
|
||||
{"v1": "vv"},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func mockDelete(t *testing.T) func(context.Context, *crossdatabase.DeleteRequest) (*crossdatabase.Response, error) {
|
||||
return func(ctx context.Context, req *crossdatabase.DeleteRequest) (*crossdatabase.Response, error) {
|
||||
nn := int64(10)
|
||||
assert.Equal(t, req.ConditionGroup.Conditions[0], &crossdatabase.Condition{
|
||||
Left: "v2",
|
||||
Operator: "=",
|
||||
Right: nn,
|
||||
})
|
||||
|
||||
n := int64(1)
|
||||
return &crossdatabase.Response{
|
||||
RowNumber: &n,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func TestDatabaseCURD(t *testing.T) {
|
||||
mockey.PatchConvey("database curd", t, func() {
|
||||
data, err := os.ReadFile("../examples/database_curd.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
_ = ctx
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
mockDatabaseOperator := databasemock.NewMockDatabaseOperator(ctrl)
|
||||
mockey.Mock(crossdatabase.GetDatabaseOperator).Return(mockDatabaseOperator).Build()
|
||||
mockDatabaseOperator.EXPECT().Query(gomock.Any(), gomock.Any()).DoAndReturn(mockQuery(t))
|
||||
mockDatabaseOperator.EXPECT().Update(gomock.Any(), gomock.Any()).DoAndReturn(mockUpdate(t))
|
||||
mockDatabaseOperator.EXPECT().Insert(gomock.Any(), gomock.Any()).DoAndReturn(mockInsert(t))
|
||||
mockDatabaseOperator.EXPECT().Delete(gomock.Any(), gomock.Any()).DoAndReturn(mockDelete(t))
|
||||
|
||||
mockey.Mock(execute.GetExeCtx).Return(&execute.Context{
|
||||
RootCtx: execute.RootCtx{
|
||||
ExeCfg: vo.ExecuteConfig{
|
||||
Mode: vo.ExecuteModeDebug,
|
||||
Operator: 123,
|
||||
BizType: vo.BizTypeWorkflow,
|
||||
},
|
||||
},
|
||||
}).Build()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC, compose.WithIDAsName(2))
|
||||
assert.NoError(t, err)
|
||||
|
||||
mockRepo := mockWorkflow.NewMockRepository(ctrl)
|
||||
mockey.Mock(workflow.GetRepository).Return(mockRepo).Build()
|
||||
mockRepo.EXPECT().GenID(gomock.Any()).Return(time.Now().UnixNano(), nil).AnyTimes()
|
||||
mockRepo.EXPECT().GetWorkflowCancelFlag(gomock.Any(), gomock.Any()).Return(false, nil).AnyTimes()
|
||||
|
||||
output, err := wf.SyncRun(ctx, map[string]any{
|
||||
"input": "input for database curd",
|
||||
"v2": int64(123),
|
||||
})
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, map[string]any{
|
||||
"output": int64(1),
|
||||
}, output)
|
||||
})
|
||||
}
|
||||
|
||||
func TestHttpRequester(t *testing.T) {
|
||||
listener, err := net.Listen("tcp", "127.0.0.1:8080") // 指定IP和端口
|
||||
assert.NoError(t, err)
|
||||
ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/http_error" {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
if r.URL.Path == "/file" {
|
||||
_, _ = w.Write([]byte(strings.Repeat("A", 1024*2)))
|
||||
}
|
||||
|
||||
if r.URL.Path == "/no_auth_no_body" {
|
||||
assert.Equal(t, "h_v1", r.Header.Get("h1"))
|
||||
assert.Equal(t, "h_v2", r.Header.Get("h2"))
|
||||
assert.Equal(t, "abc", r.Header.Get("h3"))
|
||||
assert.Equal(t, "v1", r.URL.Query().Get("query_v1"))
|
||||
assert.Equal(t, "v2", r.URL.Query().Get("query_v2"))
|
||||
response := map[string]string{
|
||||
"message": "no_auth_no_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
}
|
||||
|
||||
if r.URL.Path == "/bear_auth_no_body" {
|
||||
assert.Equal(t, "Bearer bear_token", r.Header.Get("Authorization"))
|
||||
response := map[string]string{
|
||||
"message": "bear_auth_no_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
|
||||
}
|
||||
|
||||
if r.URL.Path == "/custom_auth_no_body" {
|
||||
assert.Equal(t, "authValue", r.URL.Query().Get("authKey"))
|
||||
response := map[string]string{
|
||||
"message": "custom_auth_no_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
|
||||
}
|
||||
|
||||
if r.URL.Path == "/custom_auth_json_body" {
|
||||
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
return
|
||||
}
|
||||
jsonRet := make(map[string]string)
|
||||
err = sonic.Unmarshal(body, &jsonRet)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, jsonRet["v1"], "1")
|
||||
assert.Equal(t, jsonRet["v2"], "json_body")
|
||||
|
||||
response := map[string]string{
|
||||
"message": "custom_auth_json_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
}
|
||||
|
||||
if r.URL.Path == "/custom_auth_form_data_body" {
|
||||
file, _, err := r.FormFile("file_v1")
|
||||
assert.NoError(t, err)
|
||||
|
||||
fileBs, err := io.ReadAll(file)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, fileBs, []byte(strings.Repeat("A", 1024*2)))
|
||||
response := map[string]string{
|
||||
"message": "custom_auth_form_data_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
}
|
||||
|
||||
if r.URL.Path == "/custom_auth_form_url_body" {
|
||||
err := r.ParseForm()
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "formUrlV1", r.Form.Get("v1"))
|
||||
assert.Equal(t, "formUrlV2", r.Form.Get("v2"))
|
||||
|
||||
response := map[string]string{
|
||||
"message": "custom_auth_form_url_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
}
|
||||
|
||||
if r.URL.Path == "/custom_auth_file_body" {
|
||||
body, err := io.ReadAll(r.Body)
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
_ = r.Body.Close()
|
||||
}()
|
||||
assert.Equal(t, strings.TrimSpace(strings.Repeat("A", 1024*2)), string(body))
|
||||
response := map[string]string{
|
||||
"message": "custom_auth_file_body",
|
||||
}
|
||||
bs, _ := sonic.Marshal(response)
|
||||
_, _ = w.Write(bs)
|
||||
}
|
||||
if r.URL.Path == "/http_error" {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
}))
|
||||
ts.Listener = listener
|
||||
ts.Start()
|
||||
defer ts.Close()
|
||||
defer func() {
|
||||
_ = listener.Close()
|
||||
}()
|
||||
mockey.PatchConvey("http requester no auth and no body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/no_auth_no_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC, compose.WithIDAsName(3))
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"no_auth_no_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester has bear auth and no body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/bear_auth_no_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC, compose.WithIDAsName(2))
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"token": "bear_token",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"bear_auth_no_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester custom auth and no body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/custom_auth_no_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"custom_auth_no_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester custom auth and json body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/custom_auth_json_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC, compose.WithIDAsName(2))
|
||||
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
"json_key": "json_body",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"custom_auth_json_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester custom auth and form data body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/custom_auth_form_data_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
"form_key_v1": "value1",
|
||||
"form_key_v2": "http://127.0.0.1:8080/file",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"custom_auth_form_data_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester custom auth and form url body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/custom_auth_form_url_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
"form_url_v1": "formUrlV1",
|
||||
"form_url_v2": "formUrlV2",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"custom_auth_form_url_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
mockey.PatchConvey("http requester custom auth and file body", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/custom_auth_file_body.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
"file": "http://127.0.0.1:8080/file",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, `{"message":"custom_auth_file_body"}`)
|
||||
assert.Equal(t, response["h2_v2"], "h_v2")
|
||||
})
|
||||
|
||||
mockey.PatchConvey("http requester with url template", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/http_with_url_template.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"input": "input",
|
||||
"m": map[string]any{
|
||||
"m1": "m1_v1",
|
||||
},
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
output := response["output"].(string)
|
||||
|
||||
result := make(map[string]any)
|
||||
err = sonic.UnmarshalString(output, &result)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, result["data"].(string), `input`)
|
||||
assert.Equal(t, result["args"], map[string]any{
|
||||
"var": "input",
|
||||
"var2": "m1_v1",
|
||||
})
|
||||
})
|
||||
|
||||
mockey.PatchConvey("http requester error", t, func() {
|
||||
data, err := os.ReadFile("../examples/httprequester/http_error.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v1": "v1",
|
||||
"v2": "v2",
|
||||
"h_v1": "h_v1",
|
||||
"h_v2": "h_v2",
|
||||
"auth_key": "authKey",
|
||||
"auth_value": "authValue",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
body := response["body"].(string)
|
||||
assert.Equal(t, body, "v1")
|
||||
})
|
||||
}
|
||||
|
||||
func TestKnowledgeNodes(t *testing.T) {
|
||||
mockey.PatchConvey("knowledge indexer & retriever", t, func() {
|
||||
data, err := os.ReadFile("../examples/knowledge.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
mockKnowledgeOperator := knowledgemock.NewMockKnowledgeOperator(ctrl)
|
||||
mockey.Mock(knowledge.GetKnowledgeOperator).Return(mockKnowledgeOperator).Build()
|
||||
|
||||
response := &knowledge.CreateDocumentResponse{
|
||||
DocumentID: int64(1),
|
||||
}
|
||||
mockKnowledgeOperator.EXPECT().Store(gomock.Any(), gomock.Any()).Return(response, nil)
|
||||
|
||||
rResponse := &knowledge.RetrieveResponse{
|
||||
Slices: []*knowledge.Slice{
|
||||
{
|
||||
DocumentID: "v1",
|
||||
Output: "v1",
|
||||
},
|
||||
{
|
||||
DocumentID: "v2",
|
||||
Output: "v2",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
mockKnowledgeOperator.EXPECT().Retrieve(gomock.Any(), gomock.Any()).Return(rResponse, nil)
|
||||
mockGlobalAppVarStore := mockvar.NewMockStore(ctrl)
|
||||
mockGlobalAppVarStore.EXPECT().Get(gomock.Any(), gomock.Any()).Return("v1", nil).AnyTimes()
|
||||
mockGlobalAppVarStore.EXPECT().Set(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
|
||||
|
||||
variable.SetVariableHandler(&variable.Handler{
|
||||
AppVarStore: mockGlobalAppVarStore,
|
||||
})
|
||||
|
||||
ctx := t.Context()
|
||||
ctx = ctxcache.Init(ctx)
|
||||
ctxcache.Store(ctx, consts.SessionDataKeyInCtx, &userentity.Session{
|
||||
UserID: 123,
|
||||
})
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
resp, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"file": "http://127.0.0.1:8080/file?x-wf-file_name=file_v1.docx",
|
||||
"v1": "v1",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, map[string]any{
|
||||
"success": []any{
|
||||
map[string]any{
|
||||
"documentId": "v1",
|
||||
"output": "v1",
|
||||
},
|
||||
|
||||
map[string]any{
|
||||
"documentId": "v2",
|
||||
"output": "v2",
|
||||
},
|
||||
},
|
||||
"v1": "v1",
|
||||
}, resp)
|
||||
})
|
||||
}
|
||||
|
||||
func TestKnowledgeDeleter(t *testing.T) {
|
||||
mockey.PatchConvey("knowledge deleter", t, func() {
|
||||
data, err := os.ReadFile("../examples/knowledge_delete.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
mockKnowledgeOperator := knowledgemock.NewMockKnowledgeOperator(ctrl)
|
||||
mockey.Mock(knowledge.GetKnowledgeOperator).Return(mockKnowledgeOperator).Build()
|
||||
|
||||
storeResponse := &knowledge.CreateDocumentResponse{
|
||||
DocumentID: int64(1),
|
||||
FileName: "1706.03762v7.pdf",
|
||||
FileURL: "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/5264fa1295da4a6483cd236b1316c454.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1782379180&x-signature=mlaXPIk9VJjOXu87xGaRmNRg9%2BA%3D&x-wf-file_name=1706.03762v7.pdf",
|
||||
}
|
||||
mockKnowledgeOperator.EXPECT().Store(gomock.Any(), gomock.Any()).Return(storeResponse, nil)
|
||||
|
||||
deleteResponse := &knowledge.DeleteDocumentResponse{
|
||||
IsSuccess: true,
|
||||
}
|
||||
mockKnowledgeOperator.EXPECT().Delete(gomock.Any(), gomock.Any()).Return(deleteResponse, nil)
|
||||
|
||||
ctx := t.Context()
|
||||
ctx = ctxcache.Init(ctx)
|
||||
ctxcache.Store(ctx, consts.SessionDataKeyInCtx, &userentity.Session{
|
||||
UserID: 123,
|
||||
})
|
||||
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resp, err := wf.Runner.Invoke(ctx, map[string]any{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, map[string]any{"output": true}, resp)
|
||||
})
|
||||
}
|
||||
|
||||
func TestCodeAndPluginNodes(t *testing.T) {
|
||||
mockey.PatchConvey("code & plugin ", t, func() {
|
||||
data, err := os.ReadFile("../examples/code_plugin.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
mockCodeRunner := mockcode.NewMockRunner(ctrl)
|
||||
mockey.Mock(code.GetCodeRunner).Return(mockCodeRunner).Build()
|
||||
mockCodeRunner.EXPECT().Run(gomock.Any(), gomock.Any()).Return(&code.RunResponse{
|
||||
Result: map[string]any{
|
||||
"key0": "value0",
|
||||
"key1": []string{"value1", "value2"},
|
||||
"key11": "value11",
|
||||
},
|
||||
}, nil)
|
||||
|
||||
mockToolService := pluginmock.NewMockService(ctrl)
|
||||
mockey.Mock(plugin.GetPluginService).Return(mockToolService).Build()
|
||||
mockToolService.EXPECT().ExecutePlugin(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(),
|
||||
gomock.Any()).Return(map[string]any{
|
||||
"log_id": "20240617191637796DF3F4453E16AF3615",
|
||||
"msg": "success",
|
||||
"code": 0,
|
||||
"data": map[string]interface{}{
|
||||
"image_url": "image_url",
|
||||
"prompt": "小狗在草地上",
|
||||
},
|
||||
}, nil).AnyTimes()
|
||||
|
||||
ctx := t.Context()
|
||||
ctx = ctxcache.Init(ctx)
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resp, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"code_input": "v1",
|
||||
"code_input_2": "v2",
|
||||
"model_type": int64(123),
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, map[string]any{
|
||||
"output": "value0",
|
||||
"output2": "20240617191637796DF3F4453E16AF3615",
|
||||
}, resp)
|
||||
})
|
||||
}
|
||||
|
||||
func TestVariableAggregatorNode(t *testing.T) {
|
||||
mockey.PatchConvey("Variable aggregator ", t, func() {
|
||||
data, err := os.ReadFile("../examples/variable_aggregate/variable_aggregator.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
ctx := t.Context()
|
||||
workflowSC, err := CanvasToWorkflowSchema(ctx, c)
|
||||
assert.NoError(t, err)
|
||||
wf, err := compose.NewWorkflow(ctx, workflowSC)
|
||||
assert.NoError(t, err)
|
||||
response, err := wf.Runner.Invoke(ctx, map[string]any{
|
||||
"v11": "v11",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, map[string]any{
|
||||
"g1": "v11",
|
||||
"g2": int64(100),
|
||||
}, response)
|
||||
})
|
||||
}
|
||||
|
||||
func TestPruneIsolatedNodes(t *testing.T) {
|
||||
data, err := os.ReadFile("../examples/validate/workflow_of_prune_isolate.json")
|
||||
assert.NoError(t, err)
|
||||
c := &vo.Canvas{}
|
||||
err = sonic.Unmarshal(data, c)
|
||||
assert.NoError(t, err)
|
||||
c.Nodes, c.Edges = PruneIsolatedNodes(c.Nodes, c.Edges, nil)
|
||||
qaNodeID := "147187"
|
||||
blockTextProcessNodeID := "102623"
|
||||
for _, n := range c.Nodes {
|
||||
if n.ID == qaNodeID {
|
||||
t.Fatal("qa node id should not exist")
|
||||
}
|
||||
if len(n.Blocks) > 0 {
|
||||
for _, b := range n.Blocks {
|
||||
if b.ID == blockTextProcessNodeID {
|
||||
t.Fatal("text process node id should not exist")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
241
backend/domain/workflow/internal/canvas/adaptor/from_node.go
Normal file
241
backend/domain/workflow/internal/canvas/adaptor/from_node.go
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package adaptor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
einoCompose "github.com/cloudwego/eino/compose"
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/internal/compose"
|
||||
)
|
||||
|
||||
func WorkflowSchemaFromNode(ctx context.Context, c *vo.Canvas, nodeID string) (
|
||||
*compose.WorkflowSchema, error) {
|
||||
var (
|
||||
n *vo.Node
|
||||
nodeFinder func(nodes []*vo.Node) *vo.Node
|
||||
)
|
||||
nodeFinder = func(nodes []*vo.Node) *vo.Node {
|
||||
for i := range nodes {
|
||||
if nodes[i].ID == nodeID {
|
||||
return nodes[i]
|
||||
}
|
||||
if len(nodes[i].Blocks) > 0 {
|
||||
if n := nodeFinder(nodes[i].Blocks); n != nil {
|
||||
return n
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
n = nodeFinder(c.Nodes)
|
||||
if n == nil {
|
||||
return nil, fmt.Errorf("node %s not found", nodeID)
|
||||
}
|
||||
|
||||
batchN, enabled, err := parseBatchMode(n)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if enabled {
|
||||
n = batchN
|
||||
}
|
||||
|
||||
implicitDependencies, err := extractImplicitDependency(n, c.Nodes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opts := make([]OptionFn, 0, 1)
|
||||
if len(implicitDependencies) > 0 {
|
||||
opts = append(opts, WithImplicitNodeDependencies(implicitDependencies))
|
||||
}
|
||||
nsList, hierarchy, err := NodeToNodeSchema(ctx, n, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var (
|
||||
ns *compose.NodeSchema
|
||||
innerNodes map[vo.NodeKey]*compose.NodeSchema // inner nodes of the composite node if nodeKey is composite
|
||||
connections []*compose.Connection
|
||||
)
|
||||
|
||||
if len(nsList) == 1 {
|
||||
ns = nsList[0]
|
||||
} else {
|
||||
innerNodes = make(map[vo.NodeKey]*compose.NodeSchema)
|
||||
for i := range nsList {
|
||||
one := nsList[i]
|
||||
if _, ok := hierarchy[one.Key]; ok {
|
||||
innerNodes[one.Key] = one
|
||||
if one.Type == entity.NodeTypeContinue || one.Type == entity.NodeTypeBreak {
|
||||
connections = append(connections, &compose.Connection{
|
||||
FromNode: one.Key,
|
||||
ToNode: vo.NodeKey(nodeID),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
ns = one
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ns == nil {
|
||||
panic("impossible")
|
||||
}
|
||||
|
||||
const inputFillerKey = "input_filler"
|
||||
connections = append(connections, &compose.Connection{
|
||||
FromNode: einoCompose.START,
|
||||
ToNode: inputFillerKey,
|
||||
}, &compose.Connection{
|
||||
FromNode: inputFillerKey,
|
||||
ToNode: ns.Key,
|
||||
}, &compose.Connection{
|
||||
FromNode: ns.Key,
|
||||
ToNode: einoCompose.END,
|
||||
})
|
||||
if len(n.Edges) > 0 { // only need to keep the connections for inner nodes of composite node
|
||||
for i := range n.Edges {
|
||||
conn := EdgeToConnection(n.Edges[i])
|
||||
connections = append(connections, conn)
|
||||
}
|
||||
|
||||
allN := make(map[string]*vo.Node)
|
||||
allN[string(ns.Key)] = n
|
||||
for i := range n.Blocks {
|
||||
inner := n.Blocks[i]
|
||||
allN[inner.ID] = inner
|
||||
}
|
||||
connections, err = normalizePorts(connections, allN)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
startOutputTypes := maps.Clone(ns.InputTypes)
|
||||
|
||||
// For chosen node, change input sources to be from einoCompose.START,
|
||||
// unless it's static value or from variables.
|
||||
// Also change the FromPath to be the same as Path.
|
||||
newInputSources := make([]*vo.FieldInfo, 0, len(ns.InputSources))
|
||||
for i := range ns.InputSources {
|
||||
input := ns.InputSources[i]
|
||||
if input.Source.Ref != nil && input.Source.Ref.VariableType != nil {
|
||||
// from variables
|
||||
newInputSources = append(newInputSources, input)
|
||||
} else if input.Source.Ref == nil {
|
||||
// static values
|
||||
newInputSources = append(newInputSources, input)
|
||||
} else {
|
||||
newInputSources = append(newInputSources, &vo.FieldInfo{
|
||||
Path: input.Path,
|
||||
Source: vo.FieldSource{Ref: &vo.Reference{
|
||||
FromNodeKey: inputFillerKey,
|
||||
FromPath: input.Path,
|
||||
}},
|
||||
})
|
||||
}
|
||||
}
|
||||
ns.InputSources = newInputSources
|
||||
|
||||
// for inner node, change input sources to be from einoCompose.START,
|
||||
// unless it's static value, from variables, from parent, or from other inner nodes
|
||||
// Also change the FromPath to be the same as Path.
|
||||
for key := range innerNodes {
|
||||
inner := innerNodes[key]
|
||||
innerInputSources := make([]*vo.FieldInfo, 0, len(inner.InputSources))
|
||||
for i := range inner.InputSources {
|
||||
input := inner.InputSources[i]
|
||||
if input.Source.Ref != nil && input.Source.Ref.VariableType != nil {
|
||||
// from variables
|
||||
innerInputSources = append(innerInputSources, input)
|
||||
} else if input.Source.Ref == nil {
|
||||
// static values
|
||||
innerInputSources = append(innerInputSources, input)
|
||||
} else if input.Source.Ref.FromNodeKey == ns.Key {
|
||||
// from parent
|
||||
innerInputSources = append(innerInputSources, input)
|
||||
} else if _, ok := innerNodes[input.Source.Ref.FromNodeKey]; ok {
|
||||
// from other inner nodes
|
||||
innerInputSources = append(innerInputSources, input)
|
||||
} else {
|
||||
innerInputSources = append(innerInputSources, &vo.FieldInfo{
|
||||
Path: input.Path,
|
||||
Source: vo.FieldSource{Ref: &vo.Reference{
|
||||
FromNodeKey: inputFillerKey,
|
||||
FromPath: input.Path,
|
||||
}},
|
||||
})
|
||||
startOutputTypes[input.Path[0]] = inner.InputTypes[input.Path[0]]
|
||||
}
|
||||
}
|
||||
inner.InputSources = innerInputSources
|
||||
}
|
||||
|
||||
i := func(ctx context.Context, output map[string]any) (map[string]any, error) {
|
||||
newOutput := make(map[string]any)
|
||||
for k := range output {
|
||||
newOutput[k] = output[k]
|
||||
}
|
||||
|
||||
for k, tInfo := range startOutputTypes {
|
||||
if err := compose.FillIfNotRequired(tInfo, newOutput, k, compose.FillNil, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return newOutput, nil
|
||||
}
|
||||
|
||||
inputFiller := &compose.NodeSchema{
|
||||
Key: inputFillerKey,
|
||||
Type: entity.NodeTypeLambda,
|
||||
Lambda: einoCompose.InvokableLambda(i),
|
||||
InputSources: []*vo.FieldInfo{
|
||||
{
|
||||
Path: einoCompose.FieldPath{},
|
||||
Source: vo.FieldSource{
|
||||
Ref: &vo.Reference{
|
||||
FromNodeKey: einoCompose.START,
|
||||
FromPath: einoCompose.FieldPath{},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
OutputTypes: startOutputTypes,
|
||||
}
|
||||
|
||||
trimmedSC := &compose.WorkflowSchema{
|
||||
Nodes: append([]*compose.NodeSchema{ns, inputFiller}, maps.Values(innerNodes)...),
|
||||
Connections: connections,
|
||||
Hierarchy: hierarchy,
|
||||
}
|
||||
|
||||
if enabled {
|
||||
trimmedSC.GeneratedNodes = append(trimmedSC.GeneratedNodes, ns.Key)
|
||||
}
|
||||
|
||||
return trimmedSC, nil
|
||||
}
|
||||
2338
backend/domain/workflow/internal/canvas/adaptor/to_schema.go
Normal file
2338
backend/domain/workflow/internal/canvas/adaptor/to_schema.go
Normal file
File diff suppressed because it is too large
Load Diff
1230
backend/domain/workflow/internal/canvas/adaptor/type_convert.go
Normal file
1230
backend/domain/workflow/internal/canvas/adaptor/type_convert.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 26.700000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1300,
|
||||
"y": 13.700000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "159154",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "159154",
|
||||
"type": "21",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 740,
|
||||
"y": 0
|
||||
},
|
||||
"canvasPosition": {
|
||||
"x": 560,
|
||||
"y": 319.4
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "循环",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Loop-v2.jpg",
|
||||
"description": "用于通过设定循环次数和逻辑,重复执行一系列任务",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "循环"
|
||||
},
|
||||
"inputs": {
|
||||
"loopType": "array",
|
||||
"loopCount": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "10"
|
||||
}
|
||||
},
|
||||
"variableParameters": [
|
||||
{
|
||||
"name": "vars",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "[\"1\"]",
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "159154",
|
||||
"name": "vars"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"blocks": [
|
||||
{
|
||||
"id": "108785",
|
||||
"type": "40",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "变量赋值",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/Variable.jpg",
|
||||
"description": "用于给支持写入的变量赋值,包括应用变量、用户变量",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "变量赋值"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "appv1",
|
||||
"left": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "global_variable_app",
|
||||
"path": [
|
||||
"appv1"
|
||||
],
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"variableTypeMap": {
|
||||
"appv1": "global_variable_app"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "isSuccess",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "159154",
|
||||
"targetNodeID": "108785",
|
||||
"sourcePortID": "loop-function-inline-output"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "108785",
|
||||
"targetNodeID": "159154",
|
||||
"targetPortID": "loop-function-inline-input"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "159154"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "159154",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": "loop-output"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input_array",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
},
|
||||
{
|
||||
"name": "batch_concurrency",
|
||||
"required": true,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "optional",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -10.588288288288288,
|
||||
"y": -166.3
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "163658",
|
||||
"name": "USER_RESPONSE_list",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1039.3313063063065,
|
||||
"y": -179.3
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"outputSchema": "[{\"type\":\"string\",\"name\":\"input\",\"required\":true}]"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "receiver"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "165663",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -180.51644144144146,
|
||||
"y": 76.74533360653558
|
||||
}
|
||||
},
|
||||
"type": "30"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"answer_type": "text",
|
||||
"dynamic_option": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "",
|
||||
"name": "",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"extra_output": false,
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "163658",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "arr_item"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "165663",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "user_input"
|
||||
}
|
||||
],
|
||||
"limit": 3,
|
||||
"llmParam": {
|
||||
"generationDiversity": "balance",
|
||||
"maxTokens": 1024,
|
||||
"modelName": "doubao function calling",
|
||||
"modelType": 1706077826,
|
||||
"responseFormat": 2,
|
||||
"systemPrompt": "",
|
||||
"temperature": 1,
|
||||
"topP": 0.7
|
||||
},
|
||||
"option_type": "static",
|
||||
"options": [
|
||||
{
|
||||
"name": ""
|
||||
}
|
||||
],
|
||||
"question": "{{arr_item}} {{user_input}}"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "qa"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "USER_RESPONSE",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "197297",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 358.2819819819821,
|
||||
"y": 37.74533360653553
|
||||
}
|
||||
},
|
||||
"type": "18"
|
||||
}
|
||||
],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"batchSize": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "100",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"concurrentSize": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "batch_concurrency",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input_array",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "batch"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "197297",
|
||||
"name": "USER_RESPONSE",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "USER_RESPONSE_list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "163658",
|
||||
"targetNodeID": "165663",
|
||||
"sourcePortID": "batch-function-inline-output"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "165663",
|
||||
"targetNodeID": "197297",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "197297",
|
||||
"targetNodeID": "163658",
|
||||
"sourcePortID": "",
|
||||
"targetPortID": "batch-function-inline-input"
|
||||
}
|
||||
],
|
||||
"id": "163658",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 389.04110360360346,
|
||||
"y": 88.16987652593423
|
||||
},
|
||||
"position": {
|
||||
"x": 477.92387387387384,
|
||||
"y": -180
|
||||
}
|
||||
},
|
||||
"type": "28"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "163658",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "163658",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": "batch-output"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,471 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -90.5329099821747,
|
||||
"y": -323.84999999999985
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "178876",
|
||||
"name": "outputList",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 103
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1209.0861892268267,
|
||||
"y": -336.84999999999985
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"batch": {
|
||||
"batchEnable": true,
|
||||
"batchSize": 100,
|
||||
"concurrentSize": 10,
|
||||
"inputLists": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "item1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "180671",
|
||||
"name": "item1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "item1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input_from_entry"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1737521813",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{item1}}\nall questions:\n{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"retryTimes": 0,
|
||||
"timeoutMs": 180000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型",
|
||||
"title": "大模型"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "180671",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 342.6734564208258,
|
||||
"y": -363.54999999999984
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"batch": {
|
||||
"batchEnable": true,
|
||||
"batchSize": 100,
|
||||
"concurrentSize": 10,
|
||||
"inputLists": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "180671",
|
||||
"name": "outputList",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 103
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "item1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inputDefs": [
|
||||
{
|
||||
"input": {},
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "178876",
|
||||
"name": "item1.output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"dataOnErr": "{\n \"outputList\": [\n {\n \"output\": []\n }\n ]\n}",
|
||||
"switch": false
|
||||
},
|
||||
"spaceId": "7309328955423670309",
|
||||
"type": 0,
|
||||
"workflowId": "7469707607914217512",
|
||||
"workflowVersion": "v0.0.1"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "文本处理",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false,
|
||||
"title": "text_processing"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "178876",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 775.8798228238263,
|
||||
"y": -337.54999999999984
|
||||
}
|
||||
},
|
||||
"type": "9"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "180671",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "178876",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "180671",
|
||||
"targetNodeID": "178876",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192899",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 993,
|
||||
"y": -12.999999999999986
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String"
|
||||
}
|
||||
],
|
||||
"method": "split",
|
||||
"splitParams": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
"。",
|
||||
","
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "delimiters"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "label",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "isDefault",
|
||||
"required": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "换行",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "制表符",
|
||||
"value": "\t"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "句号",
|
||||
"value": "。"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "逗号",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "分号",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "空格",
|
||||
"value": " "
|
||||
}
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "allDelimiters"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于处理多个字符串类型变量的格式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "文本处理",
|
||||
"title": "文本处理"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "192899",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 491.5,
|
||||
"y": -13.949999999999989
|
||||
}
|
||||
},
|
||||
"type": "15"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "192899",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "192899",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -744.3383265685363,
|
||||
"y": -243.19932319428818
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "code_input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "code_input_2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "model_type",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "code_input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "code_input_2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "model_type",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 717.4514215854077,
|
||||
"y": -243.19932319428818
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "140645",
|
||||
"name": "key0"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "output2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "194114",
|
||||
"name": "log_id"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "194114",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 181.651290527654,
|
||||
"y": -270.5993231942882
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "ImageToolPro",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "ByteArtist:ImageToolPro",
|
||||
"description": "根据用户的描述生成多种风格的图片\n"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7348853341923016714",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "ImageToolPro",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7348853341922983946",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "ByteArtist",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "model_type",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "model_type"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "140645",
|
||||
"name": "key11"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "image_url",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "ImageURL",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "log_id",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "msg",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "code",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "data",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "image_url",
|
||||
"required": false,
|
||||
"description": "生成图片的地址"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "prompt",
|
||||
"required": false,
|
||||
"description": "生成图片的描述"
|
||||
}
|
||||
],
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "140645",
|
||||
"type": "5",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -228.95588048315332,
|
||||
"y": -203.30700572155118
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "代码",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Code-v2.jpg",
|
||||
"description": "编写代码,处理输入变量来生成返回值",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "代码"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "code_input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "input_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "code_input_2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"code": "# 在这里,您可以通过 ‘args’ 获取节点中的输入变量,并通过 'ret' 输出结果\n# 'args' 和 'ret' 已经被正确地注入到环境中\n# 下面是一个示例,首先获取节点的全部输入参数params,其次获取其中参数名为‘input’的值:\n# params = args.params; \n# input = params.input;\n# 下面是一个示例,输出一个包含多种数据类型的 'ret' 对象:\n# ret: Output = { \"name\": ‘小明’, \"hobbies\": [“看书”, “旅游”] };\n\nasync def main(args: Args) -> Output:\n params = args.params\n # 构建输出对象\n ret: Output = {\n \"key0\": params['input'] + params['input'], # 拼接两次入参 input 的值\n \"key11\": params['input'] + params['input'], # 拼接两次入参 input 的值\n \"key1\": [\"hello\", \"world\"]\n }\n return ret",
|
||||
"language": 3,
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "key0"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"name": "key1",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "key11"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "140645"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "194114",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "140645",
|
||||
"targetNodeID": "194114"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -50,
|
||||
"y": -47
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The starting node of the workflow, used to set the information needed to initiate the workflow.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "Start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 973,
|
||||
"y": -116
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The final node of the workflow, used to return the result information after the workflow runs.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "End"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "123065",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 402.4428571428571,
|
||||
"y": -271.6142857142857
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "top_news",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "p1:top_news",
|
||||
"description": "帮助用户获取搜狐网上的每日热闻"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7516515616698662912",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7516515556770447360",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "count",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 12,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "data",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "coze_ark_001",
|
||||
"schema": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "[Array Item]",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "url"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "brief"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "title"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "total"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "message"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"name": "success"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "traceId"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "code"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "123065"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "123065",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 971,
|
||||
"y": -149
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "166612",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 418,
|
||||
"y": -191.5
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_child_3",
|
||||
"description": "3",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7515027249628708864",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "166612"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "166612",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 49,
|
||||
"y": -53
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 739,
|
||||
"y": -104
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -5,
|
||||
"y": -112
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 931,
|
||||
"y": -94
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "155865",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 442,
|
||||
"y": -195
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_child_child_4",
|
||||
"description": "4",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7515027325977624576",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "155865"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "155865",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,926 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 35.2
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The starting node of the workflow, used to set the information needed to initiate the workflow.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "Start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2883.4601226993864,
|
||||
"y": -172.42576687116565
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The final node of the workflow, used to return the result information after the workflow runs.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "End"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "137942",
|
||||
"name": "total"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "137942",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1967.239263803681,
|
||||
"y": -430.7699386503067
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "top_news",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "p1:top_news",
|
||||
"description": "帮助用户获取搜狐网上的每日热闻"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7521710149602377728",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7521710098171822080",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "count",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 1,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "float",
|
||||
"name": "total"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "message"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"name": "success"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "traceId"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "code"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "data",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "coze_ark_001",
|
||||
"schema": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "[Array Item]",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "title"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "url"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "brief"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "139459",
|
||||
"type": "43",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2448.0245398773004,
|
||||
"y": -313.6687116564417
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7522311426006843392"
|
||||
}
|
||||
],
|
||||
"selectParam": {
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v1"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "IS_NOT_NULL"
|
||||
}
|
||||
}
|
||||
},
|
||||
null
|
||||
]
|
||||
],
|
||||
"logic": "AND"
|
||||
},
|
||||
"orderByList": [],
|
||||
"limit": 100,
|
||||
"fieldList": [
|
||||
{
|
||||
"fieldID": 102,
|
||||
"isDistinct": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 60000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "Query Data",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icaon-database-select.jpg",
|
||||
"description": "Query data from the table, and the user can define query conditions, select columns, etc., and output the data that meets the conditions",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "Query Data"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "118229",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1486.4539877300615,
|
||||
"y": -338.180981595092
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "job_recommendation",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "猎聘:job_recommendation",
|
||||
"description": "帮助用户搜索工作招聘,基于用户的工作经验、教育经历、地理位置、薪水、职位名称、工作性质等"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "130001",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "猎聘",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "13",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "猎聘",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "data",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "[Array Item]",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "compIndustry"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "compName"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "compScale"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "compStage"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "dq"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "jobDetailLink"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "recruiterPhoto"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "salary"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "compLogo"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"name": "labels",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "[Array Item]"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "recruiterName"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "title"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "145498",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 556.2944785276075,
|
||||
"y": -140.25644171779138
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "top_news_1",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "p1_copy:top_news",
|
||||
"description": "帮助用户获取搜狐网上的每日热闻"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7521710447641231360",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1_copy",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7521710447590899712",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "p1_copy",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v0.0.1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "count",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 12,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "float",
|
||||
"name": "code"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "data",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "coze_ark_001",
|
||||
"schema": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "[Array Item]",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "title"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "url"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "brief"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "total"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "message"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"name": "success"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "traceId"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "159358",
|
||||
"type": "6",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1038.6625766871166,
|
||||
"y": -279.6564417177914
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "Knowledge retrieval",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeQuery-v2.jpg",
|
||||
"description": "In the selected knowledge, the best matching information is recalled based on the input variable and returned as an Array.",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "Knowledge retrieval"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"datasetParam": [
|
||||
{
|
||||
"name": "datasetList",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
"7522316202157277184"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "topK",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRerank",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRewrite",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isPersonalOnly",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "minScore",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "strategy",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "Query",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "145498"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "139459",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "118229",
|
||||
"targetNodeID": "137942"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "137942",
|
||||
"targetNodeID": "139459"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "159358",
|
||||
"targetNodeID": "118229"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "145498",
|
||||
"targetNodeID": "159358"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 25,
|
||||
"y": -36
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 615,
|
||||
"y": -156
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -135,
|
||||
"y": -63
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1313,
|
||||
"y": 19.25
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "191100",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 634.5,
|
||||
"y": -171
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_1",
|
||||
"description": "1",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7515027150387281920",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "167855",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1026,
|
||||
"y": -240.5
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_2",
|
||||
"description": "2",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7515027182796668928",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "125555",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 243,
|
||||
"y": -258.9
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_child_child_4",
|
||||
"description": "4",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7515027325977624576",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "125555"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "167855",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125555",
|
||||
"targetNodeID": "191100"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "191100",
|
||||
"targetNodeID": "167855"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,394 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -239.17391562719308,
|
||||
"y": -485.2679266746656
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The starting node of the workflow, used to set the information needed to initiate the workflow.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start.png",
|
||||
"subTitle": "",
|
||||
"title": "Start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 726.092034161139,
|
||||
"y": -118.77658977203274
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "The final node of the workflow, used to return the result information after the workflow runs.",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End.png",
|
||||
"subTitle": "",
|
||||
"title": "End"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "140884",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "140884",
|
||||
"type": "3",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 220.85957287256923,
|
||||
"y": -572.3157579290518
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "LLM",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"description": "Invoke the large language model, generate responses using variables and prompt words.",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "LLM"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [],
|
||||
"llmParam": [
|
||||
{
|
||||
"name": "modelType",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "modleName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "generationDiversity",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxTokens",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "responseFormat",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enableChatHistory",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chatHistoryRound",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemPrompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"fcParam": {
|
||||
"pluginFCParam": {
|
||||
"pluginList": [
|
||||
{
|
||||
"plugin_id": "7516515556770447360",
|
||||
"api_id": "7516515616698662912",
|
||||
"api_name": "top_news",
|
||||
"plugin_version": "0",
|
||||
"is_draft": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"knowledgeFCParam": {
|
||||
"knowledgeList": [
|
||||
{
|
||||
"id": "7516515692099665920",
|
||||
"name": "knowv1"
|
||||
}
|
||||
],
|
||||
"global_setting": {
|
||||
"auto": false,
|
||||
"min_score": 0.5,
|
||||
"no_recall_reply_customize_prompt": "抱歉,您的问题超出了我的知识范围,并且无法在当前阶段回答",
|
||||
"no_recall_reply_mode": 0,
|
||||
"show_source": false,
|
||||
"show_source_mode": 0,
|
||||
"top_k": 3,
|
||||
"use_rerank": true,
|
||||
"use_rewrite": true,
|
||||
"use_nl2_sql": true,
|
||||
"search_mode": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "157683",
|
||||
"type": "12",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1043.449575532565,
|
||||
"y": -502.4679266746656
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "SQL Customization",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Database-v2.jpg",
|
||||
"description": "Complete the operations of adding, deleting, modifying and querying the database based on user-defined SQL",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "SQL Customization"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7516516171512807424"
|
||||
}
|
||||
],
|
||||
"sql": "select * from v1;",
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 60000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "150915",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 646.3887080343196,
|
||||
"y": -506.07295576483375
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "child_v1",
|
||||
"description": "123",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7516518409656336384",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "140884"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "157683",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "140884",
|
||||
"targetNodeID": "150915"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "150915",
|
||||
"targetNodeID": "157683"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,561 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 72.2
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2505.909090909091,
|
||||
"y": -189.89090909090908
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "169400",
|
||||
"name": "rowNum"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "122439",
|
||||
"type": "42",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": -59.20000000000002
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7478954112676282405"
|
||||
}
|
||||
],
|
||||
"updateParam": {
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "EQUAL"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 1,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v1"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "EQUAL"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"logic": "AND"
|
||||
},
|
||||
"fieldInfo": [
|
||||
[
|
||||
{
|
||||
"name": "fieldID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1783392627713"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValue",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "修改表中已存在的数据记录,用户指定更新条件和内容来更新数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-update.jpg",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "更新数据",
|
||||
"title": "更新数据"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "125902",
|
||||
"type": "46",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 640,
|
||||
"y": -19.327272727272714
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7478954112676282405"
|
||||
}
|
||||
],
|
||||
"insertParam": {
|
||||
"fieldInfo": [
|
||||
[
|
||||
{
|
||||
"name": "fieldID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1785960530945"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValue",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 123,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"name": "fieldID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1783122026497"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValue",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "新增数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-insert.jpg",
|
||||
"description": "向表添加新数据记录,用户输入数据内容后插入数据库",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "新增数据"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "178557",
|
||||
"type": "43",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1568.6363636363635,
|
||||
"y": -150.27272727272725
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7478954112676282405"
|
||||
}
|
||||
],
|
||||
"selectParam": {
|
||||
"orderByList": [
|
||||
{
|
||||
"fieldID": 1783122026497,
|
||||
"isAsc": false
|
||||
}
|
||||
],
|
||||
"limit": 10,
|
||||
"fieldList": [
|
||||
{
|
||||
"fieldID": 1783122026497,
|
||||
"isDistinct": false
|
||||
},
|
||||
{
|
||||
"fieldID": 1784288924673,
|
||||
"isDistinct": false
|
||||
},
|
||||
{
|
||||
"fieldID": 1783392627713,
|
||||
"isDistinct": false
|
||||
}
|
||||
],
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v1"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "EQUAL"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"logic": "OR"
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 10000,
|
||||
"name": "v3"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "v2"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "查询数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icaon-database-select.jpg",
|
||||
"description": "从表获取数据,用户可定义查询条件、选择列等,输出符合条件的数据",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "查询数据"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "169400",
|
||||
"type": "44",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2037.2727272727273,
|
||||
"y": -175.72727272727272
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7478954112676282405"
|
||||
}
|
||||
],
|
||||
"deleteParam": {
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "EQUAL"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "125902",
|
||||
"name": "rowNum"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"logic": "AND"
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "删除数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-database-delete.jpg",
|
||||
"description": "从表中删除数据记录,用户指定删除条件来删除符合条件的记录",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "删除数据"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "125902"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "169400",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125902",
|
||||
"targetNodeID": "122439"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "122439",
|
||||
"targetNodeID": "178557"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "178557",
|
||||
"targetNodeID": "169400"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
293
backend/domain/workflow/internal/canvas/examples/entry_exit.json
Normal file
293
backend/domain/workflow/internal/canvas/examples/entry_exit.json
Normal file
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "obj",
|
||||
"required": true,
|
||||
"schema": [
|
||||
{
|
||||
"name": "field1",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "arr",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{output}}_{{output_obj.field1}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "",
|
||||
"name": "",
|
||||
"path": [
|
||||
"app_var"
|
||||
],
|
||||
"source": "global_variable_app"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "field1",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"assistType": 10000,
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_obj"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"assistType": 10000,
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj.field1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 116
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_field1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "arr",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_arr"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "literal_value",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "literal_key"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "obj_container_1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "sub_literal",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "obj_container_2"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"type": "object_ref"
|
||||
}
|
||||
},
|
||||
"name": "obj_container"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": "{\"a\": \"b\"}",
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "obj_literal"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": "[1,2]",
|
||||
"rawMeta": {
|
||||
"type": 100
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arr_literal"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "end",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "end"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 559,
|
||||
"y": -13
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"note": "[{\"type\":\"paragraph\",\"children\":[{\"text\":\"this is a comment\",\"type\":\"text\"}]}]",
|
||||
"schemaType": "slate"
|
||||
},
|
||||
"size": {
|
||||
"height": 150,
|
||||
"width": 240
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "117701",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 292.5,
|
||||
"y": 160
|
||||
}
|
||||
},
|
||||
"type": "31"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 323.05,
|
||||
"y": -304.1166666666667
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "156675",
|
||||
"name": "isSuccess",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "198291",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output1"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 344.4333333333333,
|
||||
"y": 178.68333333333334
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"code": "# 在这里,您可以通过 ‘args’ 获取节点中的输入变量,并通过 'ret' 输出结果\n# 'args' 和 'ret' 已经被正确地注入到环境中\n# 下面是一个示例,首先获取节点的全部输入参数params,其次获取其中参数名为‘input’的值:\n# params = args.params; \n# input = params.input;\n# 下面是一个示例,输出一个包含多种数据类型的 'ret' 对象:\n# ret: Output = { \"name\": ‘小明’, \"hobbies\": [“看书”, “旅游”] };\n\nasync def main(args: Args) -> Output:\n params = args.params\n # 构建输出对象\n ret: Output = {\n \"key0\": params['input'] + fn(params['input']), # 拼接两次入参 input 的值\n \"key1\": [\"hello\", \"world\"], # 输出一个数组\n \"key2\": { # 输出一个Object \n \"key21\": \"hi\"\n },\n }\n return ret",
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"language": 3,
|
||||
"settingOnError": {
|
||||
"dataOnErr": "{\n \"key0\": \"\",\n \"key1\": [],\n \"key2\": {\n \"key21\": \"\"\n }\n}",
|
||||
"processType": 3,
|
||||
"retryTimes": 0,
|
||||
"switch": true,
|
||||
"timeoutMs": 60000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "编写代码,处理输入变量来生成返回值",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Code-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "代码",
|
||||
"title": "代码"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "key0",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "key1",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
},
|
||||
{
|
||||
"name": "key2",
|
||||
"schema": [
|
||||
{
|
||||
"name": "key21",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "errorBody",
|
||||
"readonly": true,
|
||||
"schema": [
|
||||
{
|
||||
"name": "errorMessage",
|
||||
"readonly": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "errorCode",
|
||||
"readonly": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "isSuccess",
|
||||
"readonly": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "156675",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 330.91666666666663,
|
||||
"y": -122.33383333333333
|
||||
}
|
||||
},
|
||||
"type": "5"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"concatParams": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "code result: {{String1}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "concatResult"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": ",",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arrayItemConcatChar"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "label",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "isDefault",
|
||||
"required": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "换行",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "制表符",
|
||||
"value": "\t"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "句号",
|
||||
"value": "。"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "逗号",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "分号",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "空格",
|
||||
"value": " "
|
||||
}
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "allArrayItemConcatChars"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "156675",
|
||||
"name": "isSuccess",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String1"
|
||||
}
|
||||
],
|
||||
"method": "concat"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于处理多个字符串类型变量的格式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "文本处理",
|
||||
"title": "文本处理"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "198291",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 761.65,
|
||||
"y": 23.21616666666668
|
||||
}
|
||||
},
|
||||
"type": "15"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "156675",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "156675",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": "default"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "198291",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "156675",
|
||||
"targetNodeID": "198291",
|
||||
"sourcePortID": "branch_error"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 119.72615956319696,
|
||||
"y": -224.00378240856207
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "103929",
|
||||
"name": "name",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "103929",
|
||||
"name": "age",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "age"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 209.3767670011393,
|
||||
"y": 394.57856844750563
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1737521813",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"dataOnErr": "{\n \"name\": \"zhangsan\",\n \"age\": 3\n}",
|
||||
"ext": {
|
||||
"backupLLmParam": "{\"temperature\":1,\"topP\":0.7,\"responseFormat\":2,\"maxTokens\":1024,\"modelName\":\"豆包·工具调用\",\"modelType\":1706077826,\"generationDiversity\":\"default_val\"}"
|
||||
},
|
||||
"processType": 2,
|
||||
"retryTimes": 1,
|
||||
"switch": true,
|
||||
"timeoutMs": 300
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型",
|
||||
"title": "大模型"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "errorBody",
|
||||
"readonly": true,
|
||||
"schema": [
|
||||
{
|
||||
"name": "errorMessage",
|
||||
"readonly": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "errorCode",
|
||||
"readonly": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "isSuccess",
|
||||
"readonly": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "103929",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 190.39267558532714,
|
||||
"y": -61.87783756395649
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "103929",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "103929",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 119.72615956319696,
|
||||
"y": -224.00378240856207
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "103929",
|
||||
"name": "name",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "103929",
|
||||
"name": "age",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "age"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 209.3767670011393,
|
||||
"y": 394.57856844750563
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1737521813",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"dataOnErr": "{\n \"name\": \"zhangsan\",\n \"age\": 3\n}",
|
||||
"ext": {
|
||||
"backupLLmParam": "{\"temperature\":1,\"topP\":0.7,\"responseFormat\":2,\"maxTokens\":1024,\"modelName\":\"豆包·工具调用\",\"modelType\":1706077826,\"generationDiversity\":\"default_val\"}"
|
||||
},
|
||||
"processType": 1,
|
||||
"retryTimes": 1,
|
||||
"switch": false,
|
||||
"timeoutMs": 300
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型",
|
||||
"title": "大模型"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "103929",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 190.39267558532714,
|
||||
"y": -61.87783756395649
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "103929",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "103929",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "128198",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"fcParam": {
|
||||
"workflowFCParam": {
|
||||
"workflowList": [
|
||||
{
|
||||
"is_draft": false,
|
||||
"plugin_id": "7502015065143574543",
|
||||
"plugin_version": "",
|
||||
"workflow_id": "7492075279843737651",
|
||||
"workflow_version": "v0.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1706077826",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "doubao·function_call",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.7",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "topP"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1024",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "use tool whenever possible",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"retryTimes": 0,
|
||||
"timeoutMs": 180000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "llm"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "128198",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 513,
|
||||
"y": -63.5
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "128198",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "128198",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "128198",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"fcParam": {
|
||||
"workflowFCParam": {
|
||||
"workflowList": [
|
||||
{
|
||||
"is_draft": false,
|
||||
"plugin_id": "7502015065143574544",
|
||||
"plugin_version": "",
|
||||
"workflow_id": "7492075279843737652",
|
||||
"workflow_version": "v0.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1706077826",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "doubao·function_call",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.7",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "topP"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1024",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "use tool whenever possible",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"retryTimes": 0,
|
||||
"timeoutMs": 180000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "llm"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "128198",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 513,
|
||||
"y": -63.5
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "128198",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "128198",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{output}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "128198",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"fcParam": {
|
||||
"workflowFCParam": {
|
||||
"workflowList": [
|
||||
{
|
||||
"fc_setting": {
|
||||
"is_draft": false,
|
||||
"plugin_id": "7504134755689087002",
|
||||
"request_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_default": "default_input",
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "input",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"response_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "any_name",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"response_style": {
|
||||
"mode": 0
|
||||
},
|
||||
"workflow_id": "7492615435881709608",
|
||||
"workflow_version": "v0.0.1"
|
||||
},
|
||||
"is_draft": false,
|
||||
"plugin_id": "7504134755689087002",
|
||||
"plugin_version": "",
|
||||
"workflow_id": "7492615435881709608",
|
||||
"workflow_version": "v0.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1706077825",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "doubao·function_call",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.7",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "topP"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1024",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "use tool whenever possible",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"retryTimes": 0,
|
||||
"timeoutMs": 180000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "llm"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "128198",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 513,
|
||||
"y": -63.5
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "128198",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "128198",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{output}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "128198",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"fcParam": {
|
||||
"workflowFCParam": {
|
||||
"workflowList": [
|
||||
{
|
||||
"fc_setting": {
|
||||
"is_draft": false,
|
||||
"plugin_id": "7504134755689087002",
|
||||
"request_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_default": "default_input",
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "input",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"response_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "any_name",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"response_style": {
|
||||
"mode": 0
|
||||
},
|
||||
"workflow_id": "7492615435881709611",
|
||||
"workflow_version": "v0.0.1"
|
||||
},
|
||||
"is_draft": false,
|
||||
"plugin_id": "7504134755689087002",
|
||||
"plugin_version": "",
|
||||
"workflow_id": "7492615435881709611",
|
||||
"workflow_version": "v0.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1706077827",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modelType"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "doubao·function_call",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "modleName"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "generationDiversity"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "temperature"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.7",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "topP"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "responseFormat"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1024",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "maxTokens"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "prompt"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "enableChatHistory"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "chatHistoryRound"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "use tool whenever possible",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "systemPrompt"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"retryTimes": 0,
|
||||
"timeoutMs": 180000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "llm"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "128198",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 513,
|
||||
"y": -63.5
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "128198",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "128198",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input_i",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "input_f",
|
||||
"required": false,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "obj",
|
||||
"required": false,
|
||||
"schema": [
|
||||
{
|
||||
"name": "f1",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"name": "input_i",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "input_f",
|
||||
"required": false,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "obj",
|
||||
"required": false,
|
||||
"schema": [
|
||||
{
|
||||
"name": "f1",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "157838",
|
||||
"name": "Group1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "126533",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "157838",
|
||||
"name": "Group2",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "Group2"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "f1",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "obj"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 844,
|
||||
"y": -57
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"mergeGroups": [
|
||||
{
|
||||
"name": "Group1",
|
||||
"variables": [
|
||||
{
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input_i",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input_f",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Group2",
|
||||
"variables": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj.f1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Group3",
|
||||
"variables": [
|
||||
{
|
||||
"schema": [
|
||||
{
|
||||
"name": "f1",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "variable_aggregate"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "Group1",
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "Group2",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "Group3",
|
||||
"schema": [
|
||||
{
|
||||
"name": "f1",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "157838",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 405.5,
|
||||
"y": -20.15987378972423
|
||||
}
|
||||
},
|
||||
"type": "32"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"concatParams": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{String1}} {{String2}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "concatResult"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": ",",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arrayItemConcatChar"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "label",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "isDefault",
|
||||
"required": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "newline",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "tab",
|
||||
"value": "\t"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "period",
|
||||
"value": "。"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "comma",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "colon",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "space",
|
||||
"value": " "
|
||||
}
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "allArrayItemConcatChars"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input_i",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input_f",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String2"
|
||||
}
|
||||
],
|
||||
"method": "concat"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "text_processor"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "126533",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 415.06249529748254,
|
||||
"y": 242.352768637841
|
||||
}
|
||||
},
|
||||
"type": "15"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "157838",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "126533",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "157838",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "126533",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,663 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": -136,
|
||||
"y": 2
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "this is the streaming output {{any_name}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "188288",
|
||||
"name": "Group1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "any_name"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 1172,
|
||||
"y": -249
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "input",
|
||||
"right": {}
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1706077826",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "modelType",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "doubao·function_call",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "modleName",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "balance",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "generationDiversity",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "1",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "temperature",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": "0.7",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "topP",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "0",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "responseFormat",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "1024",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "maxTokens",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{input}}",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "prompt",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": false,
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "enableChatHistory",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "3",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "chatHistoryRound",
|
||||
"right": {}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "",
|
||||
"dependencies": {
|
||||
"variables": null
|
||||
},
|
||||
"inputMode": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"left": {},
|
||||
"name": "systemPrompt",
|
||||
"right": {}
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"dataOnErr": "{\n \"output\": \"\"\n}",
|
||||
"processType": 1,
|
||||
"switch": false,
|
||||
"timeoutMs": 600000
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "llm"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"input": {},
|
||||
"name": "output",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"settings": null,
|
||||
"version": "3"
|
||||
},
|
||||
"edges": null,
|
||||
"id": "140999",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 443,
|
||||
"y": -179.7
|
||||
}
|
||||
},
|
||||
"type": "3"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"mergeGroups": [
|
||||
{
|
||||
"name": "Group1",
|
||||
"variables": [
|
||||
{
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "133819",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "140999",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "variable aggregator"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "Group1",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "188288",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 954,
|
||||
"y": 66.84999999999997
|
||||
}
|
||||
},
|
||||
"type": "32"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"branches": [
|
||||
{
|
||||
"condition": {
|
||||
"conditions": [
|
||||
{
|
||||
"left": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operator": 3,
|
||||
"right": {
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": 3,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"logic": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "selector"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "182113",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 291,
|
||||
"y": 55.84999999999999
|
||||
}
|
||||
},
|
||||
"type": "8"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"concatParams": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{String1}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "concatResult"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": ",",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arrayItemConcatChar"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "label",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "isDefault",
|
||||
"required": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "newline",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "tab",
|
||||
"value": "\t"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "period",
|
||||
"value": "。"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "comma",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "colon",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "space",
|
||||
"value": " "
|
||||
}
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "allArrayItemConcatChars"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String1"
|
||||
}
|
||||
],
|
||||
"method": "concat"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "text_processor"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "133819",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 554,
|
||||
"y": 361.85
|
||||
}
|
||||
},
|
||||
"type": "15"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "182113",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "188288",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "182113",
|
||||
"targetNodeID": "140999",
|
||||
"sourcePortID": "true"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "140999",
|
||||
"targetNodeID": "188288",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "133819",
|
||||
"targetNodeID": "188288",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "182113",
|
||||
"targetNodeID": "133819",
|
||||
"sourcePortID": "false"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "USER_INPUT",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"defaultValue": "Default",
|
||||
"description": "本次请求绑定的会话,会自动写入消息、会从该会话读对话历史。",
|
||||
"name": "CONVERSATION_NAME",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"settings": null,
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"name": "USER_INPUT",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"description": "本次请求绑定的会话,会自动写入消息、会从该会话读对话历史。",
|
||||
"name": "CONVERSATION_NAME",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"version": ""
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1,
|
||||
"y": 1.4210854715202004e-14
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "the name is {{name}}, age is {{age}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "USER_RESPONSE",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "USER_RESPONSE"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "name",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "age",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "age"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": -12.999999999999986
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"answer_type": "text",
|
||||
"dynamic_option": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "options",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"extra_output": true,
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"limit": 3,
|
||||
"llmParam": {
|
||||
"generationDiversity": "default_val",
|
||||
"maxTokens": 1024,
|
||||
"modelName": "豆包·工具调用",
|
||||
"modelType": 1706077826,
|
||||
"responseFormat": 2,
|
||||
"systemPrompt": "be helpful and kind {{input}}",
|
||||
"temperature": 1,
|
||||
"topP": 0.7
|
||||
},
|
||||
"option_type": "dynamic",
|
||||
"options": [
|
||||
{
|
||||
"name": "北京"
|
||||
},
|
||||
{
|
||||
"name": "上海"
|
||||
}
|
||||
],
|
||||
"question": "{{input}}"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "支持中间向用户提问问题,支持预置选项提问和开放式问题提问两种方式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Direct-Question-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "问答",
|
||||
"title": "问答"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"description": "用户本轮对话输入内容",
|
||||
"name": "USER_RESPONSE",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": true,
|
||||
"type": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "135279",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 448.2344262295082,
|
||||
"y": -51.65409836065572
|
||||
}
|
||||
},
|
||||
"type": "18"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "135279",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "135279",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 169,
|
||||
"y": -320.7
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 713,
|
||||
"y": -289.7
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "end"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "e",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "e"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 236,
|
||||
"y": -246.7
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "t",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 858,
|
||||
"y": -286.7
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "end"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "e",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "e"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "t",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "t"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -399,
|
||||
"y": 11
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "token",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "token",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 30.908450704225352,
|
||||
"y": -91.89552609776305
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "GET",
|
||||
"url": "http://127.0.0.1:8080/bear_auth_no_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "token"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "key2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "BEARER_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v3",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/58bba95700564e5fb21dbd6e00c5a0fc.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776424241&x-signature=agADk8ia79cvDXcfrQ2OhAjuqo8%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled.pdf",
|
||||
"type": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"v1\":{\"basicType\":\"string\"},\"v2\":{\"basicType\":\"string\"},\"v3\":{}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\":\"1\",\n \"v2\":{{block_output_100001.input}}\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "EMPTY"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,460 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -436.21541010770505,
|
||||
"y": -176.54275062137532
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"name": "file",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"name": "file",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -11.108947804473907,
|
||||
"y": -247.61292460646234
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "POST",
|
||||
"url": "http://127.0.0.1:8080/custom_auth_file_body"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "key_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "file_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"key_v1\":{\"basicType\":\"string\"},\"file_v1\":{\"basicType\":\"string\"}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\": \"1\",\n \"v2\": \"{{block_output_100001.json_key}}\"\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "BINARY"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,489 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -491.43827671913834,
|
||||
"y": -110.51541010770507
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_key_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"name": "form_key_v2",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_key_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"name": "form_key_v2",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -35.11888980944491,
|
||||
"y": -177.13082021541013
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "POST",
|
||||
"url": "http://127.0.0.1:8080/custom_auth_form_data_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "key_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_key_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "file_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_key_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"key_v1\":{\"basicType\":\"string\"},\"file_v1\":{\"basicType\":\"string\"}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\": \"1\",\n \"v2\": \"{{block_output_100001.json_key}}\"\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "FORM_DATA"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,465 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -491.43827671913834,
|
||||
"y": -110.51541010770507
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_url_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_url_v2",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_url_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "form_url_v2",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -29.116404308202156,
|
||||
"y": -216.40000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "POST",
|
||||
"url": "http://127.0.0.1:8080/custom_auth_form_url_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "key_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "file_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"key_v1\":{\"basicType\":\"string\"},\"file_v1\":{\"basicType\":\"string\"}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\": \"1\",\n \"v2\": \"{{block_output_100001.json_key}}\"\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "FORM_URLENCODED"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,487 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -399,
|
||||
"y": 11
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "json_key",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "json_key",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -51.92584921292461,
|
||||
"y": -139.91541010770507
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "POST",
|
||||
"url": "http://127.0.0.1:8080/custom_auth_json_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v3",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/58bba95700564e5fb21dbd6e00c5a0fc.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776424241&x-signature=agADk8ia79cvDXcfrQ2OhAjuqo8%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled.pdf",
|
||||
"type": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"v1\":{\"basicType\":\"string\"},\"v2\":{\"basicType\":\"string\"},\"v3\":{}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\": \"1\",\n \"v2\": \"{{block_output_100001.json_key}}\"\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "JSON"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,477 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -399,
|
||||
"y": 11
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 39.3119304059652,
|
||||
"y": -52.279121789560904
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "GET",
|
||||
"url": "http://127.0.0.1:8080/custom_auth_no_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v3",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/58bba95700564e5fb21dbd6e00c5a0fc.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776424241&x-signature=agADk8ia79cvDXcfrQ2OhAjuqo8%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled.pdf",
|
||||
"type": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"v1\":{\"basicType\":\"string\"},\"v2\":{\"basicType\":\"string\"},\"v3\":{}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\":\"1\",\n \"v2\":{{block_output_100001.input}}\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "EMPTY"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,465 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -436.21541010770505,
|
||||
"y": -176.54275062137532
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_key",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "auth_value",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 586.7821043910523,
|
||||
"y": -147.81938690969343
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 51.3169014084507,
|
||||
"y": -250.01391880695945
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "POST",
|
||||
"url": "http://127.0.0.1:8080/http_error"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_key"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "auth_value"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": true,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "key_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "file_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"key_v1\":{\"basicType\":\"string\"},\"file_v1\":{\"basicType\":\"string\"}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "form_url_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\": \"1\",\n \"v2\": \"{{block_output_100001.json_key}}\"\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "EMPTY"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": true,
|
||||
"dataOnErr": "{\n \"body\": \"v1\",\n \"statusCode\": 400,\n \"headers\": \"error_header\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "errorBody",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "errorMessage",
|
||||
"readonly": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "errorCode",
|
||||
"readonly": true
|
||||
}
|
||||
],
|
||||
"readonly": true
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": true,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"v1\",\n \"statusCode\": 400,\n \"headers\": \"error_header\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 139.6613358419567,
|
||||
"y": -44.89266227657572
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "m",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "m1",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "m",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "m1",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": 12.700000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "115927",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "115927",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 640,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "HTTP 请求",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "GET",
|
||||
"url": "http://echo.apifox.com/anything?var={{block_output_100001.input}}&var2={{block_output_100001.m.m1}}"
|
||||
},
|
||||
"body": {
|
||||
"bodyType": "RAW_TEXT",
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
}
|
||||
},
|
||||
"headers": [],
|
||||
"params": [],
|
||||
"auth": {
|
||||
"authType": "BEARER_AUTH",
|
||||
"authData": {
|
||||
"customData": {
|
||||
"addTo": "header"
|
||||
}
|
||||
},
|
||||
"authOpen": false
|
||||
},
|
||||
"setting": {
|
||||
"timeout": 120,
|
||||
"retryTimes": 3
|
||||
},
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "115927"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "115927",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,449 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -399,
|
||||
"y": 11
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v2",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v1",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "h_v2",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 548.3661971830986,
|
||||
"y": -101
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "117004",
|
||||
"name": "body"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "117004",
|
||||
"type": "45",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 9.299502899751452,
|
||||
"y": -102.7
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于发送API请求,从接口返回数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-HTTP.png",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "HTTP 请求",
|
||||
"title": "HTTP 请求"
|
||||
},
|
||||
"inputParameters": [],
|
||||
"inputs": {
|
||||
"apiInfo": {
|
||||
"method": "GET",
|
||||
"url": "http://127.0.0.1:8080/no_auth_no_body\n"
|
||||
},
|
||||
"auth": {
|
||||
"authData": {
|
||||
"bearerTokenData": [
|
||||
{
|
||||
"name": "token",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "vvvvvv",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"customData": {
|
||||
"addTo": "query",
|
||||
"data": [
|
||||
{
|
||||
"name": "Key",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "key2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"authOpen": false,
|
||||
"authType": "CUSTOM_AUTH"
|
||||
},
|
||||
"body": {
|
||||
"bodyData": {
|
||||
"binary": {
|
||||
"fileURL": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/3696c03906ac4ac89363a607c5c92ac8.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776428599&x-signature=lZgxiBlK7BHWykF%2BPVBwYCvJoA4%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled (1).pdf",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData": {
|
||||
"data": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v3",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/58bba95700564e5fb21dbd6e00c5a0fc.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505&x-expires=1776424241&x-signature=agADk8ia79cvDXcfrQ2OhAjuqo8%3D",
|
||||
"rawMeta": {
|
||||
"fileName": "Untitled.pdf",
|
||||
"type": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeMapping": "{\"v1\":{\"basicType\":\"string\"},\"v2\":{\"basicType\":\"string\"},\"v3\":{}}"
|
||||
},
|
||||
"formURLEncoded": [
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"json": "{\n \"v1\":\"1\",\n \"v2\":{{block_output_100001.input}}\n}",
|
||||
"rawText": "{{block_output_100001.input}}"
|
||||
},
|
||||
"bodyType": "EMPTY"
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "h1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "h_v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "h3",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "abc",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "query_v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "query_v2",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v2"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"setting": {
|
||||
"retryTimes": 3,
|
||||
"timeout": 120
|
||||
},
|
||||
"settingOnError": {
|
||||
"switch": false,
|
||||
"dataOnErr": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "body"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "statusCode"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "headers"
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"settingOnErrorIsOpen": false,
|
||||
"settingOnErrorJSON": "{\n \"body\": \"xxxx\",\n \"statusCode\": 0,\n \"headers\": \"\"\n}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "117004"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "117004",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "191011",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "191011",
|
||||
"name": "input_list",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 103
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_list"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 978.9666666666667,
|
||||
"y": -13
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"outputSchema": "[{\"type\":\"object\",\"name\":\"input\",\"schema\":[{\"type\":\"string\",\"name\":\"name\",\"required\":false},{\"type\":\"integer\",\"name\":\"age\",\"required\":false}],\"required\":false},{\"type\":\"list\",\"name\":\"input_list\",\"schema\":{\"type\":\"object\",\"schema\":[{\"type\":\"string\",\"name\":\"name\",\"required\":false},{\"type\":\"integer\",\"name\":\"age\",\"required\":false}]},\"required\":false}]"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "支持中间过程的信息输入",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Input-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "输入",
|
||||
"title": "输入"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"schema": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "input_list",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "191011",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 489.4833333333333,
|
||||
"y": -0.7000000000000028
|
||||
}
|
||||
},
|
||||
"type": "30"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "191011",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "191011",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 13
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "154951",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "154951",
|
||||
"name": "obj.field1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "field1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "float"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "154951",
|
||||
"name": "inputArr",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 102
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "inputArr"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"outputSchema": "[{\"type\":\"string\",\"name\":\"input\",\"required\":false},{\"type\":\"object\",\"name\":\"obj\",\"schema\":[{\"type\":\"string\",\"name\":\"field1\",\"required\":false}],\"required\":false},{\"type\":\"list\",\"name\":\"inputArr\",\"schema\":{\"type\":\"float\"},\"required\":false}]"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Input-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "input",
|
||||
"title": "input"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "obj",
|
||||
"required": false,
|
||||
"schema": [
|
||||
{
|
||||
"name": "field1",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "inputArr",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "float"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "154951",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"defaultCollapsed": false,
|
||||
"position": {
|
||||
"x": 640,
|
||||
"y": 12.299999999999997
|
||||
}
|
||||
},
|
||||
"type": "30"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "154951",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "154951",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -77.18889374023964,
|
||||
"y": -123.60755114231446
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 973.4968298059847,
|
||||
"y": -47.00225168152875
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "float",
|
||||
"name": "v2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "183043",
|
||||
"name": "outputList"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 103
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "number",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "183043",
|
||||
"name": "rowNum"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "141102",
|
||||
"type": "22",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 399.5072203278145,
|
||||
"y": -174.30755114231448
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于用户输入的意图识别,并将其与预设意图选项进行匹配。",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Intent-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "意图识别",
|
||||
"title": "意图识别"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "classificationId"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "reason"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"chatHistorySetting": {
|
||||
"enableChatHistory": false,
|
||||
"chatHistoryRound": 3
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "query",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmParam": {
|
||||
"generationDiversity": "creative",
|
||||
"maxTokens": 4096,
|
||||
"modelName": "豆包·1.5·Lite·32k",
|
||||
"modelType": 1741232583,
|
||||
"prompt": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{query}}"
|
||||
}
|
||||
},
|
||||
"responseFormat": 2,
|
||||
"temperature": 1,
|
||||
"systemPrompt": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": ""
|
||||
}
|
||||
},
|
||||
"enableChatHistory": false,
|
||||
"chatHistoryRound": 3
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"name": "v1"
|
||||
}
|
||||
],
|
||||
"mode": "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "183043",
|
||||
"type": "12",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 952.7581491531417,
|
||||
"y": -245.69813645629364
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "基于用户自定义的 SQL 完成对数据库的增删改查操作",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Database-v2.jpg",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "SQL自定义",
|
||||
"title": "SQL自定义"
|
||||
},
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7478954112676282405"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "141102",
|
||||
"name": "reason"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"sql": "select v2 from v1"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "float",
|
||||
"name": "v2"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "141102"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "183043",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "141102",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": "default"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "141102",
|
||||
"targetNodeID": "183043",
|
||||
"sourcePortID": "branch_0"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
{
|
||||
"nodes": [{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "person",
|
||||
"required": true,
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}],
|
||||
"trigger_parameters": [{
|
||||
"name": "person",
|
||||
"required": true,
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "179566",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "person",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于把变量转化为JSON字符串",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-to_json.png",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "JSON 序列化",
|
||||
"title": "JSON 序列化"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "112049",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 467,
|
||||
"y": -132
|
||||
}
|
||||
},
|
||||
"type": "58"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "112049",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于把JSON字符串转化为变量",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-from_json.png",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "JSON 反序列化",
|
||||
"title": "JSON 反序列化"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "output",
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "179566",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 547,
|
||||
"y": 104
|
||||
}
|
||||
},
|
||||
"type": "59"
|
||||
}],
|
||||
"edges": [{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "112049",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "179566",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "112049",
|
||||
"targetNodeID": "179566",
|
||||
"sourcePortID": ""
|
||||
}],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
{
|
||||
"nodes": [{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "person",
|
||||
"required": true,
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}],
|
||||
"trigger_parameters": [{
|
||||
"name": "person",
|
||||
"required": true,
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"type": "boolean"
|
||||
}, {
|
||||
"name": "string",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "179566",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
}, {
|
||||
"name": "string",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "person",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于把变量转化为JSON字符串",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-to_json.png",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "JSON 序列化",
|
||||
"title": "JSON 序列化"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "output",
|
||||
"type": "string"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "112049",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 467,
|
||||
"y": -132
|
||||
}
|
||||
},
|
||||
"type": "58"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "112049",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于把JSON字符串转化为变量",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-from_json.png",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "JSON 反序列化",
|
||||
"title": "JSON 反序列化"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "output",
|
||||
"schema": [{
|
||||
"name": "int",
|
||||
"type": "boolean"
|
||||
}, {
|
||||
"name": "string",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "bool",
|
||||
"type": "boolean"
|
||||
}],
|
||||
"type": "object"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "179566",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 547,
|
||||
"y": 104
|
||||
}
|
||||
},
|
||||
"type": "59"
|
||||
}],
|
||||
"edges": [{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "112049",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "179566",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "112049",
|
||||
"targetNodeID": "179566",
|
||||
"sourcePortID": ""
|
||||
}],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
427
backend/domain/workflow/internal/canvas/examples/knowledge.json
Normal file
427
backend/domain/workflow/internal/canvas/examples/knowledge.json
Normal file
@@ -0,0 +1,427 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 26.700000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"name": "file",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"assistType": 3,
|
||||
"name": "file",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "v1",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2020,
|
||||
"y": 13.700000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "success",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "102426",
|
||||
"name": "outputList"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 103
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "global_variable_app",
|
||||
"path": [
|
||||
"app_v1"
|
||||
],
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "191672",
|
||||
"type": "27",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "知识库写入",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeWriting-v2.jpg",
|
||||
"description": "写入节点可以添加 文本类型 的知识库,仅可以添加一个知识库",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库写入"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "documentId"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "fileName"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "fileUrl"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "knowledge",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "file"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"datasetParam": [
|
||||
{
|
||||
"name": "datasetList",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
"7480093452068470793"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"strategyParam": {
|
||||
"parsingStrategy": {
|
||||
"parsingType": "accurate",
|
||||
"imageExtraction": true,
|
||||
"tableExtraction": true,
|
||||
"imageOcr": false
|
||||
},
|
||||
"chunkStrategy": {
|
||||
"chunkType": "custom",
|
||||
"separatorType": "\n",
|
||||
"separator": "\n",
|
||||
"maxToken": 800,
|
||||
"overlap": 0.1
|
||||
},
|
||||
"indexStrategy": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "102426",
|
||||
"type": "6",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1560,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "知识库检索",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeQuery-v2.jpg",
|
||||
"description": "在选定的知识中,根据输入变量召回最匹配的信息,并以列表形式返回",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库检索"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"datasetParam": [
|
||||
{
|
||||
"name": "datasetList",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
"7480093452068470793",
|
||||
"7480093452068438025"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "topK",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRerank",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRewrite",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isPersonalOnly",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "minScore",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "strategy",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "Query",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "我想要附近的美食信息",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "116428",
|
||||
"type": "40",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 640,
|
||||
"y": -23.98854337152209
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "变量赋值",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/Variable.jpg",
|
||||
"description": "用于给支持写入的变量赋值,包括应用变量、用户变量",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "变量赋值"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "app_v1",
|
||||
"left": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "global_variable_app",
|
||||
"path": [
|
||||
"app_v1"
|
||||
],
|
||||
"blockID": "",
|
||||
"name": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "v1"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"variableTypeMap": {
|
||||
"app_v1": "global_variable_app"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "isSuccess",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "116428"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "102426",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "116428",
|
||||
"targetNodeID": "191672"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "191672",
|
||||
"targetNodeID": "102426"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"nodes": [{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "196335",
|
||||
"name": "isSuccess",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
}],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"datasetParam": [{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": ["7519861718982361099"],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "datasetList"
|
||||
}, {
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": 0,
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "datasetType"
|
||||
}, {
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [{
|
||||
"name": "datasetID",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "volcanoServiceID",
|
||||
"type": "string"
|
||||
}],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "VolcanoInfoList"
|
||||
}],
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "110594",
|
||||
"name": "documentId",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "documentID"
|
||||
}]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于删除知识库中的文档",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icons-dataset-delete.png",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库删除",
|
||||
"title": "知识库删除"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "isSuccess",
|
||||
"type": "boolean"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "196335",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 484,
|
||||
"y": -388
|
||||
}
|
||||
},
|
||||
"type": "60"
|
||||
}, {
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"actionType": 0,
|
||||
"datasetParam": [{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": ["7519861718982361099"],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "datasetList"
|
||||
}, {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"fileName": ""
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "documentID"
|
||||
}, {
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": 0,
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "datasetType"
|
||||
}, {
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [{
|
||||
"name": "datasetID",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "volcanoServiceID",
|
||||
"type": "string"
|
||||
}],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "VolcanoInfoList"
|
||||
}],
|
||||
"inputParameters": [{
|
||||
"input": {
|
||||
"assistType": 1,
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "https://p26-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/5264fa1295da4a6483cd236b1316c454.pdf~tplv-mdko3gqilj-image.image?rk3s=81d4c505\u0026x-expires=1782379180\u0026x-signature=mlaXPIk9VJjOXu87xGaRmNRg9%2BA%3D\u0026x-wf-file_name=1706.03762v7.pdf",
|
||||
"rawMeta": {
|
||||
"fileName": "1706.03762v7.pdf",
|
||||
"type": 8
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "knowledge"
|
||||
}],
|
||||
"strategyParam": {
|
||||
"chunkStrategy": {
|
||||
"chunkType": "default"
|
||||
},
|
||||
"indexStrategy": {},
|
||||
"parsingStrategy": {
|
||||
"parsingType": "fast"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "写入节点可以添加 文本类型 的知识库,仅可以添加一个知识库",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeWriting-v2.jpg",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库写入",
|
||||
"title": "知识库写入"
|
||||
},
|
||||
"outputs": [{
|
||||
"name": "documentId",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "fileName",
|
||||
"type": "string"
|
||||
}, {
|
||||
"name": "fileUrl",
|
||||
"type": "string"
|
||||
}]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "110594",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 508,
|
||||
"y": -68.5
|
||||
}
|
||||
},
|
||||
"type": "27"
|
||||
}],
|
||||
"edges": [{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "110594",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "196335",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}, {
|
||||
"sourceNodeID": "110594",
|
||||
"targetNodeID": "196335",
|
||||
"sourcePortID": ""
|
||||
}],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,400 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -236,
|
||||
"y": -434
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "开始",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": ""
|
||||
},
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "e",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 712,
|
||||
"y": -434
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "结束",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": ""
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "e"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "120238",
|
||||
"type": "3",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 219,
|
||||
"y": -513.4
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "大模型",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "e"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"name": "modelType",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "modleName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "generationDiversity",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxTokens",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "responseFormat",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enableChatHistory",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chatHistoryRound",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemPrompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "你是一个占卜师",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"fcParam": {
|
||||
"pluginFCParam": {
|
||||
"pluginList": [
|
||||
{
|
||||
"plugin_id": "7509353177339133952",
|
||||
"api_id": "7509353598782816256",
|
||||
"api_name": "xz_zgjm",
|
||||
"plugin_version": "0",
|
||||
"is_draft": false,
|
||||
"fc_setting": {
|
||||
"plugin_id": "7509353177339133952",
|
||||
"api_id": "7509353598782816256",
|
||||
"api_name": "xz_zgjm",
|
||||
"request_params": [
|
||||
{
|
||||
"id": "Js8dCSLqpl",
|
||||
"name": "title",
|
||||
"desc": "查询解梦标题,例如:梦见蛇",
|
||||
"type": 1,
|
||||
"location": 2,
|
||||
"is_required": true,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
},
|
||||
{
|
||||
"id": "byhjWylhTV",
|
||||
"name": "input_string",
|
||||
"desc": "input_string",
|
||||
"type": 1,
|
||||
"location": 2,
|
||||
"is_required": true,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
}
|
||||
],
|
||||
"response_params": [
|
||||
{
|
||||
"id": "v4LbpIna8l",
|
||||
"name": "err_msg",
|
||||
"desc": "错误提示",
|
||||
"type": 1,
|
||||
"location": 3,
|
||||
"is_required": false,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
},
|
||||
{
|
||||
"id": "8b0GUYl7Gb",
|
||||
"name": "data_structural",
|
||||
"desc": "返回数据结构",
|
||||
"type": 4,
|
||||
"location": 3,
|
||||
"is_required": true,
|
||||
"sub_parameters": [
|
||||
{
|
||||
"id": "SnyG0gON9c",
|
||||
"name": "title",
|
||||
"desc": "解梦标题",
|
||||
"type": 1,
|
||||
"location": 3,
|
||||
"is_required": false,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
},
|
||||
{
|
||||
"id": "iZa8hLqUML",
|
||||
"name": "weburl",
|
||||
"desc": "当前内容关联的页面地址",
|
||||
"type": 1,
|
||||
"location": 3,
|
||||
"is_required": false,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
},
|
||||
{
|
||||
"id": "uWcirBuvs-",
|
||||
"name": "content",
|
||||
"desc": "解梦内容",
|
||||
"type": 1,
|
||||
"location": 3,
|
||||
"is_required": false,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
}
|
||||
],
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
},
|
||||
{
|
||||
"id": "eXvWWTrzMa",
|
||||
"name": "data",
|
||||
"desc": "返回数据",
|
||||
"type": 1,
|
||||
"location": 3,
|
||||
"is_required": true,
|
||||
"sub_parameters": null,
|
||||
"global_disable": false,
|
||||
"local_disable": false,
|
||||
"enum_list": null,
|
||||
"enum_var_names": null
|
||||
}
|
||||
],
|
||||
"response_style": {
|
||||
"mode": 0
|
||||
},
|
||||
"is_draft": false,
|
||||
"plugin_version": "0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "120238"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "120238",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,383 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 58,
|
||||
"y": -187.76668701171877
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input_string",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input_string",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 964,
|
||||
"y": -288.7666870117188
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "159950",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "159950",
|
||||
"type": "3",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 471,
|
||||
"y": -410.2666870117188
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "大模型",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input_string"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"name": "modelType",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1737521813",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "modleName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "generationDiversity",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxTokens",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "responseFormat",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enableChatHistory",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chatHistoryRound",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemPrompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "你是一个工具人",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"fcParam": {
|
||||
"workflowFCParam": {
|
||||
"workflowList": [
|
||||
{
|
||||
"plugin_id": "7509121334769795126",
|
||||
"workflow_id": "7509120431183544356",
|
||||
"plugin_version": "",
|
||||
"workflow_version": "v0.0.1",
|
||||
"is_draft": false,
|
||||
"fc_setting": {
|
||||
"is_draft": false,
|
||||
"plugin_id": "7509121334769795126",
|
||||
"request_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": true,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "input_string",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": true,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "input_number",
|
||||
"sub_parameters": [],
|
||||
"type": 3
|
||||
},
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": true,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "input_object",
|
||||
"sub_parameters": [],
|
||||
"type": 4
|
||||
}
|
||||
],
|
||||
"response_params": [
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "output_string",
|
||||
"sub_parameters": [],
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_disable": false,
|
||||
"location": 3,
|
||||
"name": "output_number",
|
||||
"sub_parameters": [],
|
||||
"type": 3
|
||||
},
|
||||
{
|
||||
"assist_type": 0,
|
||||
"desc": "",
|
||||
"enum_list": [],
|
||||
"enum_var_names": [],
|
||||
"global_disable": false,
|
||||
"id": "",
|
||||
"is_required": false,
|
||||
"local_disable": true,
|
||||
"location": 3,
|
||||
"name": "output_object",
|
||||
"sub_parameters": [],
|
||||
"type": 4
|
||||
}
|
||||
],
|
||||
"response_style": {
|
||||
"mode": 0
|
||||
},
|
||||
"workflow_id": "7509120431183544356",
|
||||
"workflow_version": "v0.0.1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "159950"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "159950",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -324.6903950582028,
|
||||
"y": -542.5290216685637
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 582.312213137821,
|
||||
"y": -738.3403723783939
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "132728",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "132728",
|
||||
"type": "3",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 35.30960494179719,
|
||||
"y": -791.7403723783939
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "大模型",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"name": "modelType",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "modleName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "generationDiversity",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxTokens",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "responseFormat",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enableChatHistory",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chatHistoryRound",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemPrompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "你是一个旅游推荐专家,通过用户提出的问题,推荐用户具体城市的旅游景点",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"fcParam": {
|
||||
"knowledgeFCParam": {
|
||||
"knowledgeList": [
|
||||
{
|
||||
"id": "7512369185624686592",
|
||||
"name": "旅游景点"
|
||||
}
|
||||
],
|
||||
"global_setting": {
|
||||
"auto": false,
|
||||
"min_score": 0.5,
|
||||
"no_recall_reply_customize_prompt": "抱歉,您的问题超出了我的知识范围,并且无法在当前阶段回答",
|
||||
"no_recall_reply_mode": 0,
|
||||
"show_source": false,
|
||||
"show_source_mode": 0,
|
||||
"top_k": 3,
|
||||
"use_rerank": true,
|
||||
"use_rewrite": true,
|
||||
"use_nl2_sql": true,
|
||||
"search_mode": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "132728"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "132728",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 137,
|
||||
"y": -336
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input_string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "input_number",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "input_object",
|
||||
"schema": [],
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"trigger_parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input_string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "input_number",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "input_object",
|
||||
"schema": [],
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 571,
|
||||
"y": -232
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output_string",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input_string"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "output_number",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input_number"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "output_object",
|
||||
"input": {
|
||||
"type": "object",
|
||||
"schema": [],
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input_object"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,585 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "query1",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 99,
|
||||
"y": -86.34999999999995
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "variable_out",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "converted",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "converted"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1034,
|
||||
"y": -99.34999999999995
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"left": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "variable",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"right": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于重置循环变量的值,使其下次循环使用重置后的值",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LoopSetVariable-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "设置变量",
|
||||
"title": "设置变量"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "131543",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -149.94166666666666,
|
||||
"y": 128.85000000000002
|
||||
}
|
||||
},
|
||||
"type": "20"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于立即终止当前所在的循环,跳出循环体",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Break-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "终止循环",
|
||||
"title": "终止循环"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "199232",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 820,
|
||||
"y": 33.30000000000001
|
||||
}
|
||||
},
|
||||
"type": "19"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"branches": [
|
||||
{
|
||||
"condition": {
|
||||
"conditions": [
|
||||
{
|
||||
"left": {
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "index",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operator": 14,
|
||||
"right": {
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": 3,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"logic": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"condition": {
|
||||
"conditions": [
|
||||
{
|
||||
"left": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "variable",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operator": 1,
|
||||
"right": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "bb",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"logic": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "连接多个下游分支,若设定的条件成立则仅运行对应的分支,若均不成立则只运行“否则”分支",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Condition-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "选择器",
|
||||
"title": "选择器"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "125542",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 318,
|
||||
"y": 68.00000000000003
|
||||
}
|
||||
},
|
||||
"type": "8"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "用于终止当前循环,执行下次循环",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Continue-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "继续循环",
|
||||
"title": "继续循环"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "185227",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 810,
|
||||
"y": 138.85000000000002
|
||||
}
|
||||
},
|
||||
"type": "29"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"concatParams": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "new_{{String1}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "concatResult"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": ",",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arrayItemConcatChar"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "label",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "isDefault",
|
||||
"required": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": [
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "换行",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "制表符",
|
||||
"value": "\t"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "句号",
|
||||
"value": "。"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "逗号",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "分号",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"isDefault": true,
|
||||
"label": "空格",
|
||||
"value": " "
|
||||
}
|
||||
],
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "allArrayItemConcatChars"
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "variable",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "String1"
|
||||
}
|
||||
],
|
||||
"method": "concat"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于处理多个字符串类型变量的格式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "文本处理",
|
||||
"title": "文本处理"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "121518",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 790.2583333333333,
|
||||
"y": 270.7958333333333
|
||||
}
|
||||
},
|
||||
"type": "15"
|
||||
}
|
||||
],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "query1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"loopCount": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": "10",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"loopType": "array",
|
||||
"variableParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "init",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "variable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "用于通过设定循环次数和逻辑,重复执行一系列任务",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Loop-v2.jpg",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "循环",
|
||||
"title": "循环"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "192046",
|
||||
"name": "variable",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "variable_out"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "121518",
|
||||
"name": "output",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "converted"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "192046",
|
||||
"targetNodeID": "131543",
|
||||
"sourcePortID": "loop-function-inline-output"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "131543",
|
||||
"targetNodeID": "125542",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125542",
|
||||
"targetNodeID": "199232",
|
||||
"sourcePortID": "true"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125542",
|
||||
"targetNodeID": "185227",
|
||||
"sourcePortID": "true_1"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125542",
|
||||
"targetNodeID": "121518",
|
||||
"sourcePortID": "false"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "121518",
|
||||
"targetNodeID": "192046",
|
||||
"sourcePortID": "",
|
||||
"targetPortID": "loop-function-inline-input"
|
||||
}
|
||||
],
|
||||
"id": "192046",
|
||||
"meta": {
|
||||
"canvasPosition": {
|
||||
"x": 208.5,
|
||||
"y": 179.7
|
||||
},
|
||||
"position": {
|
||||
"x": 595,
|
||||
"y": -113.29999999999995
|
||||
}
|
||||
},
|
||||
"type": "21"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "192046",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "192046",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": "loop-output"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2",
|
||||
"batch": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 244.02618657937808,
|
||||
"y": -98.77250409165303
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 831.5057283142389,
|
||||
"y": -141.76759410801964
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 47.64320785597381,
|
||||
"y": -36.02291325695581
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 465.46644844517175,
|
||||
"y": -137.11947626841246
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 35.2
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2020,
|
||||
"y": 22.200000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "198958",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "198958",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": 21.5
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "c2",
|
||||
"description": "c2",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7516826283318181888",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "136894",
|
||||
"type": "43",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1560,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7516826768238444544"
|
||||
}
|
||||
],
|
||||
"selectParam": {
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "IS_NOT_NULL"
|
||||
}
|
||||
}
|
||||
},
|
||||
null
|
||||
]
|
||||
],
|
||||
"logic": "AND"
|
||||
},
|
||||
"orderByList": [],
|
||||
"limit": 100
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "查询数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icaon-database-select.jpg",
|
||||
"description": "从表获取数据,用户可定义查询条件、选择列等,输出符合条件的数据",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "查询数据"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "113678",
|
||||
"type": "6",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 671.4402618657938,
|
||||
"y": -63.62765957446808
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "知识库检索",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeQuery-v2.jpg",
|
||||
"description": "在选定的知识中,根据输入变量召回最匹配的信息,并以列表形式返回",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库检索"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"datasetParam": [
|
||||
{
|
||||
"name": "datasetList",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
"7516826802006786048"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "topK",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRerank",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "useRewrite",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isPersonalOnly",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": true,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "minScore",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "strategy",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "Query",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "113678"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "136894",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "113678",
|
||||
"targetNodeID": "198958"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "198958",
|
||||
"targetNodeID": "136894"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 180,
|
||||
"y": 35.2
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2480,
|
||||
"y": 22.200000000000003
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "175430",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "164736",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 611.063829787234,
|
||||
"y": -7.436170212765955
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "c1",
|
||||
"description": "2",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7516826260387921920",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "175430",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 2020,
|
||||
"y": 21.5
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "c2",
|
||||
"description": "c2",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7516826283318181888",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "146468",
|
||||
"type": "43",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1560,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"inputs": {
|
||||
"databaseInfoList": [
|
||||
{
|
||||
"databaseInfoID": "7516826768238444544"
|
||||
}
|
||||
],
|
||||
"selectParam": {
|
||||
"condition": {
|
||||
"conditionList": [
|
||||
[
|
||||
{
|
||||
"name": "left",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "v2"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "operation",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "IS_NOT_NULL"
|
||||
}
|
||||
}
|
||||
},
|
||||
null
|
||||
]
|
||||
],
|
||||
"logic": "AND"
|
||||
},
|
||||
"orderByList": [],
|
||||
"limit": 100
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "outputList",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "rowNum"
|
||||
}
|
||||
],
|
||||
"nodeMeta": {
|
||||
"title": "查询数据",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icaon-database-select.jpg",
|
||||
"description": "从表获取数据,用户可定义查询条件、选择列等,输出符合条件的数据",
|
||||
"mainColor": "#F2B600",
|
||||
"subTitle": "查询数据"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "165863",
|
||||
"type": "27",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1100,
|
||||
"y": 8.5
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "知识库写入",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-KnowledgeWriting-v2.jpg",
|
||||
"description": "写入节点可以添加 文本类型 的知识库,仅可以添加一个知识库",
|
||||
"mainColor": "#FF811A",
|
||||
"subTitle": "知识库写入"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "documentId"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "fileName"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "fileUrl"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "knowledge",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"assistType": 1,
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "http://pic.fanlv.fun/tos-cn-i-2vw640id5q/1bae997c10aa45cd8244b4d1786b8475.txt~tplv-2vw640id5q-image.image?x-wf-file_name=%E5%8C%97%E4%BA%AC%E6%97%85%E6%B8%B8%E6%99%AF%E7%82%B9.txt",
|
||||
"rawMeta": {
|
||||
"fileName": "北京旅游景点.txt",
|
||||
"type": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"datasetParam": [
|
||||
{
|
||||
"name": "datasetList",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
"7516826802006786048"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"strategyParam": {
|
||||
"parsingStrategy": {
|
||||
"parsingType": "fast"
|
||||
},
|
||||
"chunkStrategy": {
|
||||
"chunkType": "default"
|
||||
},
|
||||
"indexStrategy": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "164736"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "175430",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "164736",
|
||||
"targetNodeID": "165863"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "146468",
|
||||
"targetNodeID": "175430"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "165863",
|
||||
"targetNodeID": "146468"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "107234",
|
||||
"name": "user_name",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "user_name"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "107234",
|
||||
"name": "user_age",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "user_age"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "157915",
|
||||
"name": "nationality",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "nationality"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "157915",
|
||||
"name": "gender",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "gender"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "162226",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "user_input"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1220.420323325635,
|
||||
"y": 33.10958429561201
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"answer_type": "text",
|
||||
"dynamic_option": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "",
|
||||
"name": "",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"extra_output": true,
|
||||
"inputParameters": [],
|
||||
"limit": 3,
|
||||
"llmParam": {
|
||||
"generationDiversity": "balance",
|
||||
"maxTokens": 4096,
|
||||
"modelName": "豆包·1.5·Pro·32k",
|
||||
"modelType": 1737521813,
|
||||
"responseFormat": 2,
|
||||
"systemPrompt": "",
|
||||
"temperature": 0.8
|
||||
},
|
||||
"option_type": "static",
|
||||
"options": [
|
||||
{
|
||||
"name": ""
|
||||
},
|
||||
{
|
||||
"name": ""
|
||||
}
|
||||
],
|
||||
"question": "what's your name and age?"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "支持中间向用户提问问题,支持预置选项提问和开放式问题提问两种方式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Direct-Question-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "问答",
|
||||
"title": "问答"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"description": "用户本轮对话输入内容",
|
||||
"name": "USER_RESPONSE",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "user_name",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "user_age",
|
||||
"required": true,
|
||||
"type": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "107234",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 431.6397228637413,
|
||||
"y": -204
|
||||
}
|
||||
},
|
||||
"type": "18"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"answer_type": "text",
|
||||
"dynamic_option": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "",
|
||||
"name": "",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"extra_output": true,
|
||||
"inputParameters": [],
|
||||
"limit": 3,
|
||||
"llmParam": {
|
||||
"generationDiversity": "balance",
|
||||
"maxTokens": 2200,
|
||||
"modelName": "DeepSeek-R1",
|
||||
"modelType": 1738675233,
|
||||
"responseFormat": 2,
|
||||
"systemPrompt": "",
|
||||
"temperature": 0.8
|
||||
},
|
||||
"option_type": "static",
|
||||
"options": [
|
||||
{
|
||||
"name": ""
|
||||
},
|
||||
{
|
||||
"name": ""
|
||||
}
|
||||
],
|
||||
"question": "what's your nationality and gender?"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "支持中间向用户提问问题,支持预置选项提问和开放式问题提问两种方式",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Direct-Question-v2.jpg",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "问答",
|
||||
"title": "问答_1"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"description": "用户本轮对话输入内容",
|
||||
"name": "USER_RESPONSE",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "nationality",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "gender",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "157915",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 431.6397228637413,
|
||||
"y": 145.10958429561202
|
||||
}
|
||||
},
|
||||
"type": "18"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"outputSchema": "[{\"type\":\"string\",\"name\":\"input\",\"required\":true}]"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "支持中间过程的信息输入",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Input-v2.jpg",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "输入",
|
||||
"title": "输入"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "162226",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 903.7228637413394,
|
||||
"y": -164.5
|
||||
}
|
||||
},
|
||||
"type": "30"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "107234",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "157915",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "157915",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "162226",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "107234",
|
||||
"targetNodeID": "162226",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "start"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "obj",
|
||||
"required": true,
|
||||
"schema": [
|
||||
{
|
||||
"name": "field1",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"name": "arr",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"content": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "{{output}}_{{output_obj.field1}}",
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "",
|
||||
"name": "",
|
||||
"path": [
|
||||
"app_var"
|
||||
],
|
||||
"source": "global_variable_app"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"name": "field1",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"assistType": 10000,
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_obj"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"assistType": 10000,
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "obj.field1",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 116
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_field1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "arr",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "output_arr"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "literal_value",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "literal_key"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [
|
||||
{
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "obj_container_1"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": "sub_literal",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "obj_container_2"
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"type": "object_ref"
|
||||
}
|
||||
},
|
||||
"name": "obj_container"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": [],
|
||||
"type": "object",
|
||||
"value": {
|
||||
"content": "{\"a\": \"b\"}",
|
||||
"rawMeta": {
|
||||
"type": 6
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "obj_literal"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": "[1,2]",
|
||||
"rawMeta": {
|
||||
"type": 100
|
||||
},
|
||||
"type": "literal"
|
||||
}
|
||||
},
|
||||
"name": "arr_literal"
|
||||
}
|
||||
],
|
||||
"streamingOutput": true,
|
||||
"terminatePlan": "useAnswerContent"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"description": "end",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "end"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 559,
|
||||
"y": -13
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"note": "[{\"type\":\"paragraph\",\"children\":[{\"text\":\"this is a comment\",\"type\":\"text\"}]}]",
|
||||
"schemaType": "slate"
|
||||
},
|
||||
"size": {
|
||||
"height": 150,
|
||||
"width": 240
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "117701",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 292.5,
|
||||
"y": 160
|
||||
}
|
||||
},
|
||||
"type": "31"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 67.71685761047468,
|
||||
"y": -139.00163666121114
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 932.7168576104747,
|
||||
"y": -124.33715220949264
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "125662",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 500.2168576104747,
|
||||
"y": -207.00163666121114
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "cc1",
|
||||
"description": "cc1",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7511616004728815618",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "125662"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "125662",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -73,
|
||||
"y": -133
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 592.9579414039315,
|
||||
"y": -197.80451970288303
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "900001"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1360,
|
||||
"y": -206.75
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "167992",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "167992",
|
||||
"type": "15",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 855,
|
||||
"y": -261.1
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "文本处理",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-StrConcat-v2.jpg",
|
||||
"description": "用于处理多个字符串类型变量的格式",
|
||||
"mainColor": "#3071F2",
|
||||
"subTitle": "文本处理"
|
||||
},
|
||||
"inputs": {
|
||||
"method": "concat",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "String1",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"concatParams": [
|
||||
{
|
||||
"name": "concatResult",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{String1}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "arrayItemConcatChar",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": ",",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "allArrayItemConcatChars",
|
||||
"input": {
|
||||
"type": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "label",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "value",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"name": "isDefault",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": [
|
||||
{
|
||||
"label": "Line Break",
|
||||
"value": "\n",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Tab Break",
|
||||
"value": "\t",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Period",
|
||||
"value": "。",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Comma",
|
||||
"value": ",",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Semicolon",
|
||||
"value": ";",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"label": "Space",
|
||||
"value": " ",
|
||||
"isDefault": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "151138",
|
||||
"type": "5",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1289,
|
||||
"y": -504.1
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "代码",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Code-v2.jpg",
|
||||
"description": "编写代码,处理输入变量来生成返回值",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "代码"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "167992",
|
||||
"name": "output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"code": "workflow_code_py_illustrate_all\n\nasync def main(args: Args) -> Output:\n params = args.params\n workflow_code_py_illustrate_output\n ret: Output = {\n \"key0\": params['input'] + params['input'], workflow_code_py_illustrate_output_param\n \"key1\": [\"hello\", \"world\"], workflow_code_py_illustrate_output_arr\n \"key2\": { workflow_code_py_illustrate_output_obj\n \"key21\": \"hi\"\n },\n }\n return ret",
|
||||
"language": 3,
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 60000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "key0"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"name": "key1",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "key2",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "key21"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "148912",
|
||||
"type": "8",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 410,
|
||||
"y": -165.05
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "选择器",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Condition-v2.jpg",
|
||||
"description": "连接多个下游分支,若设定的条件成立则仅运行对应的分支,若均不成立则只运行“否则”分支",
|
||||
"mainColor": "#00B2B2",
|
||||
"subTitle": "选择器"
|
||||
},
|
||||
"inputs": {
|
||||
"branches": [
|
||||
{
|
||||
"condition": {
|
||||
"logic": 2,
|
||||
"conditions": [
|
||||
{
|
||||
"operator": 1,
|
||||
"left": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"right": {
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "123",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "148912"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "167992",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "148912",
|
||||
"targetNodeID": "167992",
|
||||
"sourcePortID": "true"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "167992",
|
||||
"targetNodeID": "151138"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,527 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100001",
|
||||
"type": "1",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -480.76936241417366,
|
||||
"y": -827.3429928800074
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的起始节点,用于设定启动工作流需要的信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Start-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "开始"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "input",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "900001",
|
||||
"type": "2",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1074.4690350659453,
|
||||
"y": -1405.100726522103
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"description": "工作流的最终节点,用于返回工作流运行后的结果信息",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-End-v2.jpg",
|
||||
"subTitle": "",
|
||||
"title": "结束"
|
||||
},
|
||||
"inputs": {
|
||||
"terminatePlan": "returnVariables",
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "output",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "138145",
|
||||
"type": "9",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": -337.08518741667314,
|
||||
"y": -1143.5656083443255
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "c1",
|
||||
"description": "c1",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Workflow-v2.jpg",
|
||||
"isImageflow": false
|
||||
},
|
||||
"inputs": {
|
||||
"workflowId": "7511615200781402118",
|
||||
"spaceId": "666",
|
||||
"workflowVersion": "",
|
||||
"inputDefs": [
|
||||
{
|
||||
"name": "input",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"type": 0,
|
||||
"inputParameters": [],
|
||||
"settingOnError": {}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "162612",
|
||||
"type": "4",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 541.3322143572306,
|
||||
"y": -1280.9656083443256
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "top_news",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-Plugin-v2.jpg",
|
||||
"subtitle": "pl:top_news",
|
||||
"description": "帮助用户获取搜狐网上的每日热闻"
|
||||
},
|
||||
"inputs": {
|
||||
"apiParam": [
|
||||
{
|
||||
"name": "apiID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7511617581250248704",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "apiName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "pl",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginID",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "7511616454588891136",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "pl",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pluginVersion",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tips",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "outDocLink",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "count",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": 12,
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "12",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "traceId"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "code"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"name": "data",
|
||||
"schema": [
|
||||
{
|
||||
"type": "object",
|
||||
"name": "coze_ark_001",
|
||||
"schema": [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "list",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"schema": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "brief"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "title"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "url"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "total"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "message"
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"name": "success"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "199400",
|
||||
"type": "3",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 51.00828691811297,
|
||||
"y": -1320.3134331225874
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "大模型",
|
||||
"icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/dvsmryvd_avi_dvsm/ljhwZthlaukjlkulzlp/icon/icon-LLM-v2.jpg",
|
||||
"description": "调用大语言模型,使用变量和提示词生成回复",
|
||||
"mainColor": "#5C62FF",
|
||||
"subTitle": "大模型"
|
||||
},
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"name": "input",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "ref",
|
||||
"content": {
|
||||
"source": "block-output",
|
||||
"blockID": "100001",
|
||||
"name": "input"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"llmParam": [
|
||||
{
|
||||
"name": "modelType",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "1",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "modleName",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "豆包·1.5·Pro·32k",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "generationDiversity",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "balance",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"input": {
|
||||
"type": "float",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "0.8",
|
||||
"rawMeta": {
|
||||
"type": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxTokens",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "4096",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "responseFormat",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "2",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "{{input}}",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "enableChatHistory",
|
||||
"input": {
|
||||
"type": "boolean",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": false,
|
||||
"rawMeta": {
|
||||
"type": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chatHistoryRound",
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "3",
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "systemPrompt",
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"type": "literal",
|
||||
"content": "you are go coder",
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"fcParam": {
|
||||
"pluginFCParam": {
|
||||
"pluginList": [
|
||||
{
|
||||
"plugin_id": "7511616454588891136",
|
||||
"api_id": "7511617581250248704",
|
||||
"api_name": "top_news",
|
||||
"plugin_version": "0",
|
||||
"is_draft": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"settingOnError": {
|
||||
"processType": 1,
|
||||
"timeoutMs": 180000,
|
||||
"retryTimes": 0
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "output"
|
||||
}
|
||||
],
|
||||
"version": "3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "138145"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "162612",
|
||||
"targetNodeID": "900001"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "138145",
|
||||
"targetNodeID": "199400"
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "199400",
|
||||
"targetNodeID": "162612"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"nodeMeta": {
|
||||
"title": "entry"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "input",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list"
|
||||
}
|
||||
],
|
||||
"trigger_parameters": []
|
||||
},
|
||||
"edges": null,
|
||||
"id": "100001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1,
|
||||
"y": 1.4210854715202004e-14
|
||||
}
|
||||
},
|
||||
"type": "1"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "USER_RESPONSE",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "USER_RESPONSE"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "name",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 1
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"type": "integer",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "135279",
|
||||
"name": "age",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 2
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "age"
|
||||
}
|
||||
],
|
||||
"terminatePlan": "returnVariables"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "exit"
|
||||
}
|
||||
},
|
||||
"edges": null,
|
||||
"id": "900001",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": -12.999999999999986
|
||||
}
|
||||
},
|
||||
"type": "2"
|
||||
},
|
||||
{
|
||||
"blocks": [],
|
||||
"data": {
|
||||
"inputs": {
|
||||
"answer_type": "text",
|
||||
"dynamic_option": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "list",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "options",
|
||||
"source": "block-output"
|
||||
},
|
||||
"rawMeta": {
|
||||
"type": 99
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"extra_output": true,
|
||||
"inputParameters": [
|
||||
{
|
||||
"input": {
|
||||
"type": "string",
|
||||
"value": {
|
||||
"content": {
|
||||
"blockID": "100001",
|
||||
"name": "input",
|
||||
"source": "block-output"
|
||||
},
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
"limit": 3,
|
||||
"llmParam": {
|
||||
"generationDiversity": "default_val",
|
||||
"maxTokens": 1024,
|
||||
"modelName": "doubao function calling",
|
||||
"modelType": 1706077826,
|
||||
"responseFormat": 2,
|
||||
"systemPrompt": "be helpful and kind",
|
||||
"temperature": 1,
|
||||
"topP": 0.7
|
||||
},
|
||||
"option_type": "dynamic",
|
||||
"options": [
|
||||
{
|
||||
"name": "beijing"
|
||||
},
|
||||
{
|
||||
"name": "shanghai"
|
||||
}
|
||||
],
|
||||
"question": "{{input}}"
|
||||
},
|
||||
"nodeMeta": {
|
||||
"title": "qa"
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "USER_RESPONSE",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "age",
|
||||
"required": true,
|
||||
"type": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": null,
|
||||
"id": "135279",
|
||||
"meta": {
|
||||
"position": {
|
||||
"x": 525,
|
||||
"y": -91.19999999999999
|
||||
}
|
||||
},
|
||||
"type": "18"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"sourceNodeID": "100001",
|
||||
"targetNodeID": "135279",
|
||||
"sourcePortID": ""
|
||||
},
|
||||
{
|
||||
"sourceNodeID": "135279",
|
||||
"targetNodeID": "900001",
|
||||
"sourcePortID": ""
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"loop": "v2"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user