refactor: IDL structure modification (#475)
This commit is contained in:
112
idl/data/variable/kvmemory.thrift
Normal file
112
idl/data/variable/kvmemory.thrift
Normal file
@@ -0,0 +1,112 @@
|
||||
include "../../base.thrift"
|
||||
include "../database/table.thrift"
|
||||
include "./project_memory.thrift"
|
||||
|
||||
namespace go data.variable.kvmemory
|
||||
|
||||
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 // citation information
|
||||
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 // citation information
|
||||
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 // citation information
|
||||
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
|
||||
}
|
||||
95
idl/data/variable/project_memory.thrift
Normal file
95
idl/data/variable/project_memory.thrift
Normal file
@@ -0,0 +1,95 @@
|
||||
include "../../base.thrift"
|
||||
|
||||
namespace go data.variable.project_memory
|
||||
|
||||
enum VariableType{
|
||||
KVVariable = 1
|
||||
ListVariable = 2
|
||||
}
|
||||
|
||||
enum VariableChannel{
|
||||
Custom = 1
|
||||
System = 2
|
||||
Location = 3
|
||||
Feishu = 4
|
||||
APP = 5 // project variable
|
||||
}
|
||||
|
||||
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 //effective channel
|
||||
8: string Schema //New and old data will have schemas, except for project variables, the default is 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
|
||||
}
|
||||
|
||||
//It should be the rpc interface for workflow, no authentication is required, VariableChannel
|
||||
struct GetMemoryVariableMetaResp {
|
||||
1: map<VariableChannel, list<Variable>> VariableMap
|
||||
|
||||
253: required i64 code
|
||||
254: required string msg
|
||||
255: required base.BaseResp BaseResp
|
||||
}
|
||||
|
||||
|
||||
16
idl/data/variable/variable_svc.thrift
Normal file
16
idl/data/variable/variable_svc.thrift
Normal file
@@ -0,0 +1,16 @@
|
||||
include "kvmemory.thrift"
|
||||
include "project_memory.thrift"
|
||||
|
||||
namespace go data.variable
|
||||
|
||||
service MemoryService {
|
||||
// --- variable
|
||||
project_memory.GetProjectVariableListResp GetProjectVariableList(1:project_memory.GetProjectVariableListReq req)(api.get='/api/memory/project/variable/meta_list', api.category="memory_project")
|
||||
project_memory.UpdateProjectVariableResp UpdateProjectVariable(1:project_memory.UpdateProjectVariableReq req)(api.post='/api/memory/project/variable/meta_update', api.category="memory_project")
|
||||
project_memory.GetMemoryVariableMetaResp GetMemoryVariableMeta(1:project_memory.GetMemoryVariableMetaReq req)(api.post='/api/memory/variable/get_meta', api.category="memory",agw.preserve_base="true")
|
||||
kvmemory.DelProfileMemoryResponse DelProfileMemory(1:kvmemory.DelProfileMemoryRequest req)(api.post='/api/memory/variable/delete', api.category="memory",agw.preserve_base="true")
|
||||
kvmemory.GetProfileMemoryResponse GetPlayGroundMemory(1:kvmemory.GetProfileMemoryRequest req)(api.post='/api/memory/variable/get', api.category="memory",agw.preserve_base="true")
|
||||
kvmemory.GetSysVariableConfResponse GetSysVariableConf(1:kvmemory.GetSysVariableConfRequest req)(api.get='/api/memory/sys_variable_conf', api.category="memory")
|
||||
kvmemory.SetKvMemoryResp SetKvMemory(1: kvmemory.SetKvMemoryReq req)(api.post='/api/memory/variable/upsert', api.category="memory",agw.preserve_base="true")
|
||||
// ---
|
||||
}
|
||||
Reference in New Issue
Block a user