import "../base.api" type ( // The data of agent information | Agent信息 AgentInfo { BaseIDInfo // name | 角色名称 Name *string `json:"name,optional"` // role | 角色设定 Role *string `json:"role,optional"` // status | 状态 1-正常 2-禁用 Status *int `json:"status,optional"` // background | 背景介绍 Background *string `json:"background,optional"` // examples | 对话案例 Examples *string `json:"examples,optional"` DatasetId *string `json:"dataset_id,optional"` CollectionId *string `json:"collection_id,optional"` } // The response data of agent list | Agent列表数据 AgentListResp { BaseDataInfo // Agent list data | Agent列表数据 Data AgentListInfo `json:"data"` } // Agent list data | Agent列表数据 AgentListInfo { BaseListInfo // The API list data | Agent列表数据 Data []AgentInfo `json:"data"` } // Get agent list request params | Agent列表请求参数 AgentListReq { PageInfo // name | 角色名称 Name *string `json:"name,optional"` // role | 角色设定 Role *string `json:"role,optional"` // background | 背景介绍 Background *string `json:"background,optional"` // status | 状态 1-可用 2-不可用 Status *int `json:"status,optional"` // 租户id OrganizationId *uint64 `json:"organizationId,optional"` } // Agent information response | Agent信息返回体 AgentInfoResp { BaseDataInfo // 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"` Avatar *string `json:"avatar"` Name *string `json:"name"` VectorModel *string `json:"vectorModel"` AgentModel *string `json:"agentModel"` Intro *string `json:"intro"` } // 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:"defaultIndex"` 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"` } CollectionDetailReq { ID *string `json:"id"` } CollectionInfoResp { BaseDataInfo Data CollectionInfo `json:"data"` } DataDetailReq { ID *string `json:"id"` } DataDetailResp { BaseDataInfo Data DataInfo `json:"data"` } 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"` CanWrite *bool `json:"canWrite"` IsOwner *bool `json:"isOwner"` } DataSimpleInfo { ID *string `json:"id"` Q *string `json:"q"` A *string `json:"a"` ChunkIndex *uint64 `json:"chunkIndex"` DatasetId *string `json:"datasetId"` CollectionId *string `json:"collectionId"` } // 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 { Page *int `json:"page" 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 BatchSimpleInfo `json:"data"` } BatchSimpleInfo { BaseListInfo // The API list data | BatchMsg列表数据 Data []DataSimpleInfo `json:"data"` } // Data create request | 信息请求体 CreateDataInfoReq { CollectionId *string `json:"collectionId" validate:"required"` // Q Q *string `json:"q" validate:"required"` // A A *string `json:"a" validate:"required"` // Indexes | 索引 //Indexes []IndexSingle `json:"indexes,optional"` } // IndexSingle { // Text A *string `json:"text"` // } // Data create request | 信息返回体 UpdateDataInfoReq { // ID DataId *string `json:"id" validate:"required"` // Q Q *string `json:"q" validate:"required"` // A A *string `json:"a" validate:"required"` // Indexes | 索引 //Indexes []IndexSingle `json:"indexes,optional"` } DeleteDataReq { ID *string `json:"id" validate:"required"` } UploadDataReq { AgentId *string `form:"agentId"` } BatchDeleteIds { Ids []string `json:"ids"` } ) @server( jwt: Auth group: agent middleware: Authority ) service Wechat { // 批量删除fastgpt中数据 @handler batchDeleteAgentData post /agent/data/batchDelete (BatchDeleteIds) returns (BaseDataInfo) // upload agent data | 上传data @handler uploadAgentData post /agent/data/upload () returns (BaseDataInfo) // Create agent information | 创建Agent @handler createAgent post /agent/create (AgentInfo) returns (BaseMsgResp) // Update agent information | 更新Agent @handler updateAgent post /agent/update (AgentInfo) returns (BaseMsgResp) // Delete agent information | 删除Agent信息 @handler deleteAgent post /agent/delete (IDsReq) returns (BaseMsgResp) // Get agent list | 获取Agent列表 @handler getAgentList post /agent/list (AgentListReq) returns (AgentListResp) // 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 collect detail | 获取collection详情 @handler getAgentCollectionInfo post /agent/collection/detail (CollectionDetailReq) returns (CollectionInfoResp) // Get data list | 获取data列表 @handler getAgentDataList post /agent/data/list (DataListReq) returns (DataListResp) // Get data detail | 获取data详情 @handler getAgentDataDetail post /agent/data/detail (DataDetailReq) returns (DataDetailResp) // Create data | 添加data @handler createAgentData post /agent/data/create (CreateDataInfoReq) returns (BaseDataInfo) // Update data | 修改data @handler updateAgentData post /agent/data/update (UpdateDataInfoReq) returns (BaseDataInfo) // Delete data | 删除data @handler deleteAgentData post /agent/data/delete (DeleteDataReq) returns (BaseDataInfo) }