应用管理
应用管理模块包含应用信息、配置、密钥等功能。
应用信息
应用列表
- 接口地址:
/store/api/saas/app/list - 请求方法:GET
- 权限要求:
app_infoREAD - 接口描述:分页查询应用信息列表
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pageNo | Integer | 是 | 当前页码,默认1 |
| pageSize | Integer | 是 | 页码大小,默认10 |
| category | String | 否 | 应用分类 |
| name | String | 否 | 应用名称(模糊查询) |
| searchType | String | 否 | 搜索类型(KbSpaceSearchTypes枚举) |
| tagCodes | List\<String> | 否 | 标签编码列表 |
响应示例
{
"data": [
{
"id": 1,
"appid": "app_001",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"category": "assistant",
"status": "published",
"accessToken": "tk_xxxxxxxxxxxxx",
"appUrl": "https://app.example.com/智能客服",
"tag": ["客服", "AI"],
"useCount": 100,
"owner": true,
"bindPersonalKb": true,
"bindAllKb": false,
"openKbSearch": true,
"creator": "admin",
"creatorName": "管理员",
"creatorDepartName": "技术部",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1
}
],
"total": 1,
"totalPage": 1,
"pageNo": 1,
"pageSize": 10
}
请求示例
curl -X GET "${domain}/store/api/saas/app/list?pageNo=1&pageSize=10&name=客服&category=assistant" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
新增应用
- 接口地址:
/store/api/saas/app/add - 请求方法:POST
- 权限要求:
app_infoWRITE - 接口描述:新增应用
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| category | String | 是 | 应用分类 |
| name | String | 是 | 应用名称 |
| icon | String | 否 | 应用图标URL |
| description | String | 否 | 应用描述 |
| status | String | 否 | 状态 |
| tag | List\<String> | 否 | 标签列表,最多10个 |
| visibilityRange | String | 否 | 可见范围:OPEN-公开,PRIVATE-私有 |
RequestBody示例
{
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"status": "draft",
"tag": ["客服", "AI"],
"visibilityRange": "OPEN"
}
响应示例
{
"code": 8200,
"message": "新增成功",
"data": "app_001"
}
请求示例
curl -X POST "${domain}/store/api/saas/app/add" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"tag": ["客服", "AI"],
"visibilityRange": "OPEN"
}'
修改应用
- 接口地址:
/store/api/saas/app/update - 请求方法:PUT
- 权限要求:
app_infoWRITE - 接口描述:更新应用信息
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Integer | 是 | 应用记录ID |
| appid | String | 否 | 应用标识 |
| category | String | 是 | 应用分类 |
| name | String | 是 | 应用名称 |
| icon | String | 否 | 应用图标URL |
| description | String | 否 | 应用描述 |
| status | String | 否 | 状态 |
| tag | List\<String> | 否 | 标签列表,最多10个 |
| visibilityRange | String | 否 | 可见范围:OPEN-公开,PRIVATE-私有 |
| visibility | String | 否 | 可见性:PUBLIC-公开,PRIVATE-私有,ALL-全部 |
RequestBody示例
{
"id": 1,
"appid": "app_001",
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"tag": ["客服", "AI"],
"visibilityRange": "OPEN",
"visibility": "PUBLIC"
}
响应示例
{
"code": 8200,
"message": "更新成功",
"data": null
}
请求示例
curl -X PUT "${domain}/store/api/saas/app/update" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"appid": "app_001",
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用"
}'
按ID查询应用
- 接口地址:
/store/api/saas/app/queryById - 请求方法:GET
- 权限要求:
app_infoREAD - 接口描述:根据ID查询应用详情
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Integer | 是 | 应用ID |
响应示例
{
"code": 8200,
"message": "操作成功",
"data": {
"id": 1,
"appid": "app_001",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"category": "assistant",
"status": "published",
"accessToken": "tk_xxxxxxxxxxxxx",
"appUrl": "https://app.example.com/智能客服",
"tag": ["客服", "AI"],
"useCount": 100,
"owner": true,
"bindPersonalKb": true,
"bindAllKb": false,
"openKbSearch": true,
"creator": "admin",
"creatorName": "管理员",
"creatorDepartName": "技术部",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1
}
}
请求示例
curl -X GET "${domain}/store/api/saas/app/queryById?id=1" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
按AppID查询应用
- 接口地址:
/store/api/saas/app/queryByAppId - 请求方法:GET
- 权限要求:
app_infoREAD - 接口描述:根据AppID查询应用详情
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| appid | String | 是 | 应用标识 |
响应示例
{
"code": 8200,
"message": "操作成功",
"data": {
"id": 1,
"appid": "app_001",
"name": "智能客服",
"description": "智能客服应用",
"icon": "https://cdn.example.com/icon.png",
"category": "assistant",
"status": "published",
"accessToken": "tk_xxxxxxxxxxxxx",
"appUrl": "https://app.example.com/智能客服",
"tag": ["客服", "AI"],
"useCount": 100,
"owner": true,
"bindPersonalKb": true,
"bindAllKb": false,
"openKbSearch": true,
"creator": "admin",
"creatorName": "管理员",
"creatorDepartName": "技术部",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1
}
}
请求示例
curl -X GET "${domain}/store/api/saas/app/queryByAppId?appid=app_001" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
删除应用
- 接口地址:
/store/api/saas/app/delete - 请求方法:DELETE
- 权限要求:
app_infoWRITE - 接口描述:删除应用
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Integer | 是 | 应用ID |
响应示例
{
"code": 8200,
"message": "删除成功",
"data": null
}
请求示例
curl -X DELETE "${domain}/store/api/saas/app/delete?id=1" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
发布/取消发布应用
- 接口地址:
/store/api/saas/app/publishApp - 请求方法:POST
- 权限要求:
app_infoWRITE - 接口描述:应用上架或下架
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Integer | 是 | 应用记录ID |
| appid | String | 否 | 应用标识 |
| category | String | 是 | 应用分类 |
| name | String | 是 | 应用名称 |
| icon | String | 否 | 应用图标URL |
| description | String | 否 | 应用描述 |
| status | String | 是 | 状态:published-上架,draft-下架 |
| tag | List\<String> | 否 | 标签列表,最多10个 |
| visibilityRange | String | 否 | 可见范围:OPEN-公开,PRIVATE-私有 |
| visibility | String | 否 | 可见性:PUBLIC-公开,PRIVATE-私有,ALL-全部 |
RequestBody示例
{
"id": 1,
"appid": "app_001",
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用",
"status": "published",
"visibilityRange": "OPEN",
"visibility": "PUBLIC"
}
响应示例
{
"code": 8200,
"message": "操作成功",
"data": null
}
请求示例
curl -X POST "${domain}/store/api/saas/app/publishApp" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"appid": "app_001",
"status": "published",
"category": "assistant",
"name": "智能客服",
"description": "智能客服应用"
}'
应用配置
修改应用配置
- 接口地址:
/store/api/saas/settings/update - 请求方法:PUT
- 权限要求:
app_configWRITE - 接口描述:更新应用配置信息
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| appid | String | 是 | 应用标识 |
| prompt | String | 是 | 提示词 |
| ragSearch | boolean | 否 | 是否启用RAG检索,默认true |
| config | PromptConfigReq | 否 | 提示词配置对象 |
RequestBody示例
{
"appid": "app_001",
"prompt": "你是一个智能客服助手...",
"ragSearch": true,
"config": {}
}
响应示例
{
"code": 8200,
"message": "更新成功",
"data": null
}
请求示例
curl -X PUT "${domain}/store/api/saas/settings/update" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"appid": "app_001",
"prompt": "你是一个智能客服助手...",
"ragSearch": true
}'
查询应用配置详情
- 接口地址:
/store/api/saas/settings/queryById - 请求方法:GET
- 权限要求:
app_configREAD - 接口描述:查询应用配置详情
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| appid | String | 是 | 应用标识 |
响应示例
{
"code": 8200,
"message": "操作成功",
"data": {
"id": 1,
"appid": "app_001",
"category": "assistant",
"prompt": "你是一个智能客服助手...",
"systemPrompt": "系统提示词内容",
"rewritePrompt": "改写提示词内容",
"subQueryPrompt": "子查询提示词内容",
"llmDispatcherName": "dispatcher_001",
"modelName": "gpt-4",
"embeddingModel": "text-embedding-ada-002",
"multimodalModel": "gpt-4-vision",
"ocrModel": "ocr-v1",
"qms": 0.5,
"ragAlpha": 0.7,
"rms": 0.3,
"reviseMinScore": 0.6,
"chatType": 1,
"autoReply": 1,
"ragNoContextFinallyAnswer": true,
"ragNoContextFinallyAnswerText": "抱歉,未找到相关信息",
"temperature": 70,
"topP": 90,
"config": "{}",
"contextWindow": 5,
"roundSessionCount": 5,
"topK": 10,
"rrf": true,
"useReranker": true,
"rankerModelName": "rerank-v1",
"nearPageNumber": 3,
"creator": "admin",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1,
"tenantId": "0"
}
}
请求示例
curl -X GET "${domain}/store/api/saas/settings/queryById?appid=app_001" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
查询可用模型列表
- 接口地址:
/store/api/saas/settings/llm/models - 请求方法:GET
- 权限要求:
app_configREAD - 接口描述:查询可用的大语言模型列表
请求参数
无
响应示例
{
"code": 8200,
"message": "操作成功",
"data": [
{
"label": "GPT-4",
"value": "gpt-4"
},
{
"label": "GPT-3.5 Turbo",
"value": "gpt-3.5-turbo"
}
]
}
请求示例
curl -X GET "${domain}/store/api/saas/settings/llm/models" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
测试模型连通性
- 接口地址:
/store/api/saas/settings/llm/testConnectivity - 请求方法:POST
- 权限要求:
app_configREAD - 接口描述:测试大语言模型连通性
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| modelName | String | 是 | 模型名称 |
| testMessage | String | 否 | 测试消息,默认"hello" |
RequestBody示例
{
"modelName": "gpt-4",
"testMessage": "hello"
}
响应示例
{
"code": 8200,
"message": "连接成功",
"data": {
"modelName": "gpt-4",
"connected": true,
"responseTime": 150,
"message": "连接成功",
"errorMessage": null,
"modelResponse": "Hello! How can I help you?"
}
}
请求示例
curl -X POST "${domain}/store/api/saas/settings/llm/testConnectivity" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"modelName": "gpt-4",
"testMessage": "hello"
}'
应用密钥
应用密钥列表
- 接口地址:
/store/api/saas/platform/key/list - 请求方法:GET
- 权限要求:
app_keyREAD - 接口描述:分页查询应用密钥列表
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pageNo | Integer | 是 | 当前页码,默认1 |
| pageSize | Integer | 是 | 页码大小,默认10 |
| appid | String | 否 | 应用标识 |
| name | String | 否 | 密钥名称(模糊查询) |
响应示例
{
"data": [
{
"id": 1,
"appid": "app_001",
"name": "生产环境密钥",
"keyDisplay": "sk_xxx****xxxx",
"secureKey": "sk_xxxxxxxxxxxxx",
"description": "用于生产环境的API密钥",
"creator": "admin",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1
}
],
"total": 1,
"totalPage": 1,
"pageNo": 1,
"pageSize": 10
}
请求示例
curl -X GET "${domain}/store/api/saas/platform/key/list?pageNo=1&pageSize=10&appid=app_001" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
新增应用密钥
- 接口地址:
/store/api/saas/platform/key/add - 请求方法:POST
- 权限要求:
app_keyWRITE - 接口描述:新增应用密钥
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| appid | String | 是 | 应用标识 |
| name | String | 是 | 密钥名称 |
| description | String | 否 | 密钥描述 |
RequestBody示例
{
"appid": "app_001",
"name": "生产环境密钥",
"description": "用于生产环境的API密钥"
}
响应示例
{
"code": 8200,
"message": "新增成功",
"data": {
"id": 1,
"appid": "app_001",
"name": "生产环境密钥",
"keyDisplay": "sk_xxx****xxxx",
"secureKey": "sk_xxxxxxxxxxxxx",
"description": "用于生产环境的API密钥",
"creator": "admin",
"createTime": "2024-01-01 10:00:00",
"modifier": "admin",
"modifierTime": "2024-01-01 10:00:00",
"sort": 1
}
}
请求示例
curl -X POST "${domain}/store/api/saas/platform/key/add" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"appid": "app_001",
"name": "生产环境密钥",
"description": "用于生产环境的API密钥"
}'
删除应用密钥
- 接口地址:
/store/api/saas/platform/key/delete - 请求方法:DELETE
- 权限要求:
app_keyWRITE - 接口描述:删除应用密钥
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Integer | 是 | 密钥ID |
响应示例
{
"code": 8200,
"message": "删除成功",
"data": null
}
请求示例
curl -X DELETE "${domain}/store/api/saas/platform/key/delete?id=1" \
-H "Authorization: Bearer sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json"
- 应用信息
- 应用列表
- 请求参数
- 响应示例
- 请求示例
- 新增应用
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 修改应用
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 按ID查询应用
- 请求参数
- 响应示例
- 请求示例
- 按AppID查询应用
- 请求参数
- 响应示例
- 请求示例
- 删除应用
- 请求参数
- 响应示例
- 请求示例
- 发布/取消发布应用
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 应用配置
- 修改应用配置
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 查询应用配置详情
- 请求参数
- 响应示例
- 请求示例
- 查询可用模型列表
- 请求参数
- 响应示例
- 请求示例
- 测试模型连通性
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 应用密钥
- 应用密钥列表
- 请求参数
- 响应示例
- 请求示例
- 新增应用密钥
- 请求参数
- RequestBody示例
- 响应示例
- 请求示例
- 删除应用密钥
- 请求参数
- 响应示例
- 请求示例