feat: Support for Chat Flow & Agent Support for binding a single chat flow (#765)
Co-authored-by: Yu Yang <72337138+tomasyu985@users.noreply.github.com> Co-authored-by: zengxiaohui <csu.zengxiaohui@gmail.com> Co-authored-by: lijunwen.gigoo <lijunwen.gigoo@bytedance.com> Co-authored-by: lvxinyu.1117 <lvxinyu.1117@bytedance.com> Co-authored-by: liuyunchao.0510 <liuyunchao.0510@bytedance.com> Co-authored-by: haozhenfei <37089575+haozhenfei@users.noreply.github.com> Co-authored-by: July <jiangxujin@bytedance.com> Co-authored-by: tecvan-fe <fanwenjie.fe@bytedance.com>
This commit is contained in:
@@ -38,19 +38,47 @@ type Workflow interface {
|
||||
allInterruptEvents map[string]*workflowEntity.ToolInterruptEvent) einoCompose.Option
|
||||
ReleaseApplicationWorkflows(ctx context.Context, appID int64, config *ReleaseWorkflowConfig) ([]*vo.ValidateIssue, error)
|
||||
GetWorkflowIDsByAppID(ctx context.Context, appID int64) ([]int64, error)
|
||||
|
||||
SyncExecuteWorkflow(ctx context.Context, config workflowModel.ExecuteConfig, input map[string]any) (*workflowEntity.WorkflowExecution, vo.TerminatePlan, error)
|
||||
StreamExecute(ctx context.Context, config workflowModel.ExecuteConfig, input map[string]any) (*schema.StreamReader[*workflowEntity.Message], error)
|
||||
WithExecuteConfig(cfg workflowModel.ExecuteConfig) einoCompose.Option
|
||||
WithMessagePipe() (compose.Option, *schema.StreamReader[*entity.Message], func())
|
||||
StreamResume(ctx context.Context, req *entity.ResumeRequest, config workflowModel.ExecuteConfig) (*schema.StreamReader[*entity.Message], error)
|
||||
InitApplicationDefaultConversationTemplate(ctx context.Context, spaceID int64, appID int64, userID int64) error
|
||||
}
|
||||
|
||||
type ExecuteConfig = workflowModel.ExecuteConfig
|
||||
type ExecuteMode = workflowModel.ExecuteMode
|
||||
type NodeType = entity.NodeType
|
||||
|
||||
type WorkflowMessage = entity.Message
|
||||
type WorkflowMessage = workflowEntity.Message
|
||||
|
||||
type StateMessage = workflowEntity.StateMessage
|
||||
|
||||
type NodeType = entity.NodeType
|
||||
type MessageType = entity.MessageType
|
||||
type InterruptEvent = workflowEntity.InterruptEvent
|
||||
type EventType = workflowEntity.InterruptEventType
|
||||
type ResumeRequest = entity.ResumeRequest
|
||||
type WorkflowExecuteStatus = entity.WorkflowExecuteStatus
|
||||
|
||||
const (
|
||||
WorkflowRunning = WorkflowExecuteStatus(entity.WorkflowRunning)
|
||||
WorkflowSuccess = WorkflowExecuteStatus(entity.WorkflowSuccess)
|
||||
WorkflowFailed = WorkflowExecuteStatus(entity.WorkflowFailed)
|
||||
WorkflowCancel = WorkflowExecuteStatus(entity.WorkflowCancel)
|
||||
WorkflowInterrupted = WorkflowExecuteStatus(entity.WorkflowInterrupted)
|
||||
)
|
||||
|
||||
const (
|
||||
Answer MessageType = "answer"
|
||||
FunctionCall MessageType = "function_call"
|
||||
ToolResponse MessageType = "tool_response"
|
||||
)
|
||||
|
||||
const (
|
||||
NodeTypeOutputEmitter NodeType = "OutputEmitter"
|
||||
NodeTypeInputReceiver NodeType = "InputReceiver"
|
||||
NodeTypeQuestion NodeType = "QuestionAnswer"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -61,6 +89,14 @@ const (
|
||||
|
||||
type TaskType = workflowModel.TaskType
|
||||
|
||||
type SyncPattern = workflowModel.SyncPattern
|
||||
|
||||
const (
|
||||
SyncPatternSync SyncPattern = "sync"
|
||||
SyncPatternAsync SyncPattern = "async"
|
||||
SyncPatternStream SyncPattern = "stream"
|
||||
)
|
||||
|
||||
const (
|
||||
TaskTypeForeground TaskType = "foreground"
|
||||
TaskTypeBackground TaskType = "background"
|
||||
@@ -73,6 +109,14 @@ const (
|
||||
BizTypeWorkflow BizType = "workflow"
|
||||
)
|
||||
|
||||
type Locator = workflowModel.Locator
|
||||
|
||||
const (
|
||||
FromDraft Locator = iota
|
||||
FromSpecificVersion
|
||||
FromLatestVersion
|
||||
)
|
||||
|
||||
type ReleaseWorkflowConfig = vo.ReleaseWorkflowConfig
|
||||
|
||||
type ToolInterruptEvent = workflowEntity.ToolInterruptEvent
|
||||
|
||||
Reference in New Issue
Block a user