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

@@ -32,11 +32,12 @@ struct UploadFileOpenResponse {
}
struct File{
1: string URI (api.body = "uri"), // 文件URI
2: i64 Bytes (api.body = "bytes"), // 文件字节数
3: i64 CreatedAt (agw.key = "created_at"), // 上传时间戳单位s
4: string FileName (api.body = "file_name"), // 文件名
1: string URI (api.body = "uri"), // URI
2: i64 Bytes (api.body = "bytes"), // bytes
3: i64 CreatedAt (agw.key = "created_at"), // create at
4: string FileName (api.body = "file_name"), // file name
5: string URL (api.body = "url")
6: string ID (api.body = "id")
}
// resp
@@ -46,11 +47,62 @@ struct GetBotOnlineInfoResp {
3: required bot_common.OpenAPIBotInfo data
}
struct WorkspacePermission {
1: list<string> workspace_id_list
2: list<string> permission_list
}
struct AccountPermission {
1: list<string> permission_list
}
struct Scope {
1: WorkspacePermission workspace_permission
2: AccountPermission account_permission
}
struct ImpersonateCozeUserRequest {
1: i64 duration_seconds
2: Scope scope
}
struct ImpersonateCozeUserResponse {
1: required i32 code
2: required string msg
3: ImpersonateCozeUserResponseData data
}
struct ImpersonateCozeUserResponseData {
1: required string access_token
2: required i64 expires_in
3: required string token_type
}
struct OpenGetBotInfoRequest {
1: i64 bot_id (api.js_conv="true", agw.js_conv="str", agw.cli_conv="str",api.path = "bot_id")
2: optional bool is_published (api.query = "is_published")
3: optional i64 connector_id (api.query = "connector_id", api.js_conv="true")
255: optional base.Base Base (api.none="true")
}
struct OpenGetBotInfoResponse {
1: bot_common.OpenAPIBotInfo data
253: i64 code
254: string msg
255: optional base.BaseResp BaseResp
}
service BotOpenApiService {
OauthAuthorizationCodeResp OauthAuthorizationCode(1: OauthAuthorizationCodeReq request)(api.get='/api/oauth/authorization_code', api.category="oauth", api.gen_path="oauth")
//openapi
GetBotOnlineInfoResp GetBotOnlineInfo(1: GetBotOnlineInfoReq request)(api.get='/v1/bot/get_online_info', api.category="bot", api.tag="openapi", api.gen_path="personal_api")
OpenGetBotInfoResponse OpenGetBotInfo(1: OpenGetBotInfoRequest request)(api.get='/v1/bots/:bot_id', api.category="bot", api.tag="openapi", agw.preserve_base="true")
ImpersonateCozeUserResponse ImpersonateCozeUser (1: ImpersonateCozeUserRequest request) (api.post="/api/permission_api/coze_web_app/impersonate_coze_user")
// File related OpenAPI
UploadFileOpenResponse UploadFileOpen(1: UploadFileOpenRequest request)(api.post = "/v1/files/upload", api.category="file", api.tag="openapi", agw.preserve_base="true")
}

View File

@@ -90,4 +90,27 @@ struct Space {
2: i64 owner_id,
3: SpaceStatus status,
4: string name,
}
}
typedef string VariableType
const VariableType VariableTypeKVVariable = 'KVVariable'
const VariableType VariableTypeListVariable = 'ListVariable'
typedef string VariableChannel
const VariableChannel VariableChannelCustom = 'custom'
const VariableChannel VariableChannelSystem = 'system'
const VariableChannel VariableChannelLocation = 'location'
const VariableChannel VariableChannelFeishu = 'feishu'
const VariableChannel VariableChannelAPP = 'app'
struct Variable {
1: string keyword,
2: string default_value,
3: VariableType variable_type,
4: VariableChannel channel,
5: string description,
6: bool enable,
7: bool prompt_enable,
}

View File

@@ -26,6 +26,11 @@ service IntelligenceService {
publish.PublishProjectResponse PublishProject(1: publish.PublishProjectRequest request)(api.post='/api/intelligence_api/publish/publish_project', api.category="publish",agw.preserve_base="true")
publish.GetPublishRecordListResponse GetPublishRecordList(1: publish.GetPublishRecordListRequest request)(api.post='/api/intelligence_api/publish/publish_record_list', api.category="publish",agw.preserve_base="true")
publish.GetPublishRecordDetailResponse GetPublishRecordDetail(1: publish.GetPublishRecordDetailRequest request)(api.post='/api/intelligence_api/publish/publish_record_detail', api.category="publish",agw.preserve_base="true")
// OpenAPI
project.GetOnlineAppDataResponse GetOnlineAppData(1: project.GetOnlineAppDataRequest request) (api.get='/v1/apps/:app_id', api.category="publish")
}

View File

@@ -87,4 +87,29 @@ struct DraftProjectCopyResponseData {
1 : intelligence_common_struct.IntelligenceBasicInfo basic_info
2 : common_struct.AuditData audit_data
3 : common_struct.User user_info
}
}
struct GetOnlineAppDataRequest {
1: optional i64 app_id (api.path="app_id" api.js_conv="true")
2: optional i64 connector_id (api.js_conv="true")
255: optional base.Base Base
}
struct AppData {
1: string app_id
2: string version
3: string name
4: string description
5: string icon_url
6: list<common_struct.Variable> variables
}
struct GetOnlineAppDataResponse {
1 : optional i32 Code (api.body = "code")
2 : optional string Message (api.body = "message")
3 : AppData Data (api.body = "data")
255: base.BaseResp BaseResp
}

View File

@@ -5,4 +5,5 @@ namespace go conversation.agentrun
service AgentRunService {
run.AgentRunResponse AgentRun(1: run.AgentRunRequest request)(api.post='/api/conversation/chat', api.category="conversation", api.gen_path= "agent_run")
run.ChatV3Response ChatV3(1: run.ChatV3Request request)(api.post = "/v3/chat", api.category="chat", api.tag="openapi", api.gen_path="chat")
run.CancelChatApiResponse CancelChatApi(1: run.CancelChatApiRequest request) (api.post = '/v3/chat/cancel', api.category = "chat", api.tag="openapi", agw.preserve_base = "true")
}

View File

@@ -12,4 +12,5 @@ enum Scene{
PromptOptimize = 7, //Prompt optimization
GenerateAgentInfo = 8 // Createbot's nl2bot features
SceneOpenApi = 9, //openapi
SceneWorkflow = 50 , // workflow
}

View File

@@ -36,6 +36,7 @@ struct ConversationData {
5: optional i64 ConnectorID (api.body = "connector_id", agw.key="connector_id", api.js_conv="true")
6: optional i64 LastSectionID (api.body="last_section_id", api.js_conv="true")
7: optional i64 AccountID (api.body = "account_id")
8: optional string Name (api.body = "name")
}
struct CreateConversationRequest {
@@ -92,3 +93,28 @@ struct ListConversationData {
2 : bool has_more (api.body = "has_more", agw.key = "has_more")
}
struct UpdateConversationApiRequest {
1: optional i64 ConversationID (api.path= "conversation_id", agw.js_conv="str", api.js_conv="true")
2: optional string Name (api.body = "name")
255: base.Base Base
}
struct UpdateConversationApiResponse {
1: optional ConversationData ConversationData (api.body = "data", agw.key = "data")
2 : i32 Code (api.body = "code")
3 : string Msg (api.body = "msg")
255: required base.BaseResp BaseResp
}
struct DeleteConversationApiRequest {
1: optional i64 ConversationID (api.path="conversation_id", agw.js_conv="true")
255: base.Base Base
}
struct DeleteConversationApiResponse {
1 : i32 Code (api.body = "code")
2 : string Msg (api.body = "msg")
255: base.BaseResp BaseResp
}

View File

@@ -10,5 +10,6 @@ service ConversationService {
conversation.ClearConversationApiResponse ClearConversationApi(1: conversation.ClearConversationApiRequest req)(api.post='/v1/conversations/:conversation_id/clear', api.category="conversation", api.tag="openapi", agw.preserve_base="true")
conversation.ListConversationsApiResponse ListConversationsApi(1: conversation.ListConversationsApiRequest request) (api.get = '/v1/conversations', api.category = "conversation", api.tag="openapi", agw.preserve_base = "true")
conversation.UpdateConversationApiResponse UpdateConversationApi(1: conversation.UpdateConversationApiRequest request) (api.put = '/v1/conversations/:conversation_id', api.category = "conversation", api.tag="openapi", agw.preserve_base = "true")
conversation.DeleteConversationApiResponse DeleteConversationApi(1: conversation.DeleteConversationApiRequest req)(api.delete='/v1/conversations/:conversation_id', api.category="conversation", api.tag="openapi", agw.preserve_base="true")
}

View File

@@ -214,4 +214,6 @@ struct ListMessageApiResponse {
2: optional bool has_more (api.body = "has_more") // Is there still data, true yes, false no
3: optional i64 first_id (api.body = "first_id",api.js_conv='true') // The ID of the first piece of data
4: optional i64 last_id (api.body = "last_id",api.js_conv='true') // The id of the last piece of data.
253: i64 code
254: string msg
}

View File

@@ -79,6 +79,7 @@ struct AdditionalContent {
1: required string type
2: optional string text
3: optional string file_url
4: optional i64 file_id (api.js_conv='true')
}
struct AgentRunRequest {
@@ -241,4 +242,15 @@ struct ChatV3Response {
1: optional ChatV3ChatDetail ChatDetail (api.body = "data"),
2: required i32 Code (api.body = "code"),
3: required string Msg (api.body = "msg")
}
struct CancelChatApiRequest {
1: required i64 ChatID (api.body = "chat_id", agw.key = "chat_id",api.js_conv='true')
2: required i64 ConversationID (api.body = "conversation_id", agw.key = "conversation_id",api.js_conv='true')
255: base.Base Base
}
struct CancelChatApiResponse {
1: ChatV3ChatDetail ChatV3ChatDetail (agw.key = "data")
255: base.BaseResp BaseResp
}

View File

@@ -447,13 +447,6 @@ struct GetFileUrlsResponse {
255: base.BaseResp BaseResp
}
struct File{
1: string URI (api.body = "uri"), // File URI
2: i64 Bytes (api.body = "bytes"), // file bytes
3: i64 CreatedAt (agw.key = "created_at"), // Upload timestamp in s
4: string FileName (api.body = "file_name"), // file name
5: string URL (api.body = "url")
}
service PlaygroundService {

View File

@@ -137,7 +137,10 @@ enum NodeType{
Input = 30,
Batch = 28,
Continue = 29,
MessageList = 37,
AssignVariable = 40,
ConversationList = 53,
CreateMessage = 55,
JsonSerialization = 58,
JsonDeserialization = 59,
DatasetDelete = 60,
@@ -172,11 +175,14 @@ enum NodeTemplateType{
Input = 30,
Batch = 28,
Continue = 29,
MessageList = 37,
AssignVariable = 40,
DatabaseInsert = 41,
DatabaseUpdate = 42,
DatabasesELECT = 43,
DatabaseDelete = 44,
ConversationList = 53,
CreateMessage = 55,
JsonSerialization = 58,
JsonDeserialization = 59,
DatasetDelete = 60,
@@ -1786,7 +1792,7 @@ struct BackgroundImageInfo {
struct AvatarConfig{
1: string ImageUri (agw.key="image_uri", go.tag = "json:\"image_uri\"")
2: string ImageUrl (agw.key="image_url",go.tag = "json:\"image_url\"")
2: string ImageUrl (agw.key="image_url", go.tag = "json:\"image_url\"")
}
struct ChatFlowRole{
@@ -1805,20 +1811,21 @@ struct ChatFlowRole{
}
struct CreateChatFlowRoleRequest{
1: ChatFlowRole ChatFlowRole(agw.key= "chat_flow_role",go.tag="json:\"chat_flow_role\"")
1: ChatFlowRole ChatFlowRole(agw.key= "chat_flow_role", go.tag="json:\"chat_flow_role\"", api.query = "chat_flow_role")
255: optional base.Base Base
}
struct CreateChatFlowRoleResponse{
1: string ID // ID in the database
1: string ID (agw.key = "id", go.tag = "json:\"id\"", api.query = "id") // ID in the database
253: required i64 code
254: required string msg
255: required base.BaseResp BaseResp
}
struct DeleteChatFlowRoleRequest{
1: string WorkflowID
2: string ConnectorID
4: string ID // ID in the database
1: string WorkflowID (agw.key = "workflow_id", go.tag = "json:\"workflow_id\"", api.query = "workflow_id")
2: string ConnectorID (agw.key = "connector_id", go.tag = "json:\"connector_id\"", api.query = "connector_id")
4: string ID (agw.key = "id", go.tag = "json:\"id\"", api.query = "id") // ID in the database
255: optional base.Base Base
}
@@ -1829,18 +1836,20 @@ struct DeleteChatFlowRoleResponse{
}
struct GetChatFlowRoleRequest{
1: string WorkflowID (agw.key = "workflow_id")
2: string ConnectorID (agw.key = "connector_id")
3: bool IsDebug (agw.key = "is_debug")
1: string WorkflowID (agw.key = "workflow_id", go.tag = "json:\"workflow_id\"", api.query = "workflow_id")
2: string ConnectorID (agw.key = "connector_id", go.tag = "json:\"connector_id\"", api.query = "connector_id")
3: bool IsDebug (agw.key = "is_debug", go.tag = "json:\"is_debug\"", api.query = "is_debug")
// 4: optional string AppID (api.query = "app_id")
5: optional map<string,string> Ext (api.query = "ext")
255: optional base.Base Base
255: optional base.Base Base (go.tag = "json:\"base\"", api.query = "base")
}
struct GetChatFlowRoleResponse{
1 : optional ChatFlowRole Role (agw.key = "role")
1: required i64 code
2: required string msg
3: optional ChatFlowRole Role (agw.key = "role", go.tag = "json:\"role\"", api.query = "role")
255: required base.BaseResp BaseResp
255: required base.BaseResp BaseResp (go.tag = "json:\"base_resp\"", api.query = "base_resp")
}
enum NodePanelSearchType {
@@ -2191,3 +2200,34 @@ struct OpenAPIGetWorkflowInfoResponse{
255: required base.BaseResp BaseResp
}
struct CreateConversationRequest {
1: optional map<string,string> MetaData (api.body = "meta_data") //自定义透传字段
3: optional i64 BotId (api.body = "bot_id", api.js_conv="true")
4: optional i64 ConnectorId (api.body= "connector_id", api.js_conv="true")
5: optional string SpaceID (api.body= "space_id", api.js_conv="true")
9 : optional string AppID (go.tag="json:\"app_id\"")
10: optional string WorkflowID (go.tag="json:\"workflow_id\"")
11: optional string ConversationMame (go.tag="json:\"conversation_name\"")
12: optional bool GetOrCreate (go.tag="json:\"get_or_create\"")
13: optional bool DraftMode (go.tag="json:\"draft_mode\"")
255: optional base.Base Base
}
struct CreateConversationResponse {
1: i64 code
2: string msg
3: optional ConversationData ConversationData (api.body = "data")
}
struct ConversationData {
1: i64 Id (api.body = "id", agw.key = "id", api.js_conv="true")
2: i64 CreatedAt (api.body = "created_at", agw.key = "created_at")
3: map<string,string> MetaData (api.body = "meta_data", agw.key = "meta_data")
4: optional i64 CreatorID (api.body = "creator_d", agw.key = "creator_d", api.js_conv="true")
5: optional i64 ConnectorID (api.body = "connector_id", agw.key="connector_id", api.js_conv="true")
6: optional i64 LastSectionID (api.body="last_section_id", api.js_conv="true")
7: optional i64 AccountID (api.body = "account_id")
}

View File

@@ -75,4 +75,6 @@ service WorkflowService {
workflow.GetWorkflowRunHistoryResponse OpenAPIGetWorkflowRunHistory(1:workflow.GetWorkflowRunHistoryRequest request)(api.get='/v1/workflow/get_run_history', api.category="workflow_open_api", api.tag="openapi", api.gen_path="workflow_api", agw.preserve_base = "false")
workflow.ChatFlowRunResponse OpenAPIChatFlowRun(1: workflow.ChatFlowRunRequest request)(api.post = "/v1/workflows/chat", api.category="workflow_open_api", api.tag="openapi", api.gen_path="workflow_open_api")
workflow.OpenAPIGetWorkflowInfoResponse OpenAPIGetWorkflowInfo(1: workflow.OpenAPIGetWorkflowInfoRequest request)(api.get = "/v1/workflows/:workflow_id", api.category="workflow_open_api", api.tag="openapi", api.gen_path="workflow_open_api")
workflow.CreateConversationResponse OpenAPICreateConversation(1: workflow.CreateConversationRequest request)(api.post = "/v1/workflow/conversation/create", api.category="workflow_open_api",api.tag="openapi", api.gen_path="workflow_open_api", agw.preserve_base = "true")
}