refactor: IDL structure modification (#475)
This commit is contained in:
905
idl/app/bot_common.thrift
Normal file
905
idl/app/bot_common.thrift
Normal file
@@ -0,0 +1,905 @@
|
||||
namespace go app.bot_common
|
||||
|
||||
|
||||
struct AuthToken {
|
||||
1: string service_id,
|
||||
2: string access_key_id,
|
||||
3: string secret_access_key,
|
||||
4: string session_token,
|
||||
5: string expired_time,
|
||||
6: string current_time,
|
||||
7: string upload_host,
|
||||
8: string host_scheme,
|
||||
}
|
||||
|
||||
struct PromptInfo {
|
||||
1: optional string Prompt (api.body="prompt"), // Text prompt
|
||||
}
|
||||
|
||||
struct ModelInfo {
|
||||
1: optional i64 ModelId (agw.js_conv="str", api.js_conv="true", api.body="model_id"), // Model ID
|
||||
2: optional double Temperature (api.body="temperature") , // Temperature, model output randomness, the larger the value, the more random, the smaller the more conservative (0-1]
|
||||
3: optional i32 MaxTokens (api.body="max_tokens") , // Maximum Token Reply
|
||||
4: optional double TopP (api.body="top_p") , // Another model's output randomness, the larger the value, the more random [0, 1]
|
||||
5: optional double FrequencyPenalty (api.body="frequency_penalty") , // Frequency penalty, adjust the frequency of words in the generated content, the fewer positive words are [-1.0, 1.0]
|
||||
6: optional double PresencePenalty (api.body="presence_penalty") , // There is a penalty, adjust the frequency of new words in the generated content, avoid repeating words with positive values, and use new words [-1.0, 1.0]
|
||||
7: optional ShortMemoryPolicy ShortMemoryPolicy (api.body="short_memory_policy") , // contextual policy
|
||||
8: optional i32 TopK (api.body="top_k") , // When generating, sample the size of the candidate set
|
||||
9: optional ModelResponseFormat ResponseFormat (api.body="response_format") , // model reply content format
|
||||
10: optional ModelStyle ModelStyle (api.body="model_style") , // User-selected model style
|
||||
}
|
||||
|
||||
enum ModelStyle {
|
||||
Custom = 0
|
||||
Creative = 1
|
||||
Balance = 2
|
||||
Precise = 3
|
||||
}
|
||||
enum ModelResponseFormat {
|
||||
Text = 0,
|
||||
Markdown = 1,
|
||||
JSON = 2,
|
||||
}
|
||||
|
||||
// The type of transmission allowed by the context
|
||||
enum ContextMode {
|
||||
Chat = 0,
|
||||
FunctionCall_1 = 1,
|
||||
FunctionCall_2 = 2,
|
||||
FunctionCall_3 = 3,
|
||||
}
|
||||
|
||||
enum ModelFuncConfigType {
|
||||
Plugin = 1
|
||||
Workflow = 2
|
||||
ImageFlow = 3
|
||||
Trigger = 4
|
||||
KnowledgeText = 5
|
||||
KnowledgeTable = 6
|
||||
KnowledgeAutoCall = 7
|
||||
KnowledgeOnDemandCall = 8
|
||||
Variable = 9
|
||||
Database = 10
|
||||
LongTermMemory = 11
|
||||
FileBox = 12
|
||||
Onboarding = 13
|
||||
Suggestion = 14
|
||||
ShortcutCommand = 15
|
||||
BackGroundImage = 16
|
||||
TTS = 17
|
||||
MultiAgentRecognize = 18
|
||||
KnowledgePhoto = 19
|
||||
HookInfo = 20
|
||||
}
|
||||
|
||||
enum ModelFuncConfigStatus {
|
||||
FullSupport = 0
|
||||
PoorSupport = 1
|
||||
NotSupport = 2
|
||||
}
|
||||
|
||||
struct ShortMemoryPolicy {
|
||||
1: optional ContextMode ContextMode (api.body="context_mode") , // The type of transmission allowed by the context
|
||||
2: optional i32 HistoryRound (api.body="history_round"), // Number of rounds of context band
|
||||
}
|
||||
|
||||
struct PluginInfo {
|
||||
1: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id"), // Plugin ID
|
||||
2: optional i64 ApiId (agw.js_conv="str", api.js_conv="true", api.body="api_id") , // api Id
|
||||
3: optional string ApiName (api.body="api_name") , // API name O project
|
||||
|
||||
100: optional i64 ApiVersionMs (agw.js_conv="str", api.js_conv="true", api.body="api_version_ms"), // api version
|
||||
}
|
||||
|
||||
struct WorkflowInfo {
|
||||
1: optional i64 WorkflowId (agw.js_conv="str", api.js_conv="true", api.body="workflow_id"), // WorkflowId
|
||||
2: optional i64 PluginId (agw.js_conv="str", api.js_conv="true", api.body="plugin_id") , // Plugin ID
|
||||
3: optional i64 ApiId (agw.js_conv="str", api.js_conv="true", api.body="api_id") , // api Id
|
||||
4: optional WorkflowMode FlowMode (agw.js_conv="str", api.body="flow_mode") // Workflow or imageflow, default to workflow
|
||||
5: optional string WorkflowName (api.body="workflow_name") , // workflow name
|
||||
6: optional string Desc (api.body="desc", api.body="desc"),
|
||||
7: optional list<PluginParameter> Parameters (api.body="parameters", api.body="parameters"),
|
||||
8: optional string PluginIcon (api.body="plugin_icon", api.body="plugin_icon"),
|
||||
}
|
||||
struct PluginParameter {
|
||||
1: optional string Name (api.body="name")
|
||||
2: optional string Desc (api.body="desc")
|
||||
3: optional bool Required (api.body="required")
|
||||
4: optional string Type (api.body="type")
|
||||
5: optional list<PluginParameter> SubParameters (api.body="sub_parameters")
|
||||
6: optional string SubType (api.body="sub_type") // If Type is an array, there is a subtype
|
||||
}
|
||||
|
||||
enum WorkflowMode {
|
||||
Workflow = 0
|
||||
Imageflow = 1
|
||||
SceneFlow = 2
|
||||
ChatFlow = 3
|
||||
All = 100
|
||||
}
|
||||
// onboarding content generation mode
|
||||
enum OnboardingMode {
|
||||
NO_NEED = 1, // No.
|
||||
USE_MANUAL = 2, // Manually specify content (multi-language support is covered by LLM)
|
||||
USE_LLM = 3, // Generated by LLM
|
||||
}
|
||||
|
||||
struct OnboardingInfo { // Coze Opening Dialog
|
||||
1: optional string Prologue (api.body="prologue") , // opening statement
|
||||
2: optional list<string> SuggestedQuestions (api.body="suggested_questions") , // suggestion question
|
||||
3: optional OnboardingMode OnboardingMode (api.body="onboarding_mode") , // Opener model
|
||||
4: optional string CustomizedOnboardingPrompt (api.body="customized_onboarding_prompt"), // LLM Generation, User-defined Prompt
|
||||
5: optional SuggestedQuestionsShowMode SuggestedQuestionsShowMode (api.body="suggested_questions_show_mode") , // The opening statement presets the problem display method, and the default is 0 random display.
|
||||
}
|
||||
|
||||
enum SuggestedQuestionsShowMode{
|
||||
Random = 0,
|
||||
All = 1,
|
||||
}
|
||||
|
||||
enum SuggestReplyMode{
|
||||
System = 0,
|
||||
Custom = 1,
|
||||
Disable = 2,
|
||||
OriBot = 3, // Agent specific, multiplexed source Bot configuration
|
||||
}
|
||||
|
||||
// suggest
|
||||
struct SuggestReplyInfo { // Coze Auto-Suggestion
|
||||
1: optional SuggestReplyMode SuggestReplyMode (api.body="suggest_reply_mode") , // suggestion problem model
|
||||
2: optional string CustomizedSuggestPrompt (api.body="customized_suggest_prompt"), // user-defined suggestion questions
|
||||
3: optional string ChainTaskName (api.body="chain_task_name") , // The name of the ChainTask that runs the Prompt
|
||||
}
|
||||
|
||||
// tts Voices
|
||||
struct VoicesInfo { // Coze Voices
|
||||
1: optional bool Muted (api.body="muted") , // Whether to turn on sound true: disable false: turn on
|
||||
2: optional map<string,i64> I18nLangVoice (api.body="i18n_lang_voice"), // Multi-voice voice configuration
|
||||
7: optional map<string,string> I18nLangVoiceStr (api.body="i18n_lang_voice_str"), // Multi-voice tone configuration, string type
|
||||
3: optional bool Autoplay (api.body="autoplay") , // Whether to play automatically
|
||||
4: optional map<string,i64> AutoplayVoice (api.body="autoplay_voice") , // autoplay timbre
|
||||
5: optional bool CloseVoiceCall (api.body="voice_call") , // Whether to turn off voice calls, true: turn off false: turn on, default is false
|
||||
6: optional DefaultUserInputType DefaultUserInputType (api.body="default_user_input_type"), // Default user input type
|
||||
}
|
||||
|
||||
enum DefaultUserInputType {
|
||||
NotSet = 0, // Not set
|
||||
Text = 1, // Text
|
||||
Voice = 2, // Hold down the voice
|
||||
Call = 3, // voice call
|
||||
}
|
||||
|
||||
// AnswerActions
|
||||
enum AnswerActionsMode {
|
||||
Default = 1,
|
||||
Customize = 2,
|
||||
}
|
||||
|
||||
enum AnswerActionTriggerType {
|
||||
Direct = 1, // Platform preset Trigger action
|
||||
WebView = 2, // Click Action to display the custom H5 page
|
||||
SendMessage = 3, // Click Action to send a custom user message
|
||||
}
|
||||
|
||||
struct AnswerActionTriggerRule {
|
||||
1: AnswerActionTriggerType Type (api.body="type") ,
|
||||
2: bool NeedPreloading (api.body="need_preloading"),
|
||||
3: map<string,string> TriggerData (api.body="trigger_data") , // According to AnswerActionTriggerType
|
||||
}
|
||||
|
||||
struct ActionIcon {
|
||||
1: string Type (api.body="type") , // Customized button type does not need to be passed
|
||||
2: string DefaultUrl (api.body="default_url"), // default state
|
||||
3: string ActiveUrl (api.body="active_url") , // The state of pressing the button
|
||||
4: string DefaultUri (api.body="default_uri"), // default state
|
||||
5: string ActiveUri (api.body="active_uri") , // The state of pressing the button
|
||||
}
|
||||
|
||||
struct AnswerActionConfig {
|
||||
1: string Key (api.body="key") , // The prefabricated one only needs to pass the key.
|
||||
2: string Name (api.body="name") , // default
|
||||
3: ActionIcon Icon (api.body="icon") , // Send uri.
|
||||
4: map<string,string> NameI18n (api.body="name_i18n") , // Store the name of user i18
|
||||
5: AnswerActionTriggerRule TriggerRule (api.body="trigger_rule"), // Direct has no value; WebView contains webview_url and webview_callback_psm keys; SendMessage contains send_message_prompt
|
||||
6: i32 Position (api.body="position") , // location
|
||||
}
|
||||
|
||||
struct AnswerActions {
|
||||
1: AnswerActionsMode AnswerActionsMode (api.body="answer_actions_mode") ,
|
||||
2: list<AnswerActionConfig> AnswerActionConfigs (api.body="answer_action_configs"),
|
||||
}
|
||||
|
||||
// bot ext
|
||||
struct BotExtInfo {
|
||||
1: optional AnswerActions AnswerActions (api.body="answer_actions") ,
|
||||
2: optional list<i32> CardIds (api.body="card_ids") ,
|
||||
3: optional i32 PromptId (api.body="prompt_id") ,
|
||||
4: optional string BotTemplateName (api.body="bot_template_name"),
|
||||
5: optional bool UseUGCVoice (api.body="use_ugc_voice") ,
|
||||
6: optional i32 AppId (api.body="app_id") ,
|
||||
7: optional bool BindingMp (api.body="binding_mp") , // Whether to bind the Mini Program logo
|
||||
}
|
||||
|
||||
struct KnowledgeInfo {
|
||||
1: optional string Id (api.body="id") , // Knowledge ID
|
||||
2: optional string Name (api.body="name"), // Knowledge base name
|
||||
}
|
||||
|
||||
enum SearchStrategy {
|
||||
SemanticSearch = 0, // semantic search
|
||||
HybirdSearch = 1, // Hybrid Search
|
||||
FullTextSearch = 20, // Full Text Search
|
||||
}
|
||||
|
||||
struct Knowledge {
|
||||
1: optional list<KnowledgeInfo> KnowledgeInfo (api.body="knowledge_info") , // Knowledge Base Information
|
||||
2: optional i64 TopK (api.body="top_k") , // recall maximum data volume
|
||||
3: optional double MinScore (api.body="min_score") , // minimum match
|
||||
4: optional bool Auto (api.body="auto") , // automatic recall
|
||||
5: optional SearchStrategy SearchStrategy (api.body="search_strategy"), // search strategy
|
||||
6: optional bool ShowSource (api.body="show_source"), // Whether to show the source
|
||||
7: optional KnowledgeNoRecallReplyMode NoRecallReplyMode (api.body="no_recall_reply_mode"), // No recall reply mode, default 0
|
||||
8: optional string NoRecallReplyCustomizePrompt (api.body="no_recall_reply_customize_prompt"), // Custom prompt for no recall reply, effective when NoRecallReplyMode = 1
|
||||
9: optional KnowledgeShowSourceMode ShowSourceMode (api.body="show_source_mode"), // Source display method, default value 0 card list method
|
||||
10: optional RecallStrategy RecallStrategy (api.body="recall_strategy"), // Recall policy, default value is true
|
||||
}
|
||||
|
||||
struct RecallStrategy {
|
||||
1: optional bool UseRerank (api.body="use_rerank"),
|
||||
2: optional bool UseRewrite (api.body="use_rewrite"),
|
||||
3: optional bool UseNl2sql (api.body="use_nl2sql")
|
||||
}
|
||||
|
||||
enum KnowledgeShowSourceMode{
|
||||
ReplyBottom = 0,
|
||||
CardList = 1,
|
||||
}
|
||||
|
||||
|
||||
enum KnowledgeNoRecallReplyMode{
|
||||
Default = 0,
|
||||
CustomizePrompt = 1,
|
||||
}
|
||||
|
||||
enum SocietyVisibility {
|
||||
Public = 1, // Visible to all
|
||||
Anonymous = 2, // Visible to host only
|
||||
Custom = 3, // custom
|
||||
}
|
||||
struct SocietyVisibiltyConfig {
|
||||
1: SocietyVisibility VisibilityType (api.body="visibility_type", go.tag="json:\"visibility_type,omitempty\"") , // Visibility in Social Scene: Public = 1, Anonymous = 2
|
||||
2: list<string> VisibilityRoles (api.body="visibility_roles", go.tag="json:\"visibility_roles,omitempty\""), // list of visible characters
|
||||
}
|
||||
|
||||
struct Variable {
|
||||
1: optional string Key (api.body="key") , // key, Field
|
||||
2: optional string Description (api.body="description") , // describe
|
||||
3: optional string DefaultValue (api.body="default_value"), // default value
|
||||
4: optional bool IsSystem (api.body="is_system"), // Whether the system value is the system value
|
||||
5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported
|
||||
6: optional SocietyVisibiltyConfig SocietyVisibilityConfig (api.body="society_visibility_config", go.tag="json:\"society_visibility_config,omitempty\""), // Visibility in Social Scene: Public = 1, Anonymous = 2
|
||||
7: optional bool IsDisabled (api.body="is_disabled"), // Whether to disable, the default is false to enable
|
||||
}
|
||||
|
||||
struct TaskInfo { // Scheduled Tasks on Coze
|
||||
1: optional bool UserTaskAllowed (api.body="user_task_allowed") , // User starts task
|
||||
2: optional i64 EnablePresetTask (api.body="enable_preset_task"), // Allow preset tasks
|
||||
}
|
||||
|
||||
enum FieldItemType {
|
||||
Text = 1, // Text String
|
||||
Number = 2, // Digital Integer
|
||||
Date = 3, // Time Time
|
||||
Float = 4, // float Number
|
||||
Boolean = 5, // bool Boolean
|
||||
}
|
||||
|
||||
struct FieldItem {
|
||||
1: optional string Name (api.body="name") , // field name
|
||||
2: optional string Desc (api.body="desc") , // Field description
|
||||
3: optional FieldItemType Type (api.body="type") , // field type
|
||||
4: optional bool MustRequired (api.body="must_required") , // Is it required?
|
||||
5: optional i64 Id (agw.js_conv="str", api.js_conv="true", api.body="id"), // The field Id is added as 0.
|
||||
6: optional string TypeStr (api.body="type_str") , // Field type str
|
||||
7: optional i64 AlterId (api.body="alterId") , // Field type str
|
||||
}
|
||||
|
||||
struct Database {
|
||||
1: optional string TableId (api.body="table_id") , // table id
|
||||
2: optional string TableName (api.body="table_name"), // Table name
|
||||
3: optional string TableDesc (api.body="table_desc"), // Table Introduction
|
||||
4: optional list<FieldItem> FieldList (api.body="field_list"), // Table field information
|
||||
5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported
|
||||
6: optional BotTableRWMode RWMode (api.body="rw_mode"),
|
||||
}
|
||||
|
||||
enum BotTableRWMode {
|
||||
LimitedReadWrite = 1,
|
||||
ReadOnly = 2,
|
||||
UnlimitedReadWrite = 3,
|
||||
RWModeMax = 4,
|
||||
}
|
||||
|
||||
enum AgentType {
|
||||
Start_Agent = 0,
|
||||
LLM_Agent = 1,
|
||||
Task_Agent = 2,
|
||||
Global_Agent = 3,
|
||||
Bot_Agent = 4,
|
||||
}
|
||||
|
||||
//Version Compatibility: 0 - Old Version 1 - Rollback New Version 2 - Non-Rollback New Version 3 - Rollback New Version (no longer prompted)
|
||||
enum AgentVersionCompat{
|
||||
OldVersion = 0
|
||||
MiddleVersion = 1
|
||||
NewVersion = 2
|
||||
MiddleVersionNotPrompt = 3
|
||||
}
|
||||
|
||||
struct Agent {
|
||||
1 : i64 AgentId (agw.js_conv="str", api.js_conv="true", api.body="agent_id") ,
|
||||
2 : string AgentName (api.body="agent_name") ,
|
||||
3 : PromptInfo PromptInfo (api.body="prompt_info") , // Prompt message
|
||||
4 : list<PluginInfo> PluginInfoList (api.body="plugin_info_list") , // List of plugins
|
||||
5 : Knowledge Knowledge (api.body="knowledge") , // dataset
|
||||
6 : list<WorkflowInfo> WorkflowInfoList (api.body="workflow_info_list") , // Workflow List
|
||||
7 : ModelInfo ModelInfo (api.body="model_info") , // model configuration
|
||||
8 : list<Intent> Intents (api.body="intents") , // intent information
|
||||
9 : AgentType AgentType (api.body="agent_type") ,
|
||||
10: bool RootAgent (api.body="root_agent") , // Is it a rootagent?
|
||||
11: i64 ReferenceId (agw.js_conv="str", api.js_conv="true", api.body="reference_id"),
|
||||
12: string FirstVersion (api.body="first_version") ,
|
||||
13: string LastVersion (api.body="last_version") ,
|
||||
14: AgentPosition AgentPosition (api.body="agent_position") ,
|
||||
15: string IconUri (api.body="icon_uri") ,
|
||||
16: JumpConfig JumpConfig (api.body="jump_config") ,
|
||||
17: SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") ,
|
||||
18: string Description (api.body="description") ,
|
||||
19: AgentVersionCompat VersionCompat (api.body="version_compat") , // multi_agent version compatibility field
|
||||
20: optional HookInfo HookInfo (api.body="hook_info") ,
|
||||
21: optional string CurrentVersion (api.body="current_version") , //The current version of the subbot
|
||||
22: optional ReferenceInfoStatus ReferenceInfoStatus (api.body="reference_info_status") , // 1: Available update 2: Removed
|
||||
23: optional ReferenceUpdateType UpdateType (api.body="update_type") , //Subbot update type
|
||||
}
|
||||
|
||||
struct AgentPosition{
|
||||
1: double x,
|
||||
2: double y,
|
||||
}
|
||||
|
||||
enum MultiAgentSessionType{
|
||||
Flow = 1
|
||||
Host = 2
|
||||
}
|
||||
|
||||
enum MultiAgentConnectorType {
|
||||
Curve = 0
|
||||
Straight = 1
|
||||
}
|
||||
|
||||
struct Intent{
|
||||
1: string IntentId (api.body="intent_id") ,
|
||||
2: string Prompt (api.body="prompt") ,
|
||||
3: i64 NextAgentId (agw.js_conv="str", api.js_conv="true", api.body="next_agent_id"),
|
||||
4: MultiAgentSessionType SessionType (api.body="session_type")
|
||||
}
|
||||
|
||||
enum BotMode{
|
||||
SingleMode = 0,
|
||||
MultiMode = 1,
|
||||
WorkflowMode = 2,
|
||||
}
|
||||
|
||||
enum BotSpecies { // Bot type
|
||||
Default = 0, // Create from flow
|
||||
Function = 1, // Created from coze
|
||||
}
|
||||
|
||||
enum TimeCapsuleMode {
|
||||
Off = 0, // close
|
||||
On = 1, // open
|
||||
}
|
||||
enum DisablePromptCalling {
|
||||
Off = 0,
|
||||
On = 1,
|
||||
}
|
||||
|
||||
// Time Capsule Information
|
||||
struct TimeCapsuleInfo {
|
||||
1: optional TimeCapsuleMode TimeCapsuleMode (api.body="time_capsule_mode"),
|
||||
2: optional DisablePromptCalling DisablePromptCalling (api.body="disable_prompt_calling"),
|
||||
}
|
||||
|
||||
struct BotTagInfo {
|
||||
1: optional TimeCapsuleInfo TimeCapsuleInfo (api.body="time_capsule_info"), // Time capsule information tag key: time_capsule
|
||||
}
|
||||
|
||||
struct FileboxInfo{
|
||||
1: optional FileboxInfoMode Mode,
|
||||
}
|
||||
enum FileboxInfoMode {
|
||||
Off = 0,
|
||||
On = 1,
|
||||
}
|
||||
|
||||
enum BotStatus {
|
||||
Deleted = 0
|
||||
Using = 1
|
||||
Banned = 2
|
||||
}
|
||||
|
||||
enum BusinessType {
|
||||
Default = 0
|
||||
DouyinAvatar = 1
|
||||
}
|
||||
|
||||
// bot information
|
||||
struct BotInfo {
|
||||
1 : i64 BotId (agw.js_conv="str", api.js_conv="true", api.body="bot_id") , // bot id
|
||||
2 : string Name (api.body="name") , // bot name
|
||||
3 : string Description (api.body="description") , // Bot description
|
||||
4 : string IconUri (api.body="icon_uri") , // Bot icon uri
|
||||
5 : string IconUrl (api.body="icon_url") , // Bot icon url
|
||||
6 : i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") , // creator id
|
||||
7 : i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") , // create_time
|
||||
8 : i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") , // update time
|
||||
9 : i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id"), // line of business
|
||||
10: string Version (api.body="version") , // Version, ms
|
||||
11: ModelInfo ModelInfo (api.body="model_info") , // model configuration
|
||||
12: PromptInfo PromptInfo (api.body="prompt_info") , // Prompt message
|
||||
13: list<PluginInfo> PluginInfoList (api.body="plugin_info_list") , // List of plugins
|
||||
14: list<WorkflowInfo> WorkflowInfoList (api.body="workflow_info_list") , // Workflow List
|
||||
15: OnboardingInfo OnboardingInfo (api.body="onboarding_info") , // opening statement
|
||||
16: Knowledge Knowledge (api.body="knowledge") , // dataset
|
||||
17: list<Variable> VariableList (api.body="variable_list") , // KV storage
|
||||
18: TaskInfo TaskInfo (api.body="task_info") , // Task management/preset tasks
|
||||
19: list<Database> DatabaseList (api.body="database_list") , // data table
|
||||
20: SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") , // referral question
|
||||
21: VoicesInfo VoicesInfo (api.body="voices_info") , // Timbre Configuration
|
||||
22: BotExtInfo BotExtInfo (api.body="bot_ext_info") , // Additional information, extended fields
|
||||
23: BotMode BotMode (api.body="bot_mode") , // Bot type, single agent or multi agent
|
||||
24: list<Agent> Agents (api.body="agents") , // Multi agent mode agent information
|
||||
25: BotSpecies BotSpecies (api.body="bot_species") , // Bot type
|
||||
26: BotTagInfo BotTagInfo (api.body="bot_tag_info") , // Bot tag information, user new field
|
||||
27: FileboxInfo FileboxInfo (api.body="filebox_info") , // FileBox Information
|
||||
28: MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") , // multi_agent structure
|
||||
29: list<BackgroundImageInfo> BackgroundImageInfoList (api.body="background_image_info_list") , // Background cover list structure
|
||||
30: list<string> ShortcutSort (api.body="shortcut_sort") ,
|
||||
31: BotStatus Status (api.body="status") , // bot state
|
||||
32: optional HookInfo HookInfo (api.body="hook_info") , // Hook information
|
||||
33: UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf") , // User query collection configuration
|
||||
34: LayoutInfo LayoutInfo (api.body="layout_info") , // Orchestration information for workflow patterns
|
||||
35: BusinessType BusinessType (api.body="business_type")
|
||||
}
|
||||
|
||||
|
||||
struct CommonKnowledge {
|
||||
1: list<KnowledgeInfo> knowledge_infos , // Knowledge Base Information
|
||||
}
|
||||
|
||||
struct ShortcutCommandComponent { // Panel parameters
|
||||
1 : string name //parameter name
|
||||
2 : string description //parameter description
|
||||
3 : string type // Input type text, select, file
|
||||
4 : optional string tool_parameter // When requesting a tool, the key of the parameter corresponds to the parameter name of the tool. If not, it will not be returned.
|
||||
5 : optional list<string> options // Options list when type is select or what types are supported when type is file image, doc, table, audio, video, zip, code, txt, ppt
|
||||
6 : optional string default_value // Default value, not returned when not configured
|
||||
7 : bool is_hide // Whether to hide or not to show, the shortcut command of the online bot tool type does not return the component with hide = true
|
||||
}
|
||||
|
||||
struct ShortcutCommandToolInfo {
|
||||
1: string name //
|
||||
2: string type // Tool type workflow plugin
|
||||
}
|
||||
|
||||
struct ShortcutCommandInfo {
|
||||
1: i64 id (api.js_conv="true") // Quick Command ID
|
||||
2: string name // Shortcut button name
|
||||
3: string command // Quick Instruction
|
||||
4: string description // shortcut description
|
||||
5: string query_template // Command query template
|
||||
6: string icon_url // Quick command icon
|
||||
7: optional list<ShortcutCommandComponent> components // Component list (parameter list)
|
||||
8: optional ShortcutCommandToolInfo tool // Tool information
|
||||
9: optional i64 agent_id (api.js_conv="true") //When the multi instruction is executed by which node, it will not be returned without configuration
|
||||
}
|
||||
|
||||
|
||||
struct OpenAPIBotInfo {
|
||||
1 : i64 bot_id (api.js_conv="true") , // bot id
|
||||
2 : string name, // bot name
|
||||
3 : string description, // Bot description
|
||||
4 : string icon_url, // Bot image url
|
||||
5 : i64 create_time, // create_time
|
||||
6 : i64 update_time, // update time
|
||||
7 : string version, // version
|
||||
8 : PromptInfo prompt_info, // Prompt message
|
||||
9 : OnboardingInfo onboarding_info, // opening statement
|
||||
10: BotMode bot_mode, // Bot type, single agent or multi agent
|
||||
// 11: optional list < VoiceData > voice_data_list,//selected voice message
|
||||
12: optional ModelInfo model_info, // model information
|
||||
13: list<PluginInfo> plugin_info_list, // Plugin information list
|
||||
14: optional CommonKnowledge knowledge // Knowledge Base Information
|
||||
15: list<WorkflowInfo> workflow_info_list, // Workflow information list
|
||||
16: list<ShortcutCommandInfo> shortcut_commands, // Quick Command Information List
|
||||
// 17: list < Voice > voice_info_list,//Tone Configuration
|
||||
18: string default_user_input_type, // Default user input type
|
||||
19: SuggestReplyInfo suggest_reply_info, // User Question Suggestions
|
||||
20: BackgroundImageInfo background_image_info, // background image
|
||||
21: list<Variable> variables, // Variable list
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct LayoutInfo {
|
||||
1: string WorkflowId (api.body="workflow_id") , // workflowId
|
||||
2: string PluginId (api.body="plugin_id") , // PluginId
|
||||
}
|
||||
|
||||
struct UserQueryCollectConf {
|
||||
1: bool IsCollected (api.body="is_collected") , // Whether to turn on the collection switch
|
||||
2: string PrivatePolicy (api.body="private_policy") , // Privacy Policy Link
|
||||
}
|
||||
|
||||
struct MultiAgentInfo {
|
||||
1: MultiAgentSessionType SessionType (api.body="session_type") , // multi_agent session takeover
|
||||
2: AgentVersionCompatInfo VersionCompatInfo (api.body="version_compat_info") , // multi_agent version compatibility field, front-end use
|
||||
3: MultiAgentConnectorType ConnectorType (api.body="connector_type") , // multi_agent connection type, front end
|
||||
}
|
||||
|
||||
struct AgentVersionCompatInfo {
|
||||
1: AgentVersionCompat VersionCompat (api.body="version_compat") ,
|
||||
2: string version
|
||||
}
|
||||
|
||||
struct BackgroundImageInfo {
|
||||
1: optional BackgroundImageDetail WebBackgroundImage (api.body="web_background_image") , // Web background cover
|
||||
2: optional BackgroundImageDetail MobileBackgroundImage (api.body="mobile_background_image") , // Mobile end background cover
|
||||
}
|
||||
|
||||
struct BackgroundImageDetail {
|
||||
1: optional string OriginImageUri (api.body="origin_image_uri") // original image
|
||||
2: optional string OriginImageUrl (api.body="origin_image_url")
|
||||
3: optional string ImageUri (api.body="image_uri") // Actual use of pictures
|
||||
4: optional string ImageUrl (api.body="image_url")
|
||||
5: optional string ThemeColor (api.body="theme_color")
|
||||
6: optional GradientPosition GradientPosition (api.body="gradient_position") // Gradual change of position
|
||||
7: optional CanvasPosition CanvasPosition (api.body="canvas_position") // Crop canvas position
|
||||
}
|
||||
|
||||
struct GradientPosition {
|
||||
1: optional double Left (api.body="left")
|
||||
2: optional double Right (api.body="right")
|
||||
}
|
||||
|
||||
|
||||
struct CanvasPosition {
|
||||
1: optional double Width (api.body="width")
|
||||
2: optional double Height (api.body="height")
|
||||
3: optional double Left (api.body="left")
|
||||
4: optional double Top (api.body="top")
|
||||
}
|
||||
|
||||
|
||||
// Update for bot information
|
||||
struct BotInfoForUpdate {
|
||||
1: optional i64 BotId (agw.js_conv="str", api.js_conv="true",api.body="bot_id") // bot id
|
||||
2: optional string Name (api.body="name") // bot name
|
||||
3: optional string Description (api.body="description") // Bot description
|
||||
4: optional string IconUri (api.body="icon_uri") // Bot icon uri
|
||||
5: optional string IconUrl (api.body="icon_url") // Bot icon url
|
||||
6: optional i64 CreatorId (agw.js_conv="str", api.js_conv="true", api.body="creator_id") // creator id
|
||||
7: optional i64 CreateTime (agw.js_conv="str", api.js_conv="true", api.body="create_time") // create_time
|
||||
8: optional i64 UpdateTime (agw.js_conv="str", api.js_conv="true", api.body="update_time") // update time
|
||||
9: optional i64 ConnectorId (agw.js_conv="str", api.js_conv="true", api.body="connector_id") // line of business
|
||||
10: optional string Version (api.body="version") // Version, ms
|
||||
11: optional ModelInfo ModelInfo (api.body="model_info") // model configuration
|
||||
12: optional PromptInfo PromptInfo (api.body="prompt_info") // Prompt message
|
||||
13: optional list<PluginInfo> PluginInfoList (api.body="plugin_info_list") // List of plugins
|
||||
14: optional list<WorkflowInfo> WorkflowInfoList (api.body="workflow_info_list") // Workflow List
|
||||
15: optional OnboardingInfo OnboardingInfo (api.body="onboarding_info") // opening statement
|
||||
16: optional Knowledge Knowledge (api.body="knowledge") // dataset
|
||||
17: optional list<Variable> VariableList (api.body="variable_list") // KV storage
|
||||
18: optional TaskInfo TaskInfo (api.body="task_info") // Task management/preset tasks
|
||||
19: optional list<Database> DatabaseList (api.body="database_list") // data table
|
||||
20: optional SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info") // referral question
|
||||
21: optional VoicesInfo VoicesInfo (api.body="voices_info") // Timbre Configuration
|
||||
22: optional BotExtInfo BotExtInfo (api.body="bot_ext_info") // Additional information, extended fields
|
||||
23: optional BotMode BotMode (api.body="bot_mode") // Bot type, single agent or multi agent
|
||||
24: optional list<AgentForUpdate> Agents (api.body="agents") // Multi agent mode agent information
|
||||
25: BotSpecies BotSpecies (api.body="bot_species") // Bot type
|
||||
26: optional BotTagInfo BotTagInfo (api.body="bot_tag_info") // Bot tag information, user new field
|
||||
27: optional FileboxInfo FileboxInfo (api.body="filebox_info") // FileBox Information
|
||||
28: optional MultiAgentInfo MultiAgentInfo (api.body="multi_agent_info") // multi_agent structure
|
||||
29: optional list<BackgroundImageInfo> BackgroundImageInfoList (api.body="background_image_info_list") // Background cover list structure
|
||||
30: optional list<string> ShortcutSort (api.body="shortcut_sort")
|
||||
31: optional HookInfo HookInfo (api.body="hook_info")
|
||||
32: optional UserQueryCollectConf UserQueryCollectConf (api.body="user_query_collect_conf")// User query collection configuration
|
||||
33: optional LayoutInfo LayoutInfo(api.body="layout_info") // Orchestration information for workflow patterns
|
||||
}
|
||||
|
||||
struct AgentForUpdate {
|
||||
1: optional i64 AgentId (agw.js_conv="str", api.js_conv="true", api.body="id") // The agw field names are specially mapped, note that
|
||||
2: optional string AgentName (api.body="name") // The agw field names are specially mapped, note that
|
||||
3: optional PromptInfo PromptInfo (api.body="prompt_info") // Prompt message
|
||||
4: optional list<PluginInfo> PluginInfoList (api.body="plugin_info_list") // List of plugins
|
||||
5: optional Knowledge Knowledge (api.body="knowledge") // dataset
|
||||
6: optional list<WorkflowInfo> WorkflowInfoList (api.body="workflow_info_list") // Workflow List
|
||||
7: optional ModelInfo ModelInfo (api.body="model_info") // model configuration
|
||||
8: optional list<Intent> Intents (api.body="intents") // intent information
|
||||
9: optional AgentType AgentType (api.body="agent_type")
|
||||
10: optional bool RootAgent (api.body="root_agent") // Is it a rootagent?
|
||||
11: optional i64 ReferenceId (agw.js_conv="str", api.js_conv="true", api.body="reference_id")
|
||||
12: optional string FirstVersion (api.body="first_version")
|
||||
13: optional string LastVersion (api.body="last_version")
|
||||
14: optional AgentPosition Position (api.body="agent_position")
|
||||
15: optional string IconUri (api.body="icon_uri")
|
||||
16: optional JumpConfig JumpConfig (api.body="jump_config")
|
||||
17: optional SuggestReplyInfo SuggestReplyInfo (api.body="suggest_reply_info")
|
||||
18: optional string Description (api.body="description")
|
||||
19: optional AgentVersionCompat VersionCompat (api.body="version_compat") // multi_agent version compatibility field
|
||||
20: optional HookInfo HookInfo (api.body="hook_info")
|
||||
}
|
||||
|
||||
struct TableDetail {
|
||||
1: optional string TableId // table id
|
||||
2: optional string TableName // Table name
|
||||
3: optional string TableDesc // Table Introduction
|
||||
4: optional list<FieldItem> FieldList // Table field information
|
||||
5: optional bool PromptDisabled (api.body="prompt_disabled"), // Whether to support calling in Prompt, the default is supported
|
||||
}
|
||||
|
||||
struct TaskPluginInputField {
|
||||
1: optional string Name
|
||||
2: optional string Type // "Input", "Reference"
|
||||
3: optional string Value
|
||||
}
|
||||
|
||||
struct TaskPluginInput {
|
||||
1: optional list<TaskPluginInputField> Params
|
||||
}
|
||||
|
||||
struct TaskWebhookField {
|
||||
1: optional string Name,
|
||||
2: optional string Type,
|
||||
3: optional string Description,
|
||||
4: optional list<TaskWebhookField> Children,
|
||||
}
|
||||
|
||||
struct TaskWebhookOutput {
|
||||
1: optional list<TaskWebhookField> Params
|
||||
}
|
||||
|
||||
struct TaskInfoDetail { // Tasks Detail
|
||||
1: optional string TaskId // task unique identifier
|
||||
2: optional string UserQuestion // The query executed when the timer fires, for example: Remind me to drink water. Phase 2: TriggerType == "Time"
|
||||
3: optional string CreateTime // Timed task create_time
|
||||
4: optional string NextTime // The time when the scheduled task will next execute
|
||||
5: optional i64 Status // Task Status: Valid/Invalid
|
||||
6: optional i32 PresetType // 1-Draft, 2-Online
|
||||
7: optional string CronExpr // crontab expression for timed tasks
|
||||
8: optional string TaskContent // Treated UserQuestions, such as Drinking Water
|
||||
9: optional string TimeZone // Time Zone
|
||||
10: optional string TaskName // task name
|
||||
11: optional string TriggerType // "Time", "Event"
|
||||
12: optional string Action // "Bot query", "Plugin", "Workflow"
|
||||
13: optional string BotQuery // Action == "Bot query"
|
||||
14: optional string PluginName // Both plugins and workflows use this field
|
||||
15: optional TaskPluginInput PluginInput // Both plugins and workflows use this field
|
||||
16: optional string WebhookUrl // TriggerType == "Event"
|
||||
17: optional string WebhookBearerToken // TriggerType == "Event"
|
||||
18: optional TaskWebhookOutput WebhookOutput // TriggerType == "Event"
|
||||
19: optional string OriginId // Traceability ID. Generated when created, updated/released unchanged
|
||||
}
|
||||
|
||||
struct DraftBotInfoV2 {
|
||||
1: BotInfo BotInfo
|
||||
2: optional string CanvasData
|
||||
3: optional i64 BaseCommitVersion
|
||||
4: optional i64 CommitVersion
|
||||
5: optional map<string,TableDetail> TableInfo // TableInfo
|
||||
6: optional map<string, TaskInfoDetail> TaskInfo // taskInfo
|
||||
}
|
||||
|
||||
enum BacktrackMode {
|
||||
Current = 1
|
||||
Previous = 2
|
||||
Start = 3
|
||||
MostSuitable = 4
|
||||
}
|
||||
|
||||
enum RecognitionMode {
|
||||
FunctionCall = 1
|
||||
Independent = 2
|
||||
}
|
||||
|
||||
struct JumpConfig {
|
||||
1: BacktrackMode backtrack
|
||||
2: RecognitionMode recognition
|
||||
3: optional IndependentModeConfig independent_conf
|
||||
}
|
||||
|
||||
enum IndependentTiming {
|
||||
Pre = 1 // Determine user input (front)
|
||||
Post = 2 // Determine node output (postfix)
|
||||
PreAndPost = 3 // Front mode and rear mode support simultaneous selection
|
||||
}
|
||||
enum IndependentRecognitionModelType {
|
||||
SLM = 0 // Small model
|
||||
LLM = 1 // Large model
|
||||
}
|
||||
struct IndependentModeConfig {
|
||||
1: IndependentTiming judge_timing // judge timing
|
||||
2: i32 history_round
|
||||
3: IndependentRecognitionModelType model_type
|
||||
4: optional string model_id
|
||||
5: optional string prompt
|
||||
}
|
||||
|
||||
struct MessageFeedback {
|
||||
1: MessageFeedbackType feedback_type // feedback type
|
||||
2: list<MessageFeedbackDetailType> detail_types // segmentation type
|
||||
3: string detail_content // Negative feedback custom content, corresponding to user selection Others
|
||||
}
|
||||
|
||||
enum MessageFeedbackType {
|
||||
Default = 0
|
||||
Like = 1
|
||||
Unlike = 2
|
||||
}
|
||||
|
||||
enum MessageFeedbackDetailType {
|
||||
UnlikeDefault = 0
|
||||
UnlikeHarmful = 1 // Harmful information
|
||||
UnlikeIncorrect = 2 // incorrect information
|
||||
UnlikeNotFollowInstructions = 3 // Did not follow instructions
|
||||
UnlikeOthers = 4 // other
|
||||
}
|
||||
|
||||
enum Scene{
|
||||
Default = 0,
|
||||
Explore = 1,
|
||||
BotStore = 2,
|
||||
CozeHome = 3,
|
||||
Playground = 4,
|
||||
Evaluation = 5, // evaluation platform
|
||||
AgentAPP = 6,
|
||||
PromptOptimize = 7, //Prompt optimization
|
||||
GenerateAgentInfo = 8 // Createbot's nl2bot features
|
||||
}
|
||||
|
||||
struct UserLabel {
|
||||
1: string label_id
|
||||
2: string label_name
|
||||
3: string icon_uri
|
||||
4: string icon_url
|
||||
5: string jump_link
|
||||
}
|
||||
|
||||
struct ChatV3ChatDetail {
|
||||
1: required string ID (api.body = "id"),
|
||||
2: required string ConversationID (api.body = "conversation_id"),
|
||||
3: required string BotID (api.body = "bot_id"),
|
||||
4: optional i32 CreatedAt (api.body = "created_at"),
|
||||
5: optional i32 CompletedAt (api.body = "completed_at"),
|
||||
6: optional i32 FailedAt (api.body = "failed_at"),
|
||||
7: optional map<string, string> MetaData (api.body = "meta_data"),
|
||||
8: optional LastError LastError (api.body = "last_error"),
|
||||
9: required string Status (api.body = "status"),
|
||||
10: optional Usage Usage (api.body = "usage"),
|
||||
11: optional RequiredAction RequiredAction (api.body = "required_action")
|
||||
12: optional string SectionID (api.body="section_id")
|
||||
}
|
||||
|
||||
struct LastError {
|
||||
1: required i32 Code (api.body = "code"),
|
||||
2: required string Msg (api.body = "msg"),
|
||||
}
|
||||
|
||||
struct Usage {
|
||||
1: optional i32 TokenCount (api.body = "token_count"),
|
||||
2: optional i32 OutputTokens (api.body = "output_count"),
|
||||
3: optional i32 InputTokens (api.body = "input_count"),
|
||||
}
|
||||
|
||||
struct RequiredAction {
|
||||
1: string Type (api.body = "type"),
|
||||
2: SubmitToolOutputs SubmitToolOutputs (api.body = "submit_tool_outputs")
|
||||
}
|
||||
|
||||
struct SubmitToolOutputs {
|
||||
1: list<InterruptPlugin> ToolCalls (api.body = "tool_calls")
|
||||
}
|
||||
|
||||
struct InterruptPlugin {
|
||||
1: string id
|
||||
2: string type
|
||||
3: InterruptFunction function
|
||||
4: InterruptRequireInfo require_info
|
||||
}
|
||||
|
||||
struct InterruptFunction {
|
||||
1: string name
|
||||
2: string arguments
|
||||
}
|
||||
|
||||
struct InterruptRequireInfo {
|
||||
1: list<string> infos
|
||||
}
|
||||
|
||||
struct ChatV3MessageDetail {
|
||||
1: required string ID (api.body = "id"),
|
||||
2: required string ConversationID (api.body = "conversation_id"),
|
||||
3: required string BotID (api.body = "bot_id"),
|
||||
4: required string Role (api.body = "role"),
|
||||
5: required string Type (api.body = "type"),
|
||||
6: required string Content (api.body = "content"),
|
||||
7: required string ContentType (api.body = "content_type"),
|
||||
8: optional map<string, string> MetaData (api.body = "meta_data"),
|
||||
9: required string ChatID (api.body = "chat_id")
|
||||
10: optional string SectionID (api.body="section_id")
|
||||
11: optional i64 CreatedAt (api.body = "created_at")
|
||||
12: optional i64 UpdatedAt (api.body = "updated_at")
|
||||
13: optional string ReasoningContent (api.body = "reasoning_content")
|
||||
}
|
||||
|
||||
struct HookInfo {
|
||||
1: optional list<HookItem> pre_agent_jump_hook // Pre agent jump hook
|
||||
2: optional list<HookItem> post_agent_jump_hook // Post agent jump hook
|
||||
3: optional list<HookItem> flow_hook // Process hook
|
||||
4: optional list<HookItem> atomic_hook // Atomic power hook
|
||||
5: optional list<HookItem> llm_call_hook // Model call hook
|
||||
6: optional list<HookItem> res_parsing_hook // Conversation result hook
|
||||
7: optional list<HookItem> suggestion_hook // suggesion hook
|
||||
}
|
||||
struct HookItem {
|
||||
1: optional string uri
|
||||
2: optional list<string> filter_rules
|
||||
3: optional bool strong_dep
|
||||
4: optional i64 timeout_ms
|
||||
}
|
||||
|
||||
//struct ContentAttachment {
|
||||
// 1: required string FileID (api.body = "file_id")
|
||||
//}
|
||||
|
||||
// struct MetaContent{
|
||||
// 1: required string Type (api.body="type"),
|
||||
// 2: optional string Text ( api.body="text"),
|
||||
// 3: optional string FileID (api.body="file_id"),
|
||||
// 4: optional string FileURL (api.body="file_url"),
|
||||
// 5: optional string Card (api.body="card"),
|
||||
// }
|
||||
|
||||
|
||||
// struct EnterMessage {
|
||||
// 1: required string Role (api.body = "role")
|
||||
// 2: string Content (api.body = "content")//content
|
||||
// 3: map<string,string> MetaData(api.body = "meta_data")
|
||||
// 4: string ContentType(api.body = "content_type")//text/card/object_string
|
||||
// 5: string Type(api.body = "type")
|
||||
// }
|
||||
|
||||
// struct OpenMessageApi {
|
||||
// 1: string Id (api.body = "id")//primary key ID
|
||||
// 2: string BotId (api.body = "bot_id")//bot id//TODO All i64 plus annotation str, imported parameters and exported parameters are required
|
||||
// 3: string Role(api.body = "role")
|
||||
// 4: string Content (api.body = "content")//content
|
||||
// 5: string ConversationId(api.body = "conversation_id") // conversation id
|
||||
// 6: map<string,string> MetaData(api.body = "meta_data")
|
||||
// 7: string CreatedAt (api.body = "created_at")//create_time
|
||||
// 8: string UpdatedAt (api.body = "updated_at")//Update time//Change TODO time to int
|
||||
// 9: string ChatId(api.body = "chat_id")
|
||||
// 10: string ContentType(api.body = "content_type")
|
||||
// 11: string Type(api.body = "type")
|
||||
// }
|
||||
|
||||
enum ReferenceUpdateType {
|
||||
ManualUpdate = 1
|
||||
AutoUpdate = 2
|
||||
}
|
||||
|
||||
enum ReferenceInfoStatus {
|
||||
HasUpdates = 1 // 1: Updates are available
|
||||
IsDelete = 2 // 2: Deleted
|
||||
}
|
||||
56
idl/app/bot_open_api.thrift
Normal file
56
idl/app/bot_open_api.thrift
Normal file
@@ -0,0 +1,56 @@
|
||||
namespace go app.bot_open_api
|
||||
include "../base.thrift"
|
||||
include "bot_common.thrift"
|
||||
|
||||
struct OauthAuthorizationCodeReq {
|
||||
1: string code (api.query='code') ,
|
||||
2: string state (api.query='state'),
|
||||
}
|
||||
|
||||
struct OauthAuthorizationCodeResp {
|
||||
255: required base.BaseResp BaseResp,
|
||||
}
|
||||
|
||||
struct GetBotOnlineInfoReq {
|
||||
1 : required i64 bot_id (api.js_conv="true") // botId
|
||||
2: optional string connector_id // Keep it first, don't expose it, and don't use the field
|
||||
3 : optional string version // bot version, get the latest version if you don't pass it on.
|
||||
}
|
||||
|
||||
struct UploadFileOpenRequest {
|
||||
1: required string ContentType (api.header = "Content-Type", agw.source = "header", agw.key = "Content-Type"), // file type
|
||||
2: required binary Data (api.raw_body = ""), // binary data
|
||||
255: base.Base Base
|
||||
}
|
||||
|
||||
|
||||
struct UploadFileOpenResponse {
|
||||
1: optional File File (api.body = "data")
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
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"), // 文件名
|
||||
5: string URL (api.body = "url")
|
||||
}
|
||||
|
||||
// resp
|
||||
struct GetBotOnlineInfoResp {
|
||||
1: required i32 code
|
||||
2: required string msg
|
||||
3: required bot_common.OpenAPIBotInfo data
|
||||
}
|
||||
|
||||
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")
|
||||
// File related OpenAPI
|
||||
UploadFileOpenResponse UploadFileOpen(1: UploadFileOpenRequest request)(api.post = "/v1/files/upload", api.category="file", api.tag="openapi", agw.preserve_base="true")
|
||||
}
|
||||
93
idl/app/common_struct/common_struct.thrift
Normal file
93
idl/app/common_struct/common_struct.thrift
Normal file
@@ -0,0 +1,93 @@
|
||||
namespace go app.intelligence.common
|
||||
|
||||
struct UserLabel {
|
||||
1: string label_id ,
|
||||
2: string label_name ,
|
||||
3: string icon_uri ,
|
||||
4: string icon_url ,
|
||||
5: string jump_link ,
|
||||
}
|
||||
|
||||
struct User {
|
||||
1: i64 user_id (agw.js_conv="str", api.js_conv="true"),
|
||||
2: string nickname, // user nickname
|
||||
3: string avatar_url, // user avatar
|
||||
4: string user_unique_name, // user name
|
||||
5: UserLabel user_label, // user tag
|
||||
}
|
||||
|
||||
|
||||
/****************************** audit **********************************/
|
||||
enum AuditStatus {
|
||||
Auditing = 0, // Under review.
|
||||
Success = 1, // approved
|
||||
Failed = 2, // audit failed
|
||||
}
|
||||
|
||||
struct AuditInfo {
|
||||
1: optional AuditStatus audit_status,
|
||||
2: optional string publish_id,
|
||||
3: optional string commit_version,
|
||||
}
|
||||
|
||||
// Audit results
|
||||
struct AuditData {
|
||||
1: bool check_not_pass // True: The machine audit verification failed
|
||||
2: optional string check_not_pass_msg // The machine audit verification failed the copy.
|
||||
}
|
||||
|
||||
|
||||
/****************************** publish **********************************/
|
||||
enum ConnectorDynamicStatus {
|
||||
Normal = 0
|
||||
Offline = 1
|
||||
TokenDisconnect = 2
|
||||
}
|
||||
|
||||
struct ConnectorInfo {
|
||||
1: string id
|
||||
2: string name
|
||||
3: string icon
|
||||
4: ConnectorDynamicStatus connector_status
|
||||
5: optional string share_link
|
||||
}
|
||||
|
||||
struct IntelligencePublishInfo {
|
||||
1: string publish_time,
|
||||
2: bool has_published,
|
||||
3: list<ConnectorInfo> connectors,
|
||||
}
|
||||
|
||||
enum ResourceType {
|
||||
Plugin = 1
|
||||
Workflow = 2
|
||||
Imageflow = 3
|
||||
Knowledge = 4
|
||||
UI = 5
|
||||
Prompt = 6
|
||||
Database = 7
|
||||
Variable = 8
|
||||
}
|
||||
|
||||
enum OrderByType {
|
||||
Asc = 1
|
||||
Desc = 2
|
||||
}
|
||||
|
||||
enum PermissionType {
|
||||
NoDetail = 1 //Can't view details
|
||||
Detail = 2 //You can check the details.
|
||||
Operate = 3 //Can be viewed and operated
|
||||
}
|
||||
|
||||
enum SpaceStatus {
|
||||
Valid = 1
|
||||
Invalid = 2
|
||||
}
|
||||
|
||||
struct Space {
|
||||
1: i64 id,
|
||||
2: i64 owner_id,
|
||||
3: SpaceStatus status,
|
||||
4: string name,
|
||||
}
|
||||
32
idl/app/common_struct/intelligence_common_struct.thrift
Normal file
32
idl/app/common_struct/intelligence_common_struct.thrift
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace go app.intelligence.common
|
||||
|
||||
enum IntelligenceStatus {
|
||||
Using = 1,
|
||||
Deleted = 2,
|
||||
Banned = 3,
|
||||
MoveFailed = 4, // Migration failed
|
||||
|
||||
Copying = 5, // Copying
|
||||
CopyFailed = 6, // Copy failed
|
||||
}
|
||||
|
||||
enum IntelligenceType {
|
||||
Bot = 1
|
||||
Project = 2
|
||||
}
|
||||
|
||||
struct IntelligenceBasicInfo {
|
||||
1: i64 id (agw.js_conv="str", api.js_conv="true"),
|
||||
2: string name,
|
||||
3: string description,
|
||||
4: string icon_uri,
|
||||
5: string icon_url,
|
||||
6: i64 space_id (agw.js_conv="str", api.js_conv="true"),
|
||||
7: i64 owner_id (agw.js_conv="str", api.js_conv="true"),
|
||||
8: i64 create_time (agw.js_conv="str", api.js_conv="true"),
|
||||
9: i64 update_time (agw.js_conv="str", api.js_conv="true"),
|
||||
10: IntelligenceStatus status,
|
||||
11: i64 publish_time (agw.js_conv="str", api.js_conv="true"),
|
||||
12: optional string enterprise_id,
|
||||
13: optional i64 organization_id,
|
||||
}
|
||||
5
idl/app/common_struct/task_struct.thrift
Normal file
5
idl/app/common_struct/task_struct.thrift
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace go app.intelligence.common
|
||||
|
||||
struct ProjectInnerTaskInfo {
|
||||
1: i64 task_id (agw.js_conv="str",api.js_conv="true") // Task ID
|
||||
}
|
||||
899
idl/app/developer_api.thrift
Normal file
899
idl/app/developer_api.thrift
Normal file
@@ -0,0 +1,899 @@
|
||||
include "../base.thrift"
|
||||
include "bot_common.thrift"
|
||||
include "../playground/shortcut_command.thrift"
|
||||
|
||||
namespace go app.developer_api
|
||||
|
||||
|
||||
struct DraftBotCreateRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string name
|
||||
3: string description
|
||||
4: string icon_uri
|
||||
5: VisibilityType visibility
|
||||
6: optional MonetizationConf monetization_conf
|
||||
7: optional string create_from, // Create source navi: navbar space: space
|
||||
9: optional bot_common.BusinessType business_type
|
||||
}
|
||||
|
||||
struct MonetizationConf {
|
||||
1: optional bool is_enable
|
||||
}
|
||||
|
||||
enum VisibilityType {
|
||||
Invisible = 0 // invisible
|
||||
Visible = 1 // visible
|
||||
}
|
||||
|
||||
struct DraftBotCreateData {
|
||||
1: i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: bool check_not_pass // True: The machine audit verification failed
|
||||
3: optional string check_not_pass_msg // The machine audit verification failed the copy.
|
||||
}
|
||||
|
||||
struct DraftBotCreateResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required DraftBotCreateData data
|
||||
}
|
||||
|
||||
struct DeleteDraftBotRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
}
|
||||
|
||||
struct DeleteDraftBotData {
|
||||
}
|
||||
|
||||
struct DeleteDraftBotResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required DeleteDraftBotData data
|
||||
}
|
||||
|
||||
struct DuplicateDraftBotRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
}
|
||||
|
||||
struct UserLabel {
|
||||
1: i64 label_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string label_name
|
||||
3: string icon_uri
|
||||
4: string icon_url
|
||||
5: string jump_link
|
||||
}
|
||||
|
||||
struct Creator {
|
||||
1: i64 id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string name // nickname
|
||||
3: string avatar_url
|
||||
4: bool self // Did you create it yourself?
|
||||
5: string user_unique_name // user name
|
||||
6: UserLabel user_label // user tag
|
||||
}
|
||||
|
||||
struct DuplicateDraftBotData {
|
||||
1: i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string name
|
||||
3: Creator user_info
|
||||
}
|
||||
|
||||
struct DuplicateDraftBotResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required DuplicateDraftBotData data
|
||||
}
|
||||
|
||||
struct UpdateDraftBotDisplayInfoResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
}
|
||||
|
||||
struct DraftBotDisplayInfoData {
|
||||
1: optional TabDisplayItems tab_display_info
|
||||
}
|
||||
|
||||
struct UpdateDraftBotDisplayInfoRequest {
|
||||
1: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: optional DraftBotDisplayInfoData display_info
|
||||
3: optional string space_id
|
||||
}
|
||||
|
||||
// draft bot display info
|
||||
enum TabStatus {
|
||||
Default = 0
|
||||
Open = 1
|
||||
Close = 2
|
||||
Hide = 3
|
||||
}
|
||||
|
||||
struct TabDisplayItems {
|
||||
1: optional TabStatus plugin_tab_status
|
||||
2: optional TabStatus workflow_tab_status
|
||||
3: optional TabStatus knowledge_tab_status
|
||||
4: optional TabStatus database_tab_status
|
||||
5: optional TabStatus variable_tab_status
|
||||
6: optional TabStatus opening_dialog_tab_status
|
||||
7: optional TabStatus scheduled_task_tab_status
|
||||
8: optional TabStatus suggestion_tab_status
|
||||
9: optional TabStatus tts_tab_status
|
||||
10: optional TabStatus filebox_tab_status
|
||||
11: optional TabStatus long_term_memory_tab_status
|
||||
12: optional TabStatus answer_action_tab_status
|
||||
13: optional TabStatus imageflow_tab_status
|
||||
14: optional TabStatus background_image_tab_status
|
||||
15: optional TabStatus shortcut_tab_status
|
||||
16: optional TabStatus knowledge_table_tab_status
|
||||
17: optional TabStatus knowledge_text_tab_status
|
||||
18: optional TabStatus knowledge_photo_tab_status
|
||||
19: optional TabStatus hook_info_tab_status
|
||||
20: optional TabStatus default_user_input_tab_status
|
||||
}
|
||||
|
||||
struct GetDraftBotDisplayInfoResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: DraftBotDisplayInfoData data
|
||||
}
|
||||
|
||||
struct GetDraftBotDisplayInfoRequest {
|
||||
1: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
}
|
||||
|
||||
struct PublishDraftBotResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required PublishDraftBotData data
|
||||
}
|
||||
|
||||
struct PublishDraftBotData {
|
||||
1: map<string,list<ConnectorBindResult>> connector_bind_result // Key represents connector_name enumeration Feishu = "feishu" -- obsolete
|
||||
2: map<string,ConnectorBindResult> publish_result // The key represents connector_id, and the value is the published result
|
||||
3: bool check_not_pass // True: The machine audit verification failed
|
||||
4: optional SubmitBotMarketResult submit_bot_market_result // Added bot marketing results
|
||||
5: optional bool hit_manual_check // In human moderation
|
||||
6: optional list<string> not_pass_reason // starlingKey list of reasons why the machine audit failed
|
||||
7: optional bool publish_monetization_result // Publish bot billing results
|
||||
}
|
||||
|
||||
|
||||
struct ConnectorBindResult {
|
||||
1: Connector connector
|
||||
2: i64 code // The status code returned downstream of the publish call is not consumed by the front end.
|
||||
3: string msg // Additional copy of the release status, the front end is parsed in markdown format
|
||||
4: optional PublishResultStatus publish_result_status // post result status
|
||||
}
|
||||
|
||||
struct Connector {
|
||||
1: string name // connector_name enumeration Feishu = "feishu"
|
||||
2: string app_id
|
||||
3: string app_secret
|
||||
4: string share_link
|
||||
5: optional map<string,string> bind_info
|
||||
}
|
||||
|
||||
enum PublishResultStatus {
|
||||
Success = 1 // success
|
||||
Failed = 2 // fail
|
||||
InReview = 3 // in approval
|
||||
}
|
||||
|
||||
struct SubmitBotMarketResult {
|
||||
1: optional i64 result_code // Shelf status, 0-success
|
||||
2: optional string msg // msg
|
||||
}
|
||||
|
||||
|
||||
enum AgentType {
|
||||
Start_Agent = 0
|
||||
LLM_Agent = 1
|
||||
Task_Agent = 2
|
||||
Global_Agent = 3
|
||||
Bot_Agent = 4
|
||||
}
|
||||
|
||||
struct AgentInfo {
|
||||
1: optional string id
|
||||
2: optional AgentType agent_type
|
||||
3: optional string name
|
||||
4: optional AgentPosition position
|
||||
5: optional string icon_uri
|
||||
6: optional list<Intent> intents
|
||||
7: optional AgentWorkInfo work_info
|
||||
8: optional string reference_id
|
||||
9: optional string first_version
|
||||
10: optional string current_version
|
||||
11: optional ReferenceInfoStatus reference_info_status // 1: Available update 2: Removed
|
||||
12: optional string description
|
||||
13: optional ReferenceUpdateType update_type
|
||||
}
|
||||
|
||||
|
||||
enum ReferenceInfoStatus {
|
||||
HasUpdates = 1 // 1: Updates are available
|
||||
IsDelete = 2 // 2: Deleted
|
||||
}
|
||||
|
||||
enum ReferenceUpdateType {
|
||||
ManualUpdate = 1
|
||||
AutoUpdate = 2
|
||||
}
|
||||
|
||||
|
||||
struct AgentPosition {
|
||||
1: double x
|
||||
2: double y
|
||||
}
|
||||
|
||||
struct Intent {
|
||||
1: optional string intent_id
|
||||
2: optional string prompt
|
||||
3: optional string next_agent_id
|
||||
}
|
||||
|
||||
// Information about each module in the agent workspace
|
||||
struct AgentWorkInfo {
|
||||
1: optional string prompt // The agent prompts the front-end information, the server does not need to perceive
|
||||
2: optional string other_info // model configuration
|
||||
3: optional string tools // Plugin information
|
||||
4: optional string dataset // Dataset information
|
||||
5: optional string workflow // Workflow information
|
||||
6: optional string system_info_all // system_info_all with bot
|
||||
7: optional JumpConfig jump_config // backtrack configuration
|
||||
8: optional string suggest_reply , // Referral Configuration
|
||||
9: optional string hook_info // Hook configuration
|
||||
}
|
||||
|
||||
|
||||
struct JumpConfig {
|
||||
1: BacktrackMode backtrack
|
||||
2: RecognitionMode recognition
|
||||
3: optional IndependentModeConfig independent_conf
|
||||
}
|
||||
|
||||
enum BacktrackMode {
|
||||
Current = 1
|
||||
Previous = 2
|
||||
Start = 3
|
||||
MostSuitable = 4
|
||||
}
|
||||
|
||||
enum RecognitionMode {
|
||||
FunctionCall = 1
|
||||
Independent = 2
|
||||
}
|
||||
|
||||
enum IndependentTiming {
|
||||
Pre = 1 // Determine user input (front)
|
||||
Post = 2 // Determine node output (postfix)
|
||||
PreAndPost = 3 // Front mode and rear mode support simultaneous selection
|
||||
}
|
||||
enum IndependentRecognitionModelType {
|
||||
SLM = 0 // Small model
|
||||
LLM = 1 // Large model
|
||||
}
|
||||
struct IndependentModeConfig {
|
||||
1: IndependentTiming judge_timing // Judge timing
|
||||
2: i32 history_round
|
||||
3: IndependentRecognitionModelType model_type
|
||||
4: optional string model_id
|
||||
5: optional string prompt
|
||||
}
|
||||
|
||||
struct BotTagInfo {
|
||||
1: i64 bot_id
|
||||
2: string key // time_capsule
|
||||
3: string value // TimeCapsuleInfo json
|
||||
4: i64 version
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct PublishDraftBotRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
3: WorkInfo work_info
|
||||
4: map<string,list<Connector>> connector_list // Key represents connector_name enumeration Feishu = "feishu" -- obsolete
|
||||
5: map<string,map<string,string>> connectors // The key represents connector_id, and the value is the published parameter
|
||||
6: optional BotMode botMode // Default 0
|
||||
7: optional list<AgentInfo> agents
|
||||
8: optional string canvas_data
|
||||
9: optional list<BotTagInfo> bot_tag_info
|
||||
10: optional SubmitBotMarketConfig submit_bot_market_config // Configuration published to the market
|
||||
11: optional string publish_id
|
||||
12: optional string commit_version // Specify the release of a CommitVersion
|
||||
13: optional PublishType publish_type // Release type, online release/pre-release
|
||||
14: optional string pre_publish_ext // Pre-release other information
|
||||
15: optional string history_info // Replace the history_info in the original workinfo
|
||||
}
|
||||
|
||||
enum PublishType {
|
||||
OnlinePublish = 0
|
||||
PrePublish = 1
|
||||
}
|
||||
|
||||
struct SubmitBotMarketConfig {
|
||||
1: optional bool need_submit // Whether to publish to the market
|
||||
2: optional bool open_source // Is it open source?
|
||||
3: optional string category_id // classification
|
||||
}
|
||||
|
||||
enum BotMode {
|
||||
SingleMode = 0
|
||||
MultiMode = 1
|
||||
WorkflowMode = 2
|
||||
}
|
||||
|
||||
// Information for each module in the workspace
|
||||
struct WorkInfo {
|
||||
1: optional string message_info
|
||||
2: optional string prompt
|
||||
3: optional string variable
|
||||
4: optional string other_info
|
||||
5: optional string history_info
|
||||
6: optional string tools
|
||||
7: optional string system_info_all
|
||||
8: optional string dataset
|
||||
9: optional string onboarding
|
||||
10: optional string profile_memory
|
||||
11: optional string table_info
|
||||
12: optional string workflow
|
||||
13: optional string task
|
||||
14: optional string suggest_reply
|
||||
15: optional string tts
|
||||
16: optional string background_image_info_list
|
||||
17: optional shortcut_command.ShortcutStruct shortcuts // Quick Instruction
|
||||
18: optional string hook_info // Hook configuration
|
||||
19: optional UserQueryCollectConf user_query_collect_conf // User query collection configuration
|
||||
20: optional LayoutInfo layout_info //Workflow pattern orchestration data
|
||||
}
|
||||
|
||||
struct UserQueryCollectConf {
|
||||
1: bool IsCollected (api.body="is_collected") , // Whether to turn on the collection switch
|
||||
2: string PrivatePolicy (api.body="private_policy") , // Privacy Policy Link
|
||||
}
|
||||
|
||||
struct LayoutInfo {
|
||||
1: string WorkflowId (api.body="workflow_id") , // workflowId
|
||||
2: string PluginId (api.body="plugin_id") , // PluginId
|
||||
}
|
||||
|
||||
enum HistoryType {
|
||||
SUBMIT = 1 // abandoned
|
||||
FLAG = 2 // publish
|
||||
COMMIT = 4 // submit
|
||||
COMMITANDFLAG = 5 // Submit and publish
|
||||
}
|
||||
|
||||
|
||||
struct ListDraftBotHistoryRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required i64 bot_id (agw.js_conv="str", api.js_conv="true")
|
||||
3: required i32 page_index
|
||||
4: required i32 page_size
|
||||
5: required HistoryType history_type
|
||||
6: optional string connector_id
|
||||
}
|
||||
|
||||
struct ListDraftBotHistoryResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required ListDraftBotHistoryData data
|
||||
}
|
||||
|
||||
struct ListDraftBotHistoryData {
|
||||
1: list<HistoryInfo> history_infos
|
||||
2: i32 total
|
||||
}
|
||||
|
||||
// If historical information is preserved
|
||||
struct HistoryInfo {
|
||||
1: string version ,
|
||||
2: HistoryType history_type ,
|
||||
3: string info , // Additional information added to the historical record
|
||||
4: string create_time ,
|
||||
5: list<ConnectorInfo> connector_infos,
|
||||
6: Creator creator ,
|
||||
7: optional string publish_id ,
|
||||
8: optional string commit_remark , // Instructions to fill in when submitting
|
||||
}
|
||||
|
||||
struct ConnectorInfo {
|
||||
1: string id
|
||||
2: string name
|
||||
3: string icon
|
||||
4: ConnectorDynamicStatus connector_status
|
||||
5: optional string share_link
|
||||
}
|
||||
|
||||
|
||||
enum ConnectorDynamicStatus {
|
||||
Normal = 0
|
||||
Offline = 1
|
||||
TokenDisconnect = 2
|
||||
}
|
||||
|
||||
enum IconType {
|
||||
Bot = 1
|
||||
User = 2
|
||||
Plugin = 3
|
||||
Dataset = 4
|
||||
Space = 5
|
||||
Workflow = 6
|
||||
Imageflow = 7
|
||||
Society = 8
|
||||
Connector = 9
|
||||
ChatFlow = 10
|
||||
Voice = 11
|
||||
Enterprise = 12
|
||||
}
|
||||
|
||||
struct GetIconRequest {
|
||||
1: IconType icon_type
|
||||
}
|
||||
|
||||
struct Icon {
|
||||
1: string url
|
||||
2: string uri
|
||||
}
|
||||
|
||||
struct GetIconResponseData {
|
||||
1: list<Icon> icon_list
|
||||
}
|
||||
struct GetIconResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: GetIconResponseData data
|
||||
}
|
||||
struct GetUploadAuthTokenResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: GetUploadAuthTokenData data
|
||||
}
|
||||
|
||||
struct GetUploadAuthTokenData {
|
||||
1: string service_id
|
||||
2: string upload_path_prefix
|
||||
3: UploadAuthTokenInfo auth
|
||||
4: string upload_host
|
||||
5: string schema
|
||||
}
|
||||
struct UploadAuthTokenInfo {
|
||||
1: string access_key_id
|
||||
2: string secret_access_key
|
||||
3: string session_token
|
||||
4: string expired_time
|
||||
5: string current_time
|
||||
}
|
||||
|
||||
struct GetUploadAuthTokenRequest {
|
||||
1: string scene
|
||||
2: string data_type
|
||||
}
|
||||
|
||||
struct UploadFileRequest {
|
||||
1: CommonFileInfo file_head // Document related description
|
||||
2: string data // file data
|
||||
}
|
||||
|
||||
// Upload file, file header
|
||||
struct CommonFileInfo {
|
||||
1: string file_type // File type, suffix
|
||||
2: FileBizType biz_type // business type
|
||||
}
|
||||
|
||||
enum FileBizType {
|
||||
BIZ_UNKNOWN = 0
|
||||
BIZ_BOT_ICON = 1
|
||||
BIZ_BOT_DATASET = 2
|
||||
BIZ_DATASET_ICON = 3
|
||||
BIZ_PLUGIN_ICON = 4
|
||||
BIZ_BOT_SPACE = 5
|
||||
BIZ_BOT_WORKFLOW = 6
|
||||
BIZ_SOCIETY_ICON = 7
|
||||
BIZ_CONNECTOR_ICON = 8
|
||||
BIZ_LIBRARY_VOICE_ICON = 9
|
||||
BIZ_ENTERPRISE_ICON = 10
|
||||
}
|
||||
|
||||
struct UploadFileResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: UploadFileData data // data
|
||||
}
|
||||
|
||||
struct GetTypeListRequest {
|
||||
1: optional bool model
|
||||
2: optional bool voice
|
||||
3: optional bool raw_model
|
||||
4: optional string space_id
|
||||
5: optional string cur_model_id // The model ID used by the current bot to handle issues that cannot be displayed by the bot model synchronized by cici/doubao
|
||||
6: optional list<string> cur_model_ids // Compatible with MultiAgent, with multiple cur_model_id
|
||||
7: optional ModelScene model_scene // model scenario
|
||||
}
|
||||
|
||||
enum ModelScene {
|
||||
Douyin = 1
|
||||
}
|
||||
|
||||
enum ModelClass {
|
||||
GPT = 1
|
||||
SEED = 2
|
||||
Claude = 3
|
||||
MiniMax = 4 // name: MiniMax
|
||||
Plugin = 5
|
||||
StableDiffusion = 6
|
||||
ByteArtist = 7
|
||||
Maas = 9
|
||||
QianFan = 10 // Abandoned: Qianfan (Baidu Cloud)
|
||||
Gemini = 11 // name:Google Gemini
|
||||
Moonshot = 12 // name: Moonshot
|
||||
GLM = 13 // Name: Zhipu
|
||||
MaaSAutoSync = 14 // Name: Volcano Ark
|
||||
QWen = 15 // Name: Tongyi Qianwen
|
||||
Cohere = 16 // name: Cohere
|
||||
Baichuan = 17 // Name: Baichuan Intelligent
|
||||
Ernie = 18 // Name: ERNIE Bot
|
||||
DeekSeek = 19 // Name: Magic Square
|
||||
Llama = 20 // name: Llama
|
||||
StepFun = 23
|
||||
Other = 999
|
||||
}
|
||||
|
||||
struct ModelQuota {
|
||||
1: i32 token_limit // Maximum total number of tokens
|
||||
2: i32 token_resp // Final reply maximum number of tokens
|
||||
3: i32 token_system // Prompt system maximum number of tokens
|
||||
4: i32 token_user_in // Prompt user to enter maximum number of tokens
|
||||
5: i32 token_tools_in // Prompt tool to enter maximum number of tokens
|
||||
6: i32 token_tools_out // Prompt tool output maximum number of tokens
|
||||
7: i32 token_data // Prompt data maximum number of tokens
|
||||
8: i32 token_history // Prompt history maximum number of tokens
|
||||
9: bool token_cut_switch // Prompt history maximum number of tokens
|
||||
10: double price_in // input cost
|
||||
11: double price_out // output cost
|
||||
12: optional i32 system_prompt_limit // Systemprompt input restrictions, if not passed, no input restrictions
|
||||
}
|
||||
|
||||
enum ModelTagClass {
|
||||
ModelType = 1
|
||||
ModelUserRight = 2
|
||||
ModelFeature = 3
|
||||
ModelFunction = 4
|
||||
|
||||
Custom = 20 // Do not do this issue
|
||||
Others = 100
|
||||
}
|
||||
|
||||
enum ModelParamType {
|
||||
Float = 1
|
||||
Int = 2
|
||||
Boolean = 3
|
||||
String = 4
|
||||
}
|
||||
|
||||
struct ModelParamDefaultValue {
|
||||
1: required string default_val
|
||||
2: optional string creative
|
||||
3: optional string balance
|
||||
4: optional string precise
|
||||
}
|
||||
|
||||
struct ModelParamClass {
|
||||
1: i32 class_id // 1="Generation diversity", 2="Input and output length", 3="Output format"
|
||||
2: string label
|
||||
}
|
||||
|
||||
struct Option {
|
||||
1: string label // The value displayed by the option
|
||||
2: string value // Filled in value
|
||||
}
|
||||
|
||||
struct ModelParameter {
|
||||
1: required string name // Configuration fields, such as max_tokens
|
||||
2: string label // Configure field display name
|
||||
3: string desc // Configuration field detail description
|
||||
4: required ModelParamType type // type
|
||||
5: string min // Numerical type parameters, the minimum value allowed to be set
|
||||
6: string max // Numerical type parameter, the maximum value allowed to be set
|
||||
7: i32 precision // Precision of float type parameters
|
||||
8: required ModelParamDefaultValue default_val // Parameter default {"default": xx, "creative": xx}
|
||||
9: list<Option> options // Enumeration values such as response_format support text, markdown, json
|
||||
10: ModelParamClass param_class // Parameter classification, "Generation diversity", "Input and output length", "Output format"
|
||||
}
|
||||
|
||||
struct ModelDescGroup {
|
||||
1: string group_name
|
||||
2: list<string> desc
|
||||
}
|
||||
|
||||
struct ModelTag {
|
||||
1: string tag_name
|
||||
2: ModelTagClass tag_class
|
||||
3: string tag_icon
|
||||
4: string tag_descriptions
|
||||
}
|
||||
|
||||
struct ModelSeriesInfo {
|
||||
1: string series_name,
|
||||
2: string icon_url,
|
||||
3: string model_vendor,
|
||||
4: optional string model_tips,
|
||||
}
|
||||
|
||||
enum ModelTagValue {
|
||||
Flagship = 1,
|
||||
HighSpeed = 2,
|
||||
ToolInvocation = 3,
|
||||
RolePlaying = 4,
|
||||
LongText = 5,
|
||||
ImageUnderstanding = 6,
|
||||
Reasoning = 7,
|
||||
VideoUnderstanding = 8,
|
||||
CostPerformance = 9,
|
||||
CodeSpecialization = 10,
|
||||
AudioUnderstanding = 11
|
||||
}
|
||||
|
||||
struct ModelStatusDetails {
|
||||
1: bool is_new_model, // Is it a new model?
|
||||
2: bool is_advanced_model, // Is it a high-level model?
|
||||
3: bool is_free_model, // Is it a free model?
|
||||
|
||||
11: bool is_upcoming_deprecated, // Will it be removed from the shelves soon?
|
||||
12: string deprecated_date, // removal date
|
||||
13: string replace_model_name, // Remove the replacement model from the shelves.
|
||||
|
||||
21: string update_info, // Recently updated information
|
||||
22: ModelTagValue model_feature, // Model Features
|
||||
}
|
||||
|
||||
struct ModelAbility {
|
||||
1: optional bool cot_display // Do you want to show cot?
|
||||
2: optional bool function_call // Supports function calls
|
||||
3: optional bool image_understanding // Does it support picture understanding?
|
||||
4: optional bool video_understanding // Does it support video understanding?
|
||||
5: optional bool audio_understanding // Does it support audio understanding?
|
||||
6: optional bool support_multi_modal // Does it support multimodality?
|
||||
7: optional bool prefill_resp // Whether to support continuation
|
||||
}
|
||||
|
||||
struct Model {
|
||||
1: string name
|
||||
2: i64 model_type
|
||||
3: ModelClass model_class
|
||||
4: string model_icon // Model icon url
|
||||
5: double model_input_price
|
||||
6: double model_output_price
|
||||
7: ModelQuota model_quota
|
||||
8: string model_name // Model real name, front-end calculation token
|
||||
9: string model_class_name
|
||||
10: bool is_offline
|
||||
11: list<ModelParameter> model_params
|
||||
12: optional list<ModelDescGroup> model_desc
|
||||
13: optional map<bot_common.ModelFuncConfigType, bot_common.ModelFuncConfigStatus> func_config, // model function configuration
|
||||
14: optional string endpoint_name // Ark model node name
|
||||
15: optional list<ModelTag> model_tag_list // model label
|
||||
16: optional bool is_up_required // User prompt must have and cannot be empty
|
||||
17: string model_brief_desc // Model brief description
|
||||
18: ModelSeriesInfo model_series // Model series
|
||||
19: ModelStatusDetails model_status_details // model state
|
||||
20: ModelAbility model_ability // model capability
|
||||
}
|
||||
|
||||
struct VoiceType {
|
||||
1: i64 id
|
||||
2: string model_name
|
||||
3: string name
|
||||
4: string language
|
||||
5: string style_id
|
||||
6: string style_name
|
||||
}
|
||||
|
||||
struct GetTypeListData {
|
||||
1: list<Model> model_list
|
||||
2: list<VoiceType> voice_list
|
||||
3: list<Model> raw_model_list
|
||||
}
|
||||
|
||||
struct GetTypeListResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: required GetTypeListData data
|
||||
}
|
||||
|
||||
struct UploadFileData {
|
||||
1: string upload_url // File URL
|
||||
2: string upload_uri // File URI, submit using this
|
||||
}
|
||||
|
||||
struct UpdateUserProfileCheckRequest {
|
||||
1: optional string user_unique_name
|
||||
}
|
||||
|
||||
struct UpdateUserProfileCheckResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
}
|
||||
|
||||
enum CommitStatus {
|
||||
Undefined = 0
|
||||
Uptodate = 1 // It is the latest, the same as the main draft
|
||||
Behind = 2 // Behind the main draft
|
||||
NoDraftReplica = 3 // No personal draft
|
||||
}
|
||||
|
||||
struct Committer {
|
||||
1: optional string id
|
||||
2: optional string name
|
||||
3: optional string commit_time
|
||||
}
|
||||
|
||||
// Check if the draft can be submitted and returned.
|
||||
struct CheckDraftBotCommitResponse {
|
||||
1: optional i64 code
|
||||
2: optional string msg
|
||||
3: optional CheckDraftBotCommitData data
|
||||
}
|
||||
|
||||
struct CheckDraftBotCommitData {
|
||||
1: optional CommitStatus status
|
||||
2: optional string base_commit_version // master draft version
|
||||
3: optional Committer base_committer // Master Draft Submission Information
|
||||
4: optional string commit_version // Personal draft version
|
||||
}
|
||||
|
||||
// Check if the draft can be submitted to the request
|
||||
struct CheckDraftBotCommitRequest {
|
||||
1: required string space_id
|
||||
2: required string bot_id
|
||||
3: optional string commit_version
|
||||
}
|
||||
|
||||
|
||||
struct GetOnboardingRequest {
|
||||
1: string bot_id
|
||||
2: string bot_prompt
|
||||
}
|
||||
|
||||
|
||||
struct GetOnboardingResponseData {
|
||||
1: OnboardingContent onboarding_content
|
||||
}
|
||||
struct GetOnboardingResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: GetOnboardingResponseData data
|
||||
}
|
||||
|
||||
struct OnboardingContent {
|
||||
1: optional string prologue // opening statement
|
||||
2: optional list<string> suggested_questions // suggestion question
|
||||
}
|
||||
|
||||
|
||||
|
||||
enum ConfigStatus {
|
||||
Configured = 1 // Configured
|
||||
NotConfigured = 2 // Not configured
|
||||
Disconnected = 3 // Token changes
|
||||
Configuring = 4 // Configuring, authorizing
|
||||
NeedReconfiguring = 5 // Need to reconfigure
|
||||
}
|
||||
enum BindType {
|
||||
NoBindRequired = 1 // No binding required
|
||||
AuthBind = 2 // Auth binding
|
||||
KvBind = 3 // Kv binding =
|
||||
KvAuthBind = 4 // Kv and Auth authorization
|
||||
ApiBind = 5 // API channel binding
|
||||
WebSDKBind = 6
|
||||
StoreBind = 7
|
||||
AuthAndConfig = 8 // One button each for authorization and configuration
|
||||
}
|
||||
enum AllowPublishStatus {
|
||||
Allowed = 0
|
||||
Forbid = 1
|
||||
}
|
||||
struct AuthLoginInfo {
|
||||
1: string app_id
|
||||
2: string response_type
|
||||
3: string authorize_url
|
||||
4: string scope
|
||||
5: string client_id
|
||||
6: string duration
|
||||
7: string aid
|
||||
8: string client_key
|
||||
}
|
||||
|
||||
enum BotConnectorStatus {
|
||||
Normal = 0 // Normal
|
||||
InReview = 1 // Under review.
|
||||
Offline = 2 // offline
|
||||
}
|
||||
enum UserAuthStatus {
|
||||
Authorized = 1 // Authorized
|
||||
UnAuthorized = 2 // unauthorized
|
||||
Authorizing = 3 // Authorizing
|
||||
}
|
||||
|
||||
struct PublishConnectorListRequest {
|
||||
1: required i64 space_id (api.js_conv="true")
|
||||
2: required i64 bot_id (api.js_conv="true")
|
||||
3: optional string commit_version
|
||||
}
|
||||
|
||||
struct PublishConnectorInfo {
|
||||
1: required string id // Publishing Platform connector_id
|
||||
2: required string name // publishing platform name
|
||||
3: required string icon // publishing platform icon
|
||||
4: required string desc // Publish Platform Description
|
||||
5: required string share_link // share link
|
||||
6: required ConfigStatus config_status // Configuration Status 1: Bound 2: Unbound
|
||||
7: required i64 last_publish_time // Last Post
|
||||
8: required BindType bind_type // Binding type 1: No binding required 2: Auth 3: kv value
|
||||
9: required map<string,string> bind_info // Binding information key field name value is value
|
||||
10: optional string bind_id // Bind id information for unbinding and use
|
||||
11: optional AuthLoginInfo auth_login_info // user authorization login information
|
||||
12: optional bool is_last_published // Is it the last release?
|
||||
13: optional BotConnectorStatus connector_status // bot channel status
|
||||
14: optional string privacy_policy // Privacy Policy
|
||||
15: optional string user_agreement // User Agreement
|
||||
16: optional AllowPublishStatus allow_punish // Is the channel allowed to publish?
|
||||
17: optional string not_allow_reason // Reason for not allowing posting
|
||||
18: optional string config_status_toast // Configuration status toast
|
||||
19: optional i64 brand_id // Brand ID
|
||||
20: optional bool support_monetization // Support commercialization
|
||||
21: optional UserAuthStatus auth_status // 1: Authorized, 2: Unauthorized. Currently this field is only available bind_type == 8
|
||||
22: optional string to_complete_info_url // URL of the complete info button
|
||||
}
|
||||
|
||||
struct SubmitBotMarketOption {
|
||||
1: optional bool can_open_source // Is it possible to publicly orchestrate?
|
||||
}
|
||||
|
||||
|
||||
struct ConnectorBrandInfo {
|
||||
1: required i64 id
|
||||
2: required string name
|
||||
3: required string icon
|
||||
}
|
||||
|
||||
struct PublishTips {
|
||||
1: optional string cost_tips // cost-bearing reminder
|
||||
}
|
||||
|
||||
struct PublishConnectorListResponse {
|
||||
1: i64 code
|
||||
2: string msg
|
||||
3: list<PublishConnectorInfo> publish_connector_list
|
||||
4: optional SubmitBotMarketOption submit_bot_market_option
|
||||
5: optional SubmitBotMarketConfig last_submit_config // The configuration of the last submitted market
|
||||
6: map<i64, ConnectorBrandInfo> connector_brand_info_map // Channel brand information
|
||||
7: optional PublishTips publish_tips // post alert
|
||||
}
|
||||
|
||||
service DeveloperApiService {
|
||||
|
||||
GetUploadAuthTokenResponse GetUploadAuthToken(1: GetUploadAuthTokenRequest request)(api.post = '/api/playground/upload/auth_token', api.category="playground", api.gen_path="playground")
|
||||
|
||||
DeleteDraftBotResponse DeleteDraftBot(1:DeleteDraftBotRequest request)(api.post='/api/draftbot/delete', api.category="draftbot", api.gen_path="draftbot")
|
||||
DuplicateDraftBotResponse DuplicateDraftBot(1:DuplicateDraftBotRequest request)(api.post='/api/draftbot/duplicate', api.category="draftbot", api.gen_path="draftbot")
|
||||
CheckDraftBotCommitResponse CheckDraftBotCommit(1:CheckDraftBotCommitRequest request)(api.post='/api/draftbot/commit_check', api.category="draftbot", api.gen_path="draftbot")
|
||||
GetOnboardingResponse GetOnboarding(1:GetOnboardingRequest request)(api.post='/api/playground/get_onboarding', api.category="playground", api.gen_path="playground")
|
||||
PublishConnectorListResponse PublishConnectorList(1:PublishConnectorListRequest request)(api.post='/api/draftbot/publish/connector/list', api.category="draftbot", api.gen_path="draftbot")
|
||||
|
||||
DraftBotCreateResponse DraftBotCreate(1:DraftBotCreateRequest request)(api.post='/api/draftbot/create', api.category="draftbot", api.gen_path="draftbot")
|
||||
UpdateDraftBotDisplayInfoResponse UpdateDraftBotDisplayInfo(1:UpdateDraftBotDisplayInfoRequest request)(api.post='/api/draftbot/update_display_info', api.category="draftbot", api.gen_path="draftbot")
|
||||
GetDraftBotDisplayInfoResponse GetDraftBotDisplayInfo(1:GetDraftBotDisplayInfoRequest request)(api.post='/api/draftbot/get_display_info', api.category="draftbot", api.gen_path="draftbot")
|
||||
PublishDraftBotResponse PublishDraftBot(1:PublishDraftBotRequest request)(api.post='/api/draftbot/publish', api.category="draftbot", api.gen_path="draftbot")
|
||||
ListDraftBotHistoryResponse ListDraftBotHistory(1:ListDraftBotHistoryRequest request)(api.post='/api/draftbot/list_draft_history', api.category="draftbot", api.gen_path="draftbot")
|
||||
|
||||
UploadFileResponse UploadFile(1:UploadFileRequest request)(api.post='/api/bot/upload_file', api.category="bot" api.gen_path="bot")
|
||||
GetTypeListResponse GetTypeList(1: GetTypeListRequest request)(api.post='/api/bot/get_type_list', api.category="bot", api.gen_path="bot")
|
||||
|
||||
GetIconResponse GetIcon(1:GetIconRequest request)(api.post='/api/developer/get_icon', api.category="developer", api.gen_path="developer")
|
||||
|
||||
UpdateUserProfileCheckResponse UpdateUserProfileCheck(1: UpdateUserProfileCheckRequest request)(api.post='/api/user/update_profile_check', api.category="user", api.gen_path="user")
|
||||
|
||||
}
|
||||
31
idl/app/intelligence.thrift
Normal file
31
idl/app/intelligence.thrift
Normal file
@@ -0,0 +1,31 @@
|
||||
include "../base.thrift"
|
||||
include "search.thrift"
|
||||
include "common_struct/intelligence_common_struct.thrift"
|
||||
include "common_struct/common_struct.thrift"
|
||||
include "project.thrift"
|
||||
include "publish.thrift"
|
||||
include "task.thrift"
|
||||
|
||||
namespace go app.intelligence
|
||||
|
||||
service IntelligenceService {
|
||||
project.DraftProjectCreateResponse DraftProjectCreate(1: project.DraftProjectCreateRequest request)(api.post='/api/intelligence_api/draft_project/create', api.category="draft_project",agw.preserve_base="true")
|
||||
project.DraftProjectUpdateResponse DraftProjectUpdate(1: project.DraftProjectUpdateRequest request)(api.post='/api/intelligence_api/draft_project/update', api.category="draft_project",agw.preserve_base="true")
|
||||
project.DraftProjectDeleteResponse DraftProjectDelete(1: project.DraftProjectDeleteRequest request)(api.post='/api/intelligence_api/draft_project/delete', api.category="draft_project",agw.preserve_base="true")
|
||||
project.DraftProjectCopyResponse DraftProjectCopy(1: project.DraftProjectCopyRequest request)(api.post='/api/intelligence_api/draft_project/copy', api.category="draft_project",agw.preserve_base="true")
|
||||
|
||||
task.DraftProjectInnerTaskListResponse DraftProjectInnerTaskList(1: task.DraftProjectInnerTaskListRequest request)(api.post='/api/intelligence_api/draft_project/inner_task_list', api.category="draft_project",agw.preserve_base="true")
|
||||
|
||||
search.GetDraftIntelligenceListResponse GetDraftIntelligenceList(1: search.GetDraftIntelligenceListRequest req) (api.post='/api/intelligence_api/search/get_draft_intelligence_list', api.category="search",agw.preserve_base="true")
|
||||
search.GetDraftIntelligenceInfoResponse GetDraftIntelligenceInfo(1: search.GetDraftIntelligenceInfoRequest req) (api.post='/api/intelligence_api/search/get_draft_intelligence_info', api.category="search",agw.preserve_base="true")
|
||||
search.GetUserRecentlyEditIntelligenceResponse GetUserRecentlyEditIntelligence(1: search.GetUserRecentlyEditIntelligenceRequest req) (api.post='/api/intelligence_api/search/get_recently_edit_intelligence', api.category="search",agw.preserve_base="true")
|
||||
|
||||
publish.PublishConnectorListResponse ProjectPublishConnectorList(1: publish.PublishConnectorListRequest request)(api.post='/api/intelligence_api/publish/connector_list', api.category="publish",agw.preserve_base="true")
|
||||
publish.GetProjectPublishedConnectorResponse GetProjectPublishedConnector(1: publish.GetProjectPublishedConnectorRequest request) (api.post='/api/intelligence_api/publish/get_published_connector', api.category="publish",agw.preserve_base="true")
|
||||
publish.CheckProjectVersionNumberResponse CheckProjectVersionNumber(1: publish.CheckProjectVersionNumberRequest request)(api.post='/api/intelligence_api/publish/check_version_number', api.category="publish",agw.preserve_base="true")
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
90
idl/app/project.thrift
Normal file
90
idl/app/project.thrift
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace go app.intelligence.project
|
||||
include "../base.thrift"
|
||||
include "common_struct/intelligence_common_struct.thrift"
|
||||
include "common_struct/common_struct.thrift"
|
||||
|
||||
struct DraftProjectCreateRequest {
|
||||
1 : i64 space_id (agw.js_conv="str", api.js_conv="true"),
|
||||
2 : string name ,
|
||||
3 : string description,
|
||||
4 : string icon_uri ,
|
||||
5 : optional MonetizationConf monetization_conf,
|
||||
6 : optional string create_from, // Create source navi: navbar space: space
|
||||
|
||||
|
||||
255: optional base.Base Base (api.none="true") ,
|
||||
}
|
||||
|
||||
struct MonetizationConf {
|
||||
1: optional bool is_enable
|
||||
}
|
||||
|
||||
struct DraftProjectCreateResponse {
|
||||
1 : DraftProjectCreateData data
|
||||
|
||||
253: required i64 code,
|
||||
254: required string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectCreateData {
|
||||
1: i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: common_struct.AuditData audit_data
|
||||
}
|
||||
|
||||
struct DraftProjectUpdateRequest {
|
||||
1 : required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
2 : optional string name
|
||||
3 : optional string description
|
||||
4 : optional string icon_uri
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectUpdateResponse {
|
||||
1 : DraftProjectUpdateData data
|
||||
|
||||
253: required i64 code,
|
||||
254: required string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectUpdateData {
|
||||
1 : common_struct.AuditData audit_data
|
||||
}
|
||||
|
||||
struct DraftProjectDeleteRequest {
|
||||
1 : required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectDeleteResponse {
|
||||
|
||||
253: required i64 code,
|
||||
254: required string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectCopyRequest {
|
||||
1 : i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
3 : i64 to_space_id (agw.js_conv="str", api.js_conv="true")
|
||||
4 : string name ,
|
||||
5 : string description,
|
||||
6 : string icon_uri ,
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectCopyResponse {
|
||||
1 : DraftProjectCopyResponseData data
|
||||
|
||||
253: required i64 code,
|
||||
254: required string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectCopyResponseData {
|
||||
1 : intelligence_common_struct.IntelligenceBasicInfo basic_info
|
||||
2 : common_struct.AuditData audit_data
|
||||
3 : common_struct.User user_info
|
||||
}
|
||||
269
idl/app/publish.thrift
Normal file
269
idl/app/publish.thrift
Normal file
@@ -0,0 +1,269 @@
|
||||
namespace go app.intelligence.publish
|
||||
include "../base.thrift"
|
||||
include "common_struct/common_struct.thrift"
|
||||
include "common_struct/intelligence_common_struct.thrift"
|
||||
|
||||
struct GetProjectPublishedConnectorRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct GetProjectPublishedConnectorResponse {
|
||||
1: list<common_struct.ConnectorInfo> data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishConnectorListRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishConnectorListResponse {
|
||||
1: PublishConnectorListData data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishConnectorListData {
|
||||
1: list<PublishConnectorInfo> connector_list
|
||||
2: LastPublishInfo last_publish_info
|
||||
3: map<i64, ConnectorUnionInfo> connector_union_info_map // Channel collection information, the key is connector_union_id
|
||||
}
|
||||
|
||||
struct PublishConnectorInfo {
|
||||
1: required i64 id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required string name
|
||||
3: required string icon_url
|
||||
4: required string description // describe
|
||||
5: string description_extra // description extension
|
||||
6: required ConnectorClassification connector_classification // channel type
|
||||
7: required ConnectorConfigStatus config_status // configuration status
|
||||
8: ConnectorStatus connector_status // channel status
|
||||
9: required ConnectorBindType bind_type // binding type
|
||||
10: required map<string,string> bind_info // Binding information key field name value is value
|
||||
11: optional string bind_id // Bind id information for unbinding and use
|
||||
12: optional AuthLoginInfo auth_login_info // user authorization login information
|
||||
13: string privacy_policy // Privacy Policy
|
||||
14: string user_agreement // User Agreement
|
||||
15: bool allow_publish // Whether to allow publishing
|
||||
16: optional string not_allow_publish_reason // Reasons for not allowing publishing
|
||||
17: optional i64 connector_union_id (agw.js_conv="str", api.js_conv="true") // Channel collection id, indicating the channel that needs to be aggregated and displayed.
|
||||
18: optional list<UIOption> UIOptions // UI Options
|
||||
19: optional bool support_monetization // Support commercialization
|
||||
20: optional string installation_guide // Installation Guidelines
|
||||
21: optional UserAuthStatus auth_status // Currently this field is only available bind_type == 8
|
||||
22: optional string config_status_toast // Configuration status toast
|
||||
23: optional string to_complete_info_url // connector_status the URL of the Complete Info button while under review
|
||||
24: optional string connector_tips // Channel release tips
|
||||
}
|
||||
|
||||
struct LastPublishInfo {
|
||||
1: string version_number
|
||||
2: list<i64> connector_ids (agw.js_conv="str", api.js_conv="true")
|
||||
3: map<i64,ConnectorPublishConfig> connector_publish_config // channel release configuration
|
||||
}
|
||||
|
||||
enum ConnectorClassification {
|
||||
APIOrSDK = 1 // API or SDK
|
||||
SocialPlatform = 2 // social platform
|
||||
Coze = 3 // Coze Shop/Template
|
||||
MiniProgram = 4 // Mini Program
|
||||
CozeSpaceExtensionLibrary = 5 // MCP Extension Library
|
||||
}
|
||||
|
||||
enum ConnectorConfigStatus {
|
||||
Configured = 1 // Configured
|
||||
NotConfigured = 2 // Not configured
|
||||
Disconnected = 3 // Token changes
|
||||
Configuring = 4 // Configuring, authorizing
|
||||
NeedReconfiguring = 5 // Need to reconfigure
|
||||
}
|
||||
|
||||
enum ConnectorStatus {
|
||||
Normal = 0 // Normal
|
||||
InReview = 1 // Under review.
|
||||
Offline = 2 // offline
|
||||
}
|
||||
|
||||
struct ConnectorUnionInfo {
|
||||
1: required i64 id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required string name
|
||||
3: required string description
|
||||
4: required string icon_url
|
||||
5: required list<ConnectorUnionInfoOption> connector_options
|
||||
}
|
||||
|
||||
enum ConnectorBindType {
|
||||
NoBindRequired = 1 // No binding required
|
||||
AuthBind = 2 // Auth binding
|
||||
KvBind = 3 // Kv binding
|
||||
KvAuthBind = 4 // Kv and Auth authorization
|
||||
ApiBind = 5 // API channel binding
|
||||
WebSDKBind = 6
|
||||
StoreBind = 7
|
||||
AuthAndConfig = 8 // One button each for authorization and configuration
|
||||
TemplateBind = 9 // template channel binding
|
||||
}
|
||||
|
||||
struct AuthLoginInfo {
|
||||
1: string app_id
|
||||
2: string response_type
|
||||
3: string authorize_url
|
||||
4: string scope
|
||||
5: string client_id
|
||||
6: string duration
|
||||
7: string aid
|
||||
8: string client_key
|
||||
}
|
||||
|
||||
struct UIOption {
|
||||
1: i64 ui_channel (agw.js_conv="str", api.js_conv="true") // UIChannel Options
|
||||
2: bool available // Is it optional
|
||||
3: string unavailable_reason // unselectable reason
|
||||
}
|
||||
|
||||
enum UserAuthStatus {
|
||||
Authorized = 1 // Authorized
|
||||
UnAuthorized = 2 // unauthorized
|
||||
Authorizing = 3 // Authorizing
|
||||
}
|
||||
|
||||
struct ConnectorPublishConfig {
|
||||
1: list<SelectedWorkflow> selected_workflows // Workflow/ChatFlow selected by publishing channel
|
||||
}
|
||||
|
||||
struct ConnectorUnionInfoOption {
|
||||
1: required i64 connector_id (agw.js_conv="str", api.js_conv="true") // Channel ID
|
||||
2: required string show_name // Display name, such as: hosted release, download code
|
||||
}
|
||||
|
||||
struct SelectedWorkflow {
|
||||
1: i64 workflow_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string workflow_name
|
||||
}
|
||||
|
||||
struct CheckProjectVersionNumberRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required string version_number
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct CheckProjectVersionNumberResponse {
|
||||
1: CheckProjectVersionNumberData data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct CheckProjectVersionNumberData {
|
||||
1: bool is_duplicate
|
||||
}
|
||||
|
||||
struct PublishProjectRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: required string version_number // version number
|
||||
3: optional string description // describe
|
||||
4: optional map<i64,map<string,string>> connectors // The key represents connector_id, and the value is the parameter published by the channel
|
||||
5: optional map<i64,ConnectorPublishConfig> connector_publish_config // Channel release configuration, key represents connector_id
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishProjectResponse {
|
||||
1: PublishProjectData data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishProjectData {
|
||||
1: i64 publish_record_id (agw.js_conv="str", api.js_conv="true") // Publish record ID for front-end polling
|
||||
2: optional bool publish_monetization_result // The charging configuration is released, and the overseas environment is only available.
|
||||
}
|
||||
|
||||
struct GetPublishRecordListRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct GetPublishRecordListResponse {
|
||||
1: list<PublishRecordDetail> data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct PublishRecordDetail {
|
||||
1: i64 publish_record_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string version_number
|
||||
3: PublishRecordStatus publish_status // release status
|
||||
4: string publish_status_msg // This field is deprecated, please use publish_status_detail
|
||||
5: optional list<ConnectorPublishResult> connector_publish_result // Channel release results
|
||||
6: optional PublishRecordStatusDetail publish_status_detail // Release status Supplementary information
|
||||
}
|
||||
|
||||
enum PublishRecordStatus {
|
||||
Packing = 0 // Packing
|
||||
PackFailed = 1 // Packaging failed
|
||||
Auditing = 2 // Under review.
|
||||
AuditNotPass = 3 // review disapproved
|
||||
ConnectorPublishing = 4 // Channel is being released.
|
||||
PublishDone = 5 // release complete
|
||||
}
|
||||
|
||||
struct ConnectorPublishResult {
|
||||
1: i64 connector_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: string connector_name
|
||||
3: string connector_icon_url
|
||||
4: ConnectorPublishStatus connector_publish_status // channel release status
|
||||
5: string connector_publish_status_msg // Channel Release Status Supplementary Information
|
||||
6: optional string share_link // OpenIn Link
|
||||
7: optional string download_link // Mini Program Channel Download Link
|
||||
8: optional ConnectorPublishConfig connector_publish_config // channel release configuration
|
||||
9: optional map<string,string> connector_bind_info // Channel binding information key field name value is value
|
||||
}
|
||||
|
||||
struct PublishRecordStatusDetail {
|
||||
1: optional list<PackFailedDetail> pack_failed_detail // Packaging failure details
|
||||
}
|
||||
|
||||
//project
|
||||
enum ConnectorPublishStatus {
|
||||
Default = 0 // In release
|
||||
Auditing = 1 // Under review.
|
||||
Success = 2 // success
|
||||
Failed = 3 // fail
|
||||
Disable = 4 //disable
|
||||
}
|
||||
|
||||
struct PackFailedDetail {
|
||||
1: i64 entity_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: common_struct.ResourceType entity_type
|
||||
3: string entity_name
|
||||
}
|
||||
|
||||
struct GetPublishRecordDetailRequest {
|
||||
1: required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
2: optional i64 publish_record_id (agw.js_conv="str", api.js_conv="true") // If you don't upload it, get the last release record.
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct GetPublishRecordDetailResponse {
|
||||
1: PublishRecordDetail data
|
||||
|
||||
253: i64 code
|
||||
254: string msg
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
151
idl/app/search.thrift
Normal file
151
idl/app/search.thrift
Normal file
@@ -0,0 +1,151 @@
|
||||
namespace go app.intelligence
|
||||
include "../base.thrift"
|
||||
include "common_struct/intelligence_common_struct.thrift"
|
||||
include "common_struct/common_struct.thrift"
|
||||
|
||||
enum OrderBy {
|
||||
UpdateTime = 0
|
||||
CreateTime = 1
|
||||
PublishTime = 2
|
||||
}
|
||||
|
||||
enum OceanProjectOrderBy {
|
||||
UpdateTime = 0
|
||||
CreateTime = 1
|
||||
}
|
||||
|
||||
enum SearchScope {
|
||||
All = 0,
|
||||
CreateByMe = 1,
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceListOption {
|
||||
1: bool need_replica, //need personal version Bot data
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceListRequest {
|
||||
1: required i64 space_id (agw.js_conv="str", api.js_conv="true"),
|
||||
2: optional string name,
|
||||
3: optional bool has_published,
|
||||
4: optional list<intelligence_common_struct.IntelligenceStatus> status,
|
||||
5: optional list<intelligence_common_struct.IntelligenceType> types,
|
||||
6: optional SearchScope search_scope,
|
||||
|
||||
51: optional bool is_fav,
|
||||
52: optional bool recently_open,
|
||||
|
||||
99: optional GetDraftIntelligenceListOption option,
|
||||
100: optional OrderBy order_by,
|
||||
101: optional string cursor_id,
|
||||
102: optional i32 size,
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct IntelligencePublishInfo {
|
||||
1: string publish_time,
|
||||
2: bool has_published,
|
||||
3: list<common_struct.ConnectorInfo> connectors,
|
||||
}
|
||||
|
||||
struct IntelligencePermissionInfo {
|
||||
1: bool in_collaboration,
|
||||
2: bool can_delete, // can delete
|
||||
3: bool can_view, // Whether the current user can view it, the current judgment logic is whether the user is in the space where the bot is located
|
||||
}
|
||||
|
||||
struct FavoriteInfo {
|
||||
1: bool is_fav, // Whether to collect; use the collection list
|
||||
2: string fav_time, // Collection time; collection list use
|
||||
}
|
||||
|
||||
enum BotMode {
|
||||
SingleMode = 0
|
||||
MultiMode = 1
|
||||
WorkflowMode = 2
|
||||
}
|
||||
|
||||
struct OtherInfo {
|
||||
1: string recently_open_time, // Last opened time; used when recently opened filter
|
||||
2: BotMode bot_mode, // Only bot type returns
|
||||
}
|
||||
|
||||
struct Intelligence {
|
||||
1: intelligence_common_struct.IntelligenceBasicInfo basic_info, // Basic information
|
||||
2: intelligence_common_struct.IntelligenceType type, // Agent Type
|
||||
3: IntelligencePublishInfo publish_info, // Agent publishes information, optional
|
||||
4: common_struct.User owner_info, // Agent owner information, optional
|
||||
5: IntelligencePermissionInfo permission_info, // The current user's permission information to the agent, optional
|
||||
}
|
||||
|
||||
// For the front end
|
||||
struct IntelligenceData {
|
||||
1: intelligence_common_struct.IntelligenceBasicInfo basic_info,
|
||||
2: intelligence_common_struct.IntelligenceType type,
|
||||
3: IntelligencePublishInfo publish_info,
|
||||
4: IntelligencePermissionInfo permission_info,
|
||||
5: common_struct.User owner_info,
|
||||
6: common_struct.AuditInfo latest_audit_info,
|
||||
7: FavoriteInfo favorite_info,
|
||||
|
||||
50: OtherInfo other_info,
|
||||
}
|
||||
|
||||
struct DraftIntelligenceListData {
|
||||
1: list<IntelligenceData> intelligences,
|
||||
2: i32 total,
|
||||
3: bool has_more,
|
||||
4: string next_cursor_id,
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceListResponse {
|
||||
1: DraftIntelligenceListData data,
|
||||
|
||||
253: i32 code,
|
||||
254: string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true"),
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceInfoRequest {
|
||||
1: i64 intelligence_id (agw.js_conv="str", api.js_conv="true"),
|
||||
2: intelligence_common_struct.IntelligenceType intelligence_type,
|
||||
3: optional i64 version (agw.js_conv="str", api.js_conv="true"), // Pass in when previewing the version
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceInfoData {
|
||||
1: intelligence_common_struct.IntelligenceType intelligence_type,
|
||||
2: intelligence_common_struct.IntelligenceBasicInfo basic_info,
|
||||
3: optional IntelligencePublishInfo publish_info,
|
||||
4: optional common_struct.User owner_info,
|
||||
}
|
||||
|
||||
struct GetDraftIntelligenceInfoResponse {
|
||||
1: GetDraftIntelligenceInfoData data,
|
||||
|
||||
253: i32 code,
|
||||
254: string msg,
|
||||
255: optional base.BaseResp BaseResp,
|
||||
}
|
||||
|
||||
struct GetUserRecentlyEditIntelligenceRequest {
|
||||
1: i32 size,
|
||||
2: optional list<intelligence_common_struct.IntelligenceType> types,
|
||||
3: optional string enterprise_id, // Enterprise ID
|
||||
4: optional string organization_id, // organization id
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct GetUserRecentlyEditIntelligenceData {
|
||||
1: list<IntelligenceData> intelligence_info_list,
|
||||
}
|
||||
|
||||
struct GetUserRecentlyEditIntelligenceResponse {
|
||||
1: GetUserRecentlyEditIntelligenceData data,
|
||||
|
||||
253: i32 code,
|
||||
254: string msg,
|
||||
255: optional base.BaseResp BaseResp,
|
||||
}
|
||||
21
idl/app/task.thrift
Normal file
21
idl/app/task.thrift
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace go app.intelligence.task
|
||||
include "../base.thrift"
|
||||
include "common_struct/task_struct.thrift"
|
||||
|
||||
struct DraftProjectInnerTaskListRequest {
|
||||
1 : required i64 project_id (agw.js_conv="str", api.js_conv="true")
|
||||
|
||||
255: optional base.Base Base (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectInnerTaskListResponse {
|
||||
1: DraftProjectInnerTaskListData data
|
||||
|
||||
253: required i64 code,
|
||||
254: required string msg,
|
||||
255: optional base.BaseResp BaseResp (api.none="true")
|
||||
}
|
||||
|
||||
struct DraftProjectInnerTaskListData {
|
||||
1: list<task_struct.ProjectInnerTaskInfo> task_list
|
||||
}
|
||||
Reference in New Issue
Block a user