feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
110
idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift
Normal file
110
idl/data_engine/ocean_cloud_memory/kvmemory/kvmemory.thrift
Normal file
@@ -0,0 +1,110 @@
|
||||
include "../../../base.thrift"
|
||||
include "../table/table.thrift"
|
||||
include "./project_memory.thrift"
|
||||
|
||||
struct KVItem {
|
||||
1: string keyword
|
||||
2: string value
|
||||
3: i64 create_time
|
||||
4: i64 update_time
|
||||
5: bool is_system
|
||||
6: bool prompt_disabled
|
||||
7: string schema
|
||||
}
|
||||
|
||||
struct VariableInfo {
|
||||
1: string key
|
||||
2: string default_value
|
||||
3: string description
|
||||
4: string sensitive
|
||||
5: string must_not_use_in_prompt
|
||||
6: string can_write
|
||||
7: string example
|
||||
8: string ext_desc
|
||||
9: string group_name
|
||||
10: string group_desc
|
||||
11: string group_ext_desc
|
||||
12: optional list<string> EffectiveChannelList
|
||||
}
|
||||
|
||||
struct GroupVariableInfo {
|
||||
1: string group_name
|
||||
2: string group_desc
|
||||
3: string group_ext_desc
|
||||
4: list<VariableInfo> var_info_list
|
||||
5: list<GroupVariableInfo> sub_group_info
|
||||
}
|
||||
|
||||
struct SetKvMemoryReq {
|
||||
1: required i64 bot_id(agw.js_conv="str", api.js_conv="true", api.body="bot_id")
|
||||
2: optional i64 user_id
|
||||
3: required list<KVItem> data
|
||||
4: optional i64 connector_id
|
||||
5: optional table.RefInfo ref_info // 引用信息
|
||||
6: optional string project_id
|
||||
7: optional i64 ProjectVersion
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct SetKvMemoryResp {
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: optional base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
|
||||
struct GetSysVariableConfRequest {
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct GetSysVariableConfResponse {
|
||||
1: list<VariableInfo> conf
|
||||
2: list<GroupVariableInfo> group_conf
|
||||
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
struct DelProfileMemoryResponse {
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
|
||||
struct DelProfileMemoryRequest {
|
||||
1: i64 user_id
|
||||
2: i64 bot_id(agw.js_conv="str", api.js_conv="true", api.body="bot_id")
|
||||
3: list<string> keywords
|
||||
4: optional i64 connector_id
|
||||
5: optional table.RefInfo ref_info // 引用信息
|
||||
6: string project_id
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct GetProfileMemoryRequest {
|
||||
1: i64 user_id
|
||||
2: i64 bot_id(agw.js_conv="str", api.js_conv="true", api.body="bot_id")
|
||||
3: list<string> keywords
|
||||
4: optional i64 connector_id
|
||||
5: optional string version
|
||||
6: optional table.RefInfo ref_info // 引用信息
|
||||
7: optional string ext
|
||||
8: optional string project_id
|
||||
9: optional i64 ProjectVersion
|
||||
10: optional project_memory.VariableChannel VariableChannel
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
|
||||
struct GetProfileMemoryResponse {
|
||||
1: list<KVItem> memories
|
||||
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
include "../../../base.thrift"
|
||||
|
||||
enum VariableType{
|
||||
KVVariable = 1
|
||||
ListVariable = 2
|
||||
}
|
||||
|
||||
enum VariableChannel{
|
||||
Custom = 1
|
||||
System = 2
|
||||
Location = 3
|
||||
Feishu = 4
|
||||
APP = 5 // 项目变量
|
||||
}
|
||||
|
||||
struct Variable{
|
||||
1: string Keyword
|
||||
2: string DefaultValue
|
||||
3: VariableType VariableType
|
||||
4: VariableChannel Channel
|
||||
5: string Description
|
||||
6: bool Enable
|
||||
7: optional list<string> EffectiveChannelList //生效渠道
|
||||
8: string Schema //新老数据都会有schema,除项目变量外其他默认为string
|
||||
9: bool IsReadOnly
|
||||
}
|
||||
|
||||
struct GroupVariableInfo{
|
||||
1: string GroupName
|
||||
2: string GroupDesc
|
||||
3: string GroupExtDesc
|
||||
4: list<Variable> VarInfoList
|
||||
5: list<GroupVariableInfo> SubGroupList
|
||||
6: bool IsReadOnly
|
||||
7: optional VariableChannel DefaultChannel
|
||||
}
|
||||
|
||||
|
||||
struct GetProjectVariableListReq {
|
||||
1: string ProjectID
|
||||
2: i64 UserID
|
||||
3: i64 version (agw.js_conv="str", api.js_conv="true")
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct GetProjectVariableListResp {
|
||||
1: list<Variable> VariableList
|
||||
2: bool CanEdit
|
||||
3: list<GroupVariableInfo> GroupConf
|
||||
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
struct UpdateProjectVariableReq {
|
||||
1: string ProjectID
|
||||
2: i64 UserID
|
||||
3: list<Variable> VariableList
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
struct UpdateProjectVariableResp {
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
enum VariableConnector{
|
||||
Bot = 1
|
||||
Project = 2
|
||||
}
|
||||
|
||||
|
||||
struct GetMemoryVariableMetaReq {
|
||||
1: string ConnectorID
|
||||
2: VariableConnector ConnectorType
|
||||
3: optional string version
|
||||
|
||||
255: optional base.Base Base
|
||||
}
|
||||
|
||||
//应该是给workflow用的rpc接口,不需要鉴权,VariableChannel
|
||||
struct GetMemoryVariableMetaResp {
|
||||
1: map<VariableChannel, list<Variable>> VariableMap
|
||||
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user