|
@@ -61,6 +61,187 @@ type (
|
|
|
// Agent information | Agent数据
|
|
|
Data AgentInfo `json:"data"`
|
|
|
}
|
|
|
+
|
|
|
+ VectorModel {
|
|
|
+ Model *string `json:"model"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ CharsPointsPrice *uint64 `json:"charsPointsPrice"`
|
|
|
+ DefaultToken *uint64 `json:"defaultToken"`
|
|
|
+ MaxToken *uint64 `json:"maxToken"`
|
|
|
+ Weight *uint64 `json:"weight"`
|
|
|
+ }
|
|
|
+
|
|
|
+ AgentModel {
|
|
|
+ Model *string `json:"model"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ MaxContext *uint64 `json:"maxContext"`
|
|
|
+ MaxResponse *uint64 `json:"maxResponse"`
|
|
|
+ CharsPointsPrice *uint64 `json:"charsPointsPrice"`
|
|
|
+ }
|
|
|
+
|
|
|
+ DatasetId {
|
|
|
+ ID *string `json:"id"`
|
|
|
+ ParentID *string `json:"parentId"`
|
|
|
+ TeamId *string `json:"teamId"`
|
|
|
+ TmbId *string `json:"tmbId"`
|
|
|
+ Type *string `json:"type"`
|
|
|
+ Status *string `json:"status"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ VectorModel *string `json:"vectorModel"`
|
|
|
+ AgentModel *string `json:"agentModel"`
|
|
|
+ Intro *string `json:"intro"`
|
|
|
+ Permission *string `json:"permission"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Dataset info | 知识库详情
|
|
|
+ DatasetInfo {
|
|
|
+ ID *string `json:"id"`
|
|
|
+ ParentID *string `json:"parentId"`
|
|
|
+ TeamId *string `json:"teamId"`
|
|
|
+ TmbId *string `json:"tmbId"`
|
|
|
+ Type *string `json:"type"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ Intro *string `json:"intro"`
|
|
|
+ Status *string `json:"status"`
|
|
|
+ Avatar *string `json:"avatar"`
|
|
|
+ VectorModel VectorModel `json:"vectorModel"`
|
|
|
+ AgentModel AgentModel `json:"agentModel"`
|
|
|
+ Permission *string `json:"permission"`
|
|
|
+ CanWrite *bool `json:"canWrite"`
|
|
|
+ IsOwner *bool `json:"isOwner"`
|
|
|
+ }
|
|
|
+
|
|
|
+ Index {
|
|
|
+ defaultIndex *bool `json:"canWrite"`
|
|
|
+ Type *string `json:"type"`
|
|
|
+ DataId *string `json:"dataId"`
|
|
|
+ Text *string `json:"text"`
|
|
|
+ ID *string `json:"id"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Collection Info | 集合详情
|
|
|
+ CollectionInfo {
|
|
|
+ ID *string `json:"id"`
|
|
|
+ ParentID *string `json:"parentId"`
|
|
|
+ TmbId *string `json:"tmbId,optional"`
|
|
|
+ Type *string `json:"type"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ DataAmount *uint64 `json:"dataAmount,optional"`
|
|
|
+ TrainingAmount *uint64 `json:"trainingAmount,optional"`
|
|
|
+ TrainingType *string `json:"trainingType,optional"`
|
|
|
+ ChunkSize *uint64 `json:"chunkSize,optional"`
|
|
|
+ ChunkSplitter *string `json:"chunkSplitter,optional"`
|
|
|
+ QaPrompt *string `json:"qaPrompt,optional"`
|
|
|
+ RawTextLength *uint64 `json:"rawTextLength,optional"`
|
|
|
+ CanWrite *bool `json:"canWrite,optional"`
|
|
|
+ SourceName *string `json:"sourceName,optional"`
|
|
|
+ DatasetId DatasetId `json:"datasetId,optional"`
|
|
|
+ }
|
|
|
+
|
|
|
+ CollectionSimpleInfo {
|
|
|
+ ID *string `json:"id"`
|
|
|
+ ParentID *string `json:"parentId"`
|
|
|
+ TmbId *string `json:"tmbId,optional"`
|
|
|
+ Type *string `json:"type"`
|
|
|
+ Name *string `json:"name"`
|
|
|
+ DataAmount *uint64 `json:"dataAmount,optional"`
|
|
|
+ TrainingAmount *uint64 `json:"trainingAmount,optional"`
|
|
|
+ }
|
|
|
+
|
|
|
+ DataInfo {
|
|
|
+ ID *string `json:"id"`
|
|
|
+ Q *string `json:"q"`
|
|
|
+ A *string `json:"a"`
|
|
|
+ ChunkIndex *uint64 `json:"chunkIndex"`
|
|
|
+ Indexes []Index `json:"indexes"`
|
|
|
+ DatasetId *string `json:"datasetId"`
|
|
|
+ CollectionId *string `json:"collectionId"`
|
|
|
+ SourceName *string `json:"sourceName"`
|
|
|
+ SourceId *string `json:"sourceId"`
|
|
|
+ CanWrite *bool `json:"canWrite"`
|
|
|
+ IsOwner *bool `json:"isOwner"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Get collection list request params | Collection列表请求参数
|
|
|
+ CollectionListReq {
|
|
|
+ PageNum *int `json:"pageNum" validate:"required,number,gt=0"`
|
|
|
+
|
|
|
+ PageSize *int `json:"pageSize" validate:"required,number,lt=100000"`
|
|
|
+
|
|
|
+ DatasetId *string `json:"datasetId" validate:"required"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Collection list response | Collection List信息返回体
|
|
|
+ CollectionListResp {
|
|
|
+ BaseDataInfo
|
|
|
+
|
|
|
+ // Agent information | Agent数据
|
|
|
+ Data []CollectionSimpleInfo `json:"data"`
|
|
|
+
|
|
|
+ PageNum *int `json:"pageNum" validate:"required,number,gt=0"`
|
|
|
+
|
|
|
+ PageSize *int `json:"pageSize" validate:"required,number,lt=100000"`
|
|
|
+
|
|
|
+ Total *int `json:"total"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Get collection list request params | Collection列表请求参数
|
|
|
+ DataListReq {
|
|
|
+ PageNum *int `json:"pageNum" validate:"required,number,gt=0"`
|
|
|
+
|
|
|
+ PageSize *int `json:"pageSize" validate:"required,number,lt=100000"`
|
|
|
+
|
|
|
+ CollectionId *string `json:"collectionId" validate:"required"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Data list response | Data List信息返回体
|
|
|
+ DataListResp {
|
|
|
+ BaseDataInfo
|
|
|
+
|
|
|
+ // Agent information | Agent数据
|
|
|
+ Data []DataInfo `json:"data"`
|
|
|
+
|
|
|
+ PageNum *int `json:"pageNum" validate:"required,number,gt=0"`
|
|
|
+
|
|
|
+ PageSize *int `json:"pageSize" validate:"required,number,lt=100000"`
|
|
|
+
|
|
|
+ Total *int `json:"total"`
|
|
|
+ }
|
|
|
+
|
|
|
+ // Data create request | 信息请求体
|
|
|
+ CreateDataInfoReq {
|
|
|
+ CollectionId *string `json:"collectionId" validate:"required"`
|
|
|
+
|
|
|
+ // Q
|
|
|
+ Q *string `json:"q"`
|
|
|
+
|
|
|
+ // A
|
|
|
+ A *string `json:"a"`
|
|
|
+
|
|
|
+ // Indexes | 索引
|
|
|
+ //Indexes []IndexSingle `json:"indexes,optional"`
|
|
|
+ }
|
|
|
+
|
|
|
+// IndexSingle {
|
|
|
+// Text A *string `json:"text"`
|
|
|
+// }
|
|
|
+
|
|
|
+ // Data create request | 信息返回体
|
|
|
+ UpdateDataInfoReq {
|
|
|
+ CollectionId *string `json:"collectionId" validate:"required"`
|
|
|
+
|
|
|
+ // ID
|
|
|
+ ID *string `json:"id"`
|
|
|
+
|
|
|
+ // Q
|
|
|
+ Q *string `json:"q"`
|
|
|
+
|
|
|
+ // A
|
|
|
+ A *string `json:"a"`
|
|
|
+
|
|
|
+ // Indexes | 索引
|
|
|
+ //Indexes []IndexSingle `json:"indexes,optional"`
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
@server(
|
|
@@ -86,7 +267,23 @@ service Wechat {
|
|
|
@handler getAgentList
|
|
|
post /agent/list (AgentListReq) returns (AgentListResp)
|
|
|
|
|
|
- // Get agent by ID | 通过ID获取Agent
|
|
|
- @handler getAgentById
|
|
|
- post /agent (IDReq) returns (AgentInfoResp)
|
|
|
+ // Get agent by ID | 通过ID获取Agent
|
|
|
+ @handler getAgentById
|
|
|
+ post /agent (IDReq) returns (AgentInfoResp)
|
|
|
+
|
|
|
+ // Get collect list | 获取collection列表
|
|
|
+ @handler getAgentCollectionList
|
|
|
+ post /agent/collection/list (CollectionListReq) returns (CollectionListResp)
|
|
|
+
|
|
|
+ // Get data list | 获取data列表
|
|
|
+ @handler getAgentDataList
|
|
|
+ post /agent/data/list (DataListReq) returns (DataListResp)
|
|
|
+
|
|
|
+ // Create data | 添加data
|
|
|
+ @handler createAgentData
|
|
|
+ post /agent/data/create (CreateDataInfoReq) returns (BaseDataInfo)
|
|
|
+
|
|
|
+ // Update data | 修改data
|
|
|
+ @handler updateAgentData
|
|
|
+ post /agent/data/update (UpdateDataInfoReq) returns (BaseDataInfo)
|
|
|
}
|