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:
Zhj
2025-08-28 21:53:32 +08:00
committed by GitHub
parent bbc615a18e
commit d70101c979
503 changed files with 48036 additions and 3427 deletions

View File

@@ -57,6 +57,7 @@ var path2Table2Columns2Model = map[string]map[string]map[string]any{
"background_image_info_list": []*bot_common.BackgroundImageInfo{},
"database_config": []*bot_common.Database{},
"shortcut_command": []string{},
"layout_info": &bot_common.LayoutInfo{},
},
"single_agent_version": {
// "variable": []*bot_common.Variable{},
@@ -71,6 +72,7 @@ var path2Table2Columns2Model = map[string]map[string]map[string]any{
"background_image_info_list": []*bot_common.BackgroundImageInfo{},
"database_config": []*bot_common.Database{},
"shortcut_command": []string{},
"layout_info": &bot_common.LayoutInfo{},
},
"single_agent_publish": {
"connector_ids": []int64{},
@@ -154,6 +156,17 @@ var path2Table2Columns2Model = map[string]map[string]map[string]any{
"node_execution": {},
"workflow_snapshot": {},
"connector_workflow_version": {},
"chat_flow_role_config": {},
"app_conversation_template_draft": {},
"app_conversation_template_online": {},
"app_static_conversation_draft": {},
"app_static_conversation_online": {},
"app_dynamic_conversation_draft": {},
"app_dynamic_conversation_online": {},
},
"domain/openauth/openapiauth/internal/dal/query": {
@@ -191,6 +204,9 @@ var path2Table2Columns2Model = map[string]map[string]map[string]any{
"publish_config": appEntity.PublishConfig{},
},
},
"domain/upload/internal/dal/query": {
"files": {},
},
}
var fieldNullablePath = map[string]bool{

View File

@@ -35,9 +35,31 @@ const (
ErrConversationMessageNotFound = 103200001
ErrAgentRun = 103200002
ErrRecordNotFound = 103200003
ErrAgentRunWorkflowNotFound = 103200004
ErrInProgressCanNotCancel = 103200005
)
func init() {
code.Register(
ErrInProgressCanNotCancel,
"in progress can not be cancelled",
code.WithAffectStability(false),
)
code.Register(
ErrAgentRunWorkflowNotFound,
"The chatflow is not configured. Please configure it and try again.",
code.WithAffectStability(false),
)
code.Register(
ErrRecordNotFound,
"record not found or nothing to update",
code.WithAffectStability(false),
)
code.Register(
ErrAgentRun,
"Interal Server Error",

View File

@@ -22,25 +22,34 @@ import (
)
const (
ErrWorkflowNotPublished = 720702011
ErrMissingRequiredParam = 720702002
ErrInterruptNotSupported = 720702078
ErrInvalidParameter = 720702001
ErrArrIndexOutOfRange = 720712014
ErrWorkflowExecuteFail = 720701013
ErrCodeExecuteFail = 305000002
ErrQuestionOptionsEmpty = 720712049
ErrNodeOutputParseFail = 720712023
ErrWorkflowTimeout = 720702085
ErrWorkflowNotFound = 720702004
ErrSerializationDeserializationFail = 720701011
ErrInternalBadRequest = 720701007
ErrSchemaConversionFail = 720702089
ErrWorkflowCompileFail = 720701003
ErrPluginAPIErr = 720701004
ErrWorkflowNotPublished = 720702011
ErrMissingRequiredParam = 720702002
ErrInterruptNotSupported = 720702078
ErrInvalidParameter = 720702001
ErrArrIndexOutOfRange = 720712014
ErrWorkflowExecuteFail = 720701013
ErrCodeExecuteFail = 305000002
ErrQuestionOptionsEmpty = 720712049
ErrNodeOutputParseFail = 720712023
ErrWorkflowTimeout = 720702085
ErrWorkflowNotFound = 720702004
ErrSerializationDeserializationFail = 720701011
ErrInternalBadRequest = 720701007
ErrSchemaConversionFail = 720702089
ErrWorkflowCompileFail = 720701003
ErrPluginAPIErr = 720701004
ErrConversationNameIsDuplicated = 720702200
ErrConversationOfAppNotFound = 720702201
ErrConversationNodeInvalidOperation = 720702250
ErrOnlyDefaultConversationAllowInAgentScenario = 720712033
ErrConversationNodesNotAvailable = 702093204
)
const (
ErrConversationNodeOperationFail = 777777782
ErrMessageNodeOperationFail = 777777781
ErrChatFlowRoleOperationFail = 777777780
ErrConversationOfAppOperationFail = 777777779
ErrWorkflowSpecifiedVersionNotFound = 777777778
ErrWorkflowCanceledByUser = 777777777
ErrNodeTimeout = 777777776
@@ -57,6 +66,7 @@ const (
ErrAuthorizationRequired = 777777765
ErrVariablesAPIFail = 777777764
ErrInputFieldMissing = 777777763
ErrConversationNotFoundForOperation = 777777762
)
// stability problems
@@ -122,6 +132,24 @@ func init() {
code.WithAffectStability(false),
)
code.Register(
ErrChatFlowRoleOperationFail,
"ChatFlowRole operation failure: {cause}",
code.WithAffectStability(false),
)
code.Register(
ErrMessageNodeOperationFail,
"Message node operation failure: {cause}",
code.WithAffectStability(false),
)
code.Register(
ErrConversationNodeOperationFail,
"Conversation node operation failure: {cause}",
code.WithAffectStability(false),
)
code.Register(
ErrCodeExecuteFail,
"Function execution failed, please check the code of the function. Detail: {detail}",
@@ -146,6 +174,12 @@ func init() {
code.WithAffectStability(false),
)
code.Register(
ErrConversationOfAppOperationFail,
"Conversation management operation failure: {cause}",
code.WithAffectStability(false),
)
code.Register(
ErrNodeTimeout,
"node timeout",
@@ -192,6 +226,12 @@ func init() {
code.WithAffectStability(false),
)
code.Register(
ErrConversationOfAppNotFound,
"conversation not found, please check if the application conversation exists",
code.WithAffectStability(false),
)
code.Register(
ErrSerializationDeserializationFail,
"data serialization/deserialization fail, please contact support team",
@@ -240,6 +280,12 @@ func init() {
code.WithAffectStability(false),
)
code.Register(
ErrConversationNameIsDuplicated,
"conversation name {name} is duplicated",
code.WithAffectStability(false),
)
code.Register(
ErrPluginIDNotFound,
"plugin {id} not found",
@@ -275,6 +321,31 @@ func init() {
"input field {name} not found",
code.WithAffectStability(false),
)
code.Register(
ErrConversationNotFoundForOperation,
"Conversation not found. Please create a conversation before attempting to perform any related operations.",
code.WithAffectStability(false),
)
code.Register(
ErrConversationNodesNotAvailable,
"Conversation nodes are unavailable in agent scenarios and require an app binding.",
code.WithAffectStability(false),
)
code.Register(
ErrConversationNodeInvalidOperation,
"Only conversation created through nodes are allowed to be modified or deleted.",
code.WithAffectStability(false),
)
code.Register(
ErrOnlyDefaultConversationAllowInAgentScenario,
"Only default conversation allow in agent scenario",
code.WithAffectStability(false),
)
}
var errnoMap = map[int]int{