summaryrefslogtreecommitdiff
path: root/data/zh_cn/bailian/2023-12-29/api-docs.php
diff options
context:
space:
mode:
authorZhineng Li <im@zhineng.li>2026-07-12 17:11:17 +0800
committerZhineng Li <im@zhineng.li>2026-07-12 17:11:17 +0800
commit1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634 (patch)
tree5f0857666365b7e40cdaa3733ebe1f3ba9e13c67 /data/zh_cn/bailian/2023-12-29/api-docs.php
parent7347bac4ab7e136157fc94777e6cf87ef9e08599 (diff)
downloadafterglow-metadata-full-1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634.tar.gz
afterglow-metadata-full-1c7f908ce09f98fdcbf79ed2a8ae21be60eaa634.zip
update APIs 20260712
Diffstat (limited to 'data/zh_cn/bailian/2023-12-29/api-docs.php')
-rw-r--r--data/zh_cn/bailian/2023-12-29/api-docs.php11930
1 files changed, 5494 insertions, 6436 deletions
diff --git a/data/zh_cn/bailian/2023-12-29/api-docs.php b/data/zh_cn/bailian/2023-12-29/api-docs.php
index 6bc315d..9b1ae75 100644
--- a/data/zh_cn/bailian/2023-12-29/api-docs.php
+++ b/data/zh_cn/bailian/2023-12-29/api-docs.php
@@ -1,189 +1,96 @@
<?php return [
'version' => '1.0',
- 'info' => [
- 'style' => 'ROA',
- 'product' => 'bailian',
- 'version' => '2023-12-29',
- ],
+ 'info' => ['style' => 'ROA', 'product' => 'bailian', 'version' => '2023-12-29'],
'directories' => [
[
- 'id' => 260944,
- 'title' => '应用数据',
- 'type' => 'directory',
'children' => [
- 'ListFile',
- 'DeleteCategory',
- 'ListCategory',
- 'AddCategory',
- 'AddFile',
- 'AddFilesFromAuthorizedOss',
- 'ApplyFileUploadLease',
- 'DeleteFile',
- 'DescribeFile',
- 'UpdateFileTag',
- 'GetParseSettings',
- 'GetAvailableParserTypes',
- 'ChangeParseSetting',
+ 'AddCategory', 'ListCategory', 'DeleteCategory', 'ApplyFileUploadLease', 'AddFile', 'AddFilesFromAuthorizedOss', 'ListFile', 'DescribeFile', 'UpdateFileTag', 'BatchUpdateFileTag', 'DeleteFile', 'DeleteFiles', 'GetParseSettings', 'GetAvailableParserTypes', 'ChangeParseSetting', 'AddTable', 'UpdateTableFromAuthorizedOss', 'AddConnector', 'GetConnector', 'DeleteConnector',
+ 'UpdateConnector',
],
+ 'type' => 'directory',
+ 'title' => '数据连接(原应用数据)',
+ 'id' => 437098,
],
[
- 'id' => 260955,
- 'title' => '知识库',
+ 'children' => ['CreateIndex', 'GetIndexJobStatus', 'SubmitIndexJob', 'SubmitIndexAddDocumentsJob', 'Retrieve', 'ListIndexDocuments', 'ListIndexFileDetails', 'UpdateIndex', 'DeleteIndexDocument', 'ListIndices', 'DeleteIndex', 'ListChunks', 'UpdateChunk', 'DeleteChunk', 'GetIndexMonitor'],
'type' => 'directory',
- 'children' => [
- 'CreateIndex',
- 'GetIndexJobStatus',
- 'SubmitIndexJob',
- 'SubmitIndexAddDocumentsJob',
- 'Retrieve',
- 'ListIndexDocuments',
- 'ListIndexFileDetails',
- 'UpdateIndex',
- 'DeleteIndexDocument',
- 'ListIndices',
- 'DeleteIndex',
- 'ListChunks',
- 'UpdateChunk',
- 'DeleteChunk',
- 'GetIndexMonitor',
- ],
+ 'title' => '知识库',
+ 'id' => 437112,
],
[
- 'id' => 260969,
- 'title' => 'Prompt工程',
+ 'children' => ['CreatePromptTemplate', 'GetPromptTemplate', 'UpdatePromptTemplate', 'DeletePromptTemplate', 'ListPromptTemplates'],
'type' => 'directory',
- 'children' => [
- 'CreatePromptTemplate',
- 'GetPromptTemplate',
- 'UpdatePromptTemplate',
- 'DeletePromptTemplate',
- 'ListPromptTemplates',
- 'ListPromptTemplates',
- ],
+ 'title' => 'Prompt工程',
+ 'id' => 437128,
],
[
- 'id' => 260986,
- 'title' => '其他',
- 'type' => 'directory',
'children' => [
[
- 'id' => 260975,
- 'title' => '长期记忆(旧)',
+ 'children' => ['CreateMemory', 'GetMemory', 'UpdateMemory', 'DeleteMemory', 'ListMemories', 'CreateMemoryNode', 'GetMemoryNode', 'UpdateMemoryNode', 'DeleteMemoryNode', 'ListMemoryNodes'],
'type' => 'directory',
- 'children' => [
- 'CreateMemory',
- 'GetMemory',
- 'UpdateMemory',
- 'DeleteMemory',
- 'ListMemories',
- 'CreateMemoryNode',
- 'GetMemoryNode',
- 'UpdateMemoryNode',
- 'DeleteMemoryNode',
- 'ListMemoryNodes',
- ],
+ 'title' => '长期记忆(旧)',
+ 'id' => 437135,
],
'GetAlipayTransferStatus',
'GetAlipayUrl',
'ApplyTempStorageLease',
],
+ 'type' => 'directory',
+ 'title' => '其他',
+ 'id' => 437134,
],
],
'components' => [
'schemas' => [],
],
'apis' => [
- 'ListFile' => [
- 'summary' => '获取指定类目下一个或多个文档的详细信息。',
- 'path' => '/{WorkspaceId}/datacenter/files',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'AddCategory' => [
+ 'summary' => '在指定的业务空间中创建一个类目,用于分类和管理文件。每个业务空间最多创建500个类目。',
+ 'path' => '/{WorkspaceId}/datacenter/category/',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx'."\n",
- ],
+ 'schema' => ['description' => '业务空间 ID,即在该业务空间中新增类目。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
- 'name' => 'CategoryId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
+ 'name' => 'CategoryName',
+ 'in' => 'formData',
+ 'schema' => ['description' => '类目名称。长度为 1~20 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。', 'type' => 'string', 'required' => true, 'example' => '产品清单'],
],
[
- 'name' => 'NextToken',
- 'in' => 'query',
+ 'name' => 'CategoryType',
+ 'in' => 'formData',
'schema' => [
- 'description' => '查询凭证(Token),取值为上一次 API 调用返回的NextToken参数值。',
+ 'description' => '类目类型。取值范围:'."\n"
+ .'- UNSTRUCTURED:类目。',
'type' => 'string',
- 'required' => false,
- 'example' => 'AAAAAdH70eOCSCKtacdomNzak4U=',
+ 'required' => true,
+ 'example' => 'UNSTRUCTURED',
+ 'enum' => ['UNSTRUCTURED'],
],
],
[
- 'name' => 'MaxResults',
- 'in' => 'query',
- 'schema' => [
- 'description' => '分页查询时每页行数。取值范围[1-200]。'."\n"
- ."\n"
- .'默认值:'."\n"
- .'当不设置值或设置的值小于 1 时,默认值为20。当设置的值大于 200 时,默认值为 200。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '20',
- ],
+ 'name' => 'ParentCategoryId',
+ 'in' => 'formData',
+ 'schema' => ['description' => '父类目的类目 ID。在此父类目下创建新类目,此值为空时创建一级类目。', 'type' => 'string', 'required' => false, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
],
[
- 'name' => 'FileName',
- 'in' => 'query',
- 'schema' => [
- 'description' => '文件名称(不含后缀),仅支持按照文件名精准查找,不支持模糊搜索。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'product-overview',
- ],
+ 'name' => 'ConnectorId',
+ 'in' => 'formData',
+ 'schema' => ['title' => '所属数据连接(Connector)的实例id', 'description' => '所属数据连接(Connector)的实例id,请到百炼控制台获取。', 'type' => 'string', 'required' => false, 'example' => 'conn_xxxx'],
],
],
'responses' => [
@@ -193,571 +100,122 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'success',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
'Data' => [
'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
- 'FileList' => [
- 'description' => '类目下的文件列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件对象。',
- 'type' => 'object',
- 'properties' => [
- 'CategoryId' => [
- 'description' => '文件所属类目ID。',
- 'type' => 'string',
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
- 'CreateTime' => [
- 'description' => '文件实际添加到阿里云百炼中的时间戳,格式: yyyy-MM-dd HH:mm:ss,时区:UTC + 8。',
- 'type' => 'string',
- 'example' => '2024-09-09 11:03:35',
- ],
- 'FileId' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的图标获取。',
- 'type' => 'string',
- 'example' => 'file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx',
- ],
- 'FileName' => [
- 'description' => '文件名称。',
- 'type' => 'string',
- 'example' => 'product-overview.pdf',
- ],
- 'FileType' => [
- 'description' => '文件格式类型。可能值为:pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。',
- 'type' => 'string',
- 'example' => 'docx',
- ],
- 'Parser' => [
- 'description' => '文档解析器。可能值为:'."\n"
- .'- DASHSCOPE_DOCMIND:阿里云文档智能解析。',
- 'type' => 'string',
- 'example' => 'DASHSCOPE_DOCMIND',
- ],
- 'SizeInBytes' => [
- 'description' => '文件大小,单位字节。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '512',
- ],
- 'Status' => [
- 'description' => '文件解析状态,可能值为:'."\n"
- .'- INIT: 初始化状态,等待调度中。'."\n"
- .'- PARSING: 解析中。'."\n"
- .'- PARSE_SUCCESS:解析完成。'."\n"
- .'- PARSE_FAILED:解析失败。',
- 'type' => 'string',
- 'example' => 'PARSE_SUCCESS',
- ],
- 'Tags' => [
- 'description' => '文件关联的标签列表,一个文档支持关联多个标签。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件的标签。',
- 'type' => 'string',
- 'example' => 'tag-A',
- ],
- ],
- ],
- ],
- ],
- 'HasNext' => [
- 'description' => '符合查询条件的类目数据是否存在下一页,可能值为:'."\n"
- .'- true:是。'."\n"
- .'- false:否。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'MaxResults' => [
- 'description' => '分页查询时每页行数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '20',
- ],
- 'NextToken' => [
- 'description' => '本次调用返回的查询凭证值。',
- 'type' => 'string',
- 'example' => '4jzbJk9J6lNeuXD9hP0viA==',
- ],
- 'TotalCount' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '48',
- ],
+ 'CategoryId' => ['description' => '类目 ID。请妥善保管该值,它将用于后续所有与此类目相关的API操作。', 'type' => 'string', 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
+ 'CategoryName' => ['description' => '类目名称。', 'type' => 'string', 'example' => '类目名称'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Requests throttling triggered.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。 '."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Requests throttling triggered.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。 '."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"FileList\\": [\\n {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx\\",\\n \\"CreateTime\\": \\"2024-09-09 11:03:35\\",\\n \\"FileId\\": \\"file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx\\",\\n \\"FileName\\": \\"product-overview.pdf\\",\\n \\"FileType\\": \\"docx\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\",\\n \\"SizeInBytes\\": 512,\\n \\"Status\\": \\"PARSE_SUCCESS\\",\\n \\"Tags\\": [\\n \\"tag-A\\"\\n ]\\n }\\n ],\\n \\"HasNext\\": true,\\n \\"MaxResults\\": 20,\\n \\"NextToken\\": \\"4jzbJk9J6lNeuXD9hP0viA==\\",\\n \\"TotalCount\\": 48\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '文件列表',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
- ."\n"
- .'- 本接口具有幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CategoryName\\": \\"类目名称\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '新增类目',
+ 'description' => '- 不支持通过API新增数据表,请通过控制台的<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>操作。'."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:AddCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口不具备幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
- ],
- 'DeleteCategory' => [
- 'summary' => '永久性删除指定的类目。',
- 'path' => '/{WorkspaceId}/datacenter/category/{CategoryId}/',
- 'methods' => [
- 'delete',
- ],
- 'schemes' => [
- 'https',
- ],
- 'security' => [
- [
- 'AK' => [],
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddCategory'],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
- 'parameters' => [
- [
- 'name' => 'CategoryId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
- ],
+ 'ramActions' => [
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
- ],
- ],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'CategoryId' => [
- 'description' => '被删除的类目 ID。',
- 'type' => 'string',
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
- ],
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'workspace id is null or invalid.',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'success',
- ],
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"Code\\": \\"success\\"\\n}","type":"json"}]',
- 'title' => '删除类目',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
],
- 'ListCategory' => [
- 'summary' => '获取指定业务空间下一个或多个类目的详细信息。',
- 'path' => '/{WorkspaceId}/datacenter/categories',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'AddConnector' => [
+ 'summary' => '创建连接器,当前接口仅支持创建文件类型连接器。',
+ 'path' => '/{WorkspaceId}/datacenter/connector',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
- ],
- [
- 'name' => 'CategoryType',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '要查询的类目类型。取值范围:'."\n"
- .'- UNSTRUCTURED:类目。'."\n"
- ."\n"
- .'<props="china">'."\n"
- ."\n"
- .'> 暂不支持通过API查询表格(数据表)。'."\n"
- .'>'."\n"
- ."\n"
- .'</props>'."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 暂不支持通过API查询结构化数据表。'."\n"
- .'>'."\n"
- ."\n\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'UNSTRUCTURED',
- 'enum' => [
- 'UNSTRUCTURED',
- ],
- ],
+ 'schema' => ['description' => '知识库所在工作空间ID', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oxxxx'],
],
[
- 'name' => 'ParentCategoryId',
+ 'name' => 'ConnectorName',
'in' => 'formData',
- 'schema' => [
- 'description' => '要查询类目的父类目 ID。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
+ 'schema' => ['title' => '连接器名称', 'description' => '连接器名称', 'type' => 'string', 'required' => true, 'example' => 'test-connector', 'maxLength' => 20, 'minLength' => 1],
],
[
- 'name' => 'NextToken',
+ 'name' => 'ConnectorType',
'in' => 'formData',
'schema' => [
- 'description' => '查询凭证(Token),取值为上一次 API 调用返回的NextToken参数值。',
+ 'title' => '连接器类型',
+ 'description' => '连接器类型',
'type' => 'string',
- 'required' => false,
- 'example' => 'AAAAAdH70eOCSCKtacdomNzak4U=',
+ 'required' => true,
+ 'example' => 'FILE',
+ 'enum' => ['FILE'],
],
],
[
- 'name' => 'MaxResults',
+ 'name' => 'Description',
'in' => 'formData',
- 'schema' => [
- 'description' => '分页查询时每页类目数量。最大值为 200。取值范围[1-200]'."\n"
- ."\n"
- .'默认值:'."\n"
- .'当不设置值或设置的值小于 1 时,默认值为20。当设置的值大于 200 时,默认值为 200。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '500',
- 'minimum' => '0',
- 'example' => '20',
- ],
+ 'schema' => ['title' => '描述', 'description' => '描述', 'type' => 'string', 'required' => true, 'example' => '文件连接器', 'maxLength' => 200, 'minLength' => 1],
],
[
- 'name' => 'CategoryName',
+ 'name' => 'FileConnectorConfig',
'in' => 'formData',
+ 'style' => 'json',
'schema' => [
- 'description' => '即根据类目名称对接口返回的类目列表进行精确匹配/过滤。默认值为空,即不启用类目名称过滤。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '产品清单',
- ],
- ],
- ],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
+ 'title' => '文件连接器参数',
+ 'description' => '文件连接器参数',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
+ 'RegionId' => ['title' => '存储bucket区域', 'description' => '存储bucket区域', 'type' => 'string', 'required' => false, 'example' => 'cn-hangzhou'],
+ 'BucketName' => ['title' => '存储bucket名称', 'description' => '存储bucket名称', 'type' => 'string', 'required' => false, 'example' => 'zyb-docker-registry-jn'],
+ 'StorageType' => [
+ 'title' => '文件存储位置'."\n"
+ .'OSS_CUSTOM:使用自有OSS存储 '."\n"
+ .'OSS_PLATFORM:使用平台OSS存储',
+ 'description' => '文件存储位置'."\n"
+ .'OSS_CUSTOM:使用自有OSS存储 '."\n"
+ .'OSS_PLATFORM:使用平台OSS存储',
'type' => 'string',
- 'example' => 'success',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'CategoryList' => [
- 'description' => '类目列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '类目对象。',
- 'type' => 'object',
- 'properties' => [
- 'CategoryId' => [
- 'description' => '类目 ID。',
- 'type' => 'string',
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
- 'CategoryName' => [
- 'description' => '类目名称。',
- 'type' => 'string',
- 'example' => '类目1',
- ],
- 'CategoryType' => [
- 'description' => '类目类型,可能值为:'."\n"
- .'- UNSTRUCTURED:类目。',
- 'type' => 'string',
- 'example' => 'UNSTRUCTURED',
- ],
- 'IsDefault' => [
- 'description' => '是否为默认类目。可能值为:'."\n"
- .'- true:是。'."\n"
- .'- false:否。'."\n"
- ."\n"
- .'默认类目不允许删除。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'ParentCategoryId' => [
- 'description' => '父类目的类目 ID。',
- 'type' => 'string',
- 'example' => 'cate_addd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
- ],
- ],
- ],
- 'HasNext' => [
- 'description' => '符合查询条件的类目数据是否存在下一页,可能值为:'."\n"
- ."\n"
- .'- true:是。'."\n"
- .'- false:否。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'MaxResults' => [
- 'description' => '分页查询时每页类目数量。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '20',
- ],
- 'NextToken' => [
- 'description' => '本次调用返回的查询凭证值。',
- 'type' => 'string',
- 'example' => 'AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ',
- ],
- 'TotalCount' => [
- 'description' => '返回结果的总类目数量。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '20',
- ],
- ],
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'workspace id is null or invalid.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
+ 'required' => false,
+ 'example' => 'OSS_CUSTOM',
+ 'enum' => ['OSS_CUSTOM', 'OSS_PLATFORM'],
],
],
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"CategoryList\\": [\\n {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CategoryName\\": \\"类目1\\",\\n \\"CategoryType\\": \\"UNSTRUCTURED\\",\\n \\"IsDefault\\": true,\\n \\"ParentCategoryId\\": \\"cate_addd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\"\\n }\\n ],\\n \\"HasNext\\": true,\\n \\"MaxResults\\": 20,\\n \\"NextToken\\": \\"AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ\\",\\n \\"TotalCount\\": 20\\n },\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '类目列表',
- 'description' => '- 暂不支持通过API查询数据表。'."\n"
- .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'注意本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
- ],
- 'AddCategory' => [
- 'summary' => '在指定的业务空间中创建一个类目,用于分类和管理文件。每个业务空间最多创建500个类目。',
- 'path' => '/{WorkspaceId}/datacenter/category/',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
- 'security' => [
- [
- 'AK' => [],
- ],
- ],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
- 'parameters' => [
- [
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID,即在该业务空间中新增类目。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
- ],
- [
- 'name' => 'CategoryName',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '类目名称。长度为 1~20 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '产品清单',
- ],
- ],
- [
- 'name' => 'CategoryType',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '类目类型。取值范围:'."\n"
- .'- UNSTRUCTURED:类目。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'UNSTRUCTURED',
- 'enum' => [
- 'UNSTRUCTURED',
- ],
- ],
- ],
- [
- 'name' => 'ParentCategoryId',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '父类目的类目 ID。在此父类目下创建新类目,此值为空时创建一级类目。',
- 'type' => 'string',
'required' => false,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
],
],
],
@@ -768,169 +226,122 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'success',
- ],
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'Success'],
'Data' => [
- 'description' => '接口业务数据字段。',
+ 'description' => '接口业务数据字段',
'type' => 'object',
'properties' => [
- 'CategoryId' => [
- 'description' => '类目 ID。请妥善保管该值,它将用于后续所有与此类目相关的API操作。',
- 'type' => 'string',
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
- 'CategoryName' => [
- 'description' => '类目名称。',
- 'type' => 'string',
- 'example' => '类目名称',
- ],
+ 'ConnectorId' => ['title' => '连接器id', 'description' => '连接器 ID', 'type' => 'string', 'example' => 'conn_file_e0c9db4030b2465a9478028f7d76cd92_1234'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Requests throttling triggered.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。 '."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Current file status does not support delete.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '35A267BF-FBFA-54DB-8394-AA3B0742D833'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功'."\n"
+ .'- false:失败', 'type' => 'boolean', 'example' => 'true'."\n"],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CategoryName\\": \\"类目名称\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '新增类目',
- 'description' => '- 不支持通过API新增数据表,请通过控制台的<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>操作。'."\n"
- .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:AddCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '新增连接器',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:AddCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
.'- 本接口不具备幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"ConnectorId\\": \\"conn_file_e0c9db4030b2465a9478028f7d76cd92_1234\\"\\n },\\n \\"Message\\": \\"Current file status does not support delete.\\",\\n \\"RequestId\\": \\"35A267BF-FBFA-54DB-8394-AA3B0742D833\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
],
'AddFile' => [
- 'summary' => '将存储于阿里云百炼临时存储空间内的文件导入至阿里云百炼应用数据。',
'path' => '/{WorkspaceId}/datacenter/file',
- 'methods' => [
- 'put',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'LeaseId',
'in' => 'formData',
- 'schema' => [
- 'description' => '上传租约 ID,对应 **ApplyFileUploadLease** 接口返回的` FileUploadLeaseId`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '68abd1dea7b6404d8f7d7b9f7fbd332d.17166xxxxxxxx',
- ],
+ 'schema' => ['description' => '上传租约 ID,对应 **ApplyFileUploadLease** 接口返回的` FileUploadLeaseId`。', 'type' => 'string', 'required' => true, 'example' => '68abd1dea7b6404d8f7d7b9f7fbd332d.17166xxxxxxxx'],
],
[
'name' => 'Parser',
'in' => 'formData',
- 'schema' => [
- 'description' => '解析器类型。取值范围:'."\n"
- .'- DASHSCOPE_DOCMIND:阿里云文档智能解析(不支持更改)。'."\n"
- ."\n"
- .'<props="intl">'."\n"
- .'<note>解析器会根据当前类目的数据解析设置,对您上传的文件进行解析。</note>'."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="china">'."\n"
- .'<note>当CategoryType为UNSTRUCTURED时,解析器会根据当前类目的数据解析设置,对您上传的文件进行解析。</note>'."\n"
- .'<note>当CategoryType为SESSION_FILE时,系统将使用默认方式(不支持更改)解析文件内容。</note>'."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'DASHSCOPE_DOCMIND',
- ],
+ 'schema' => ['description' => '解析器类型。可能取值范围包括:'."\n"
+ ."\n"
+ .'- DOCMIND(智能文档解析)'."\n"
+ .'- DOCMIND_DIGITAL(电子文档解析)'."\n"
+ .'- DOCMIND_LLM_VERSION(大模型文档解析)'."\n"
+ .'- DASH_QWEN_VL_PARSER(Qwen VL 解析)'."\n"
+ .'- DOCMIND_LLM_VERSION_MEDIA(音视频解析)'."\n"
+ .'- AUTO_SELECT(自动选择解析器)'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ .'<note>会以当前设置的解析器对您上传的文件进行解析,若输入AUTO_SELECT则会使用所属类目配置的解析器。</note>'."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ .'<note>当CategoryType为UNSTRUCTURED时,解析器会根据当前类目的数据解析设置,对您上传的文件进行解析。</note>'."\n"
+ .'<note>当CategoryType为SESSION_FILE时,系统将使用默认方式(不支持更改)解析文件内容。</note>'."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'AUTO_SELECT'],
],
[
'name' => 'CategoryId',
'in' => 'formData',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'- 当CategoryType为UNSTRUCTURED时,需传入上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以前往[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
- ."\n"
- .'- 当CategoryType为SESSION_FILE时,传入“default”即可。'."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'需传入上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以前往[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'- 当CategoryType为UNSTRUCTURED时,需传入上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以前往[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
+ ."\n"
+ .'- 当CategoryType为SESSION_FILE时,传入“default”即可。'."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'需传入上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以前往[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
],
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID,即文件将上传至该业务空间中。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx'."\n",
- ],
+ 'schema' => ['description' => '业务空间 ID,即文件将上传至该业务空间中。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
],
[
'name' => 'Tags',
'in' => 'formData',
'style' => 'json',
'schema' => [
- 'description' => '文件关联的标签列表。默认值为空,即文件不关联任何标签。最多传入32个标签。',
+ 'description' => '- 文件关联的标签列表。最多传入100个标签,所有标签字符长度总和不能超过700。'."\n"
+ .'- 默认值为空,即不设置标签。',
'type' => 'array',
- 'items' => [
- 'description' => '文件的标签。每个标签最多32个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '产品介绍',
- ],
+ 'items' => ['description' => '文件的标签。每个标签最多32个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-。', 'type' => 'string', 'required' => false, 'example' => '产品介绍'],
'required' => false,
- 'maxItems' => 32,
+ 'maxItems' => 100,
'minItems' => 1,
],
],
@@ -950,34 +361,51 @@
'required' => false,
'example' => 'UNSTRUCTURED',
'default' => 'UNSTRUCTURED',
- 'enum' => [
- 'UNSTRUCTURED',
- 'SESSION_FILE',
- ],
+ 'enum' => ['UNSTRUCTURED', 'SESSION_FILE'],
],
],
[
'name' => 'OriginalFileUrl',
'in' => 'formData',
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'通过此参数为文件添加一个URL,系统将在构建[文档搜索类知识库](~~2807740~~)时记录该链接。在使用阿里云百炼控制台与[智能体应用](~~2842749~~)对话时,随该文件召回结果返回(通过`docUrl`字段)。'."\n"
+ ."\n"
+ .'> 智能体应用必须开启**知识库**,并启用**展示回答来源**功能,否则此参数不生效。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'通过此参数为文件添加一个URL,系统将在构建[文档搜索类知识库](~~2807740~~)时记录该链接。在使用阿里云百炼控制台与[智能体应用](~~2842749~~)对话时,随该文件召回结果返回(通过`docUrl`字段)。'."\n"
+ ."\n"
+ .'> 智能体应用必须开启**知识库**,并启用**展示回答来源**功能,否则此参数不生效。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => 'www.test.com/111.docx'],
+ ],
+ [
+ 'name' => 'ParserConfig',
+ 'in' => 'formData',
+ 'style' => 'json',
'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'通过此参数为文件添加一个URL,系统将在构建[文档搜索类知识库](~~2807740~~)时记录该链接。在使用阿里云百炼控制台与[智能体应用](~~2842749~~)对话时,随该文件召回结果返回(通过`docUrl`字段)。'."\n"
- ."\n"
- .'> 智能体应用必须开启**知识库**,并启用**展示回答来源**功能,否则此参数不生效。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'通过此参数为文件添加一个URL,系统将在构建[文档搜索类知识库](~~2807740~~)时记录该链接。在使用阿里云百炼控制台与[智能体应用](~~2842749~~)对话时,随该文件召回结果返回(通过`docUrl`字段)。'."\n"
- ."\n"
- .'> 智能体应用必须开启**知识库**,并启用**展示回答来源**功能,否则此参数不生效。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
+ 'title' => '解析器配置,仅当类型被设置为 Qwen VL 解析时才需要传入。',
+ 'description' => '解析器配置,仅当类型被设置为Qwen VL解析时才需要传入。',
+ 'type' => 'object',
+ 'properties' => [
+ 'ModelName' => [
+ 'title' => '模型名称。',
+ 'description' => '模型名称。',
+ 'type' => 'string',
+ 'required' => false,
+ 'example' => 'qwen-vl-max',
+ 'enum' => ['qwen-vl-max', 'qwen-vl-plus', 'qwen3-vl-plus'],
+ ],
+ 'ModelPrompt' => ['title' => '调用 Qwen VL 解析时的 Prompt。', 'description' => '调用Qwen VL解析时的Prompt。', 'type' => 'string', 'required' => false, 'example' => '#角色'."\n"
+ .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
+ .'# 任务目标'."\n"
+ .'请结合输入图片,详细描述图片中的内容。', 'maxLength' => 1500, 'minLength' => 1],
+ ],
'required' => false,
- 'example' => 'www.test.com/111.docx',
],
],
],
@@ -988,116 +416,85 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'DataCenter.FileTooLarge',
- ],
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'DataCenter.FileTooLarge'],
'Data' => [
- 'description' => '接口业务数据字段。',
+ 'description' => '接口业务数据字段',
'type' => 'object',
'properties' => [
- 'FileId' => [
- 'description' => '文件 ID,请妥善保管该值,它将用于后续与此文件相关的所有API操作。',
- 'type' => 'string',
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- 'Parser' => [
- 'description' => '解析该文件使用的解析器类型。可能值为:'."\n"
- .'- DASHSCOPE_DOCMIND:阿里云文档智能解析。',
- 'type' => 'string',
- 'example' => 'DASHSCOPE_DOCMIND',
- ],
+ 'FileId' => ['description' => '文件 ID,请妥善保管该值,它将用于后续与此文件相关的所有API操作', 'type' => 'string', 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
+ 'Parser' => ['description' => '解析该文件使用的解析器类型。可能值为:'."\n"
+ .'- DASHSCOPE_DOCMIND:阿里云文档智能解析', 'type' => 'string', 'example' => 'DASHSCOPE_DOCMIND'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'string',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功'."\n"
+ .'- false:失败', 'type' => 'string', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": \\"true\\"\\n}","type":"json"}]',
+ 'staticInfo' => ['returnType' => 'synchronous'],
'title' => '添加文件',
+ 'summary' => '将存储于阿里云百炼临时存储空间内的文件导入至阿里云百炼数据连接(原应用数据)。',
'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:AddFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
."\n"
.'- 本接口不具备幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2025-09-28T10:20:10.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-05-08T07:51:53.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-12-26T07:33:02.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-09-18T08:46:20.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddFile'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": \\"true\\"\\n}","type":"json"}]',
],
'AddFilesFromAuthorizedOss' => [
- 'summary' => '将已授权OSS Bucket中的文件导入阿里云百炼应用数据中。',
'path' => '/{WorkspaceId}/datacenter/file/fromoss',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID,将文件导入至该业务空间。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
+ 'schema' => ['description' => '业务空间 ID,将文件导入至该业务空间。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
'name' => 'CategoryId',
'in' => 'formData',
- 'schema' => [
- 'description' => '用于指定文件导入目标类目。即 AddCategory 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入 default,即使用系统创建的“默认类目”。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
+ 'schema' => ['description' => '用于指定文件导入目标类目。即 AddCategory 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击类目名称旁的 ID 图标获取类目 ID。此处允许传入 default,即使用系统创建的“默认类目”。', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
],
[
'name' => 'CategoryType',
@@ -1113,35 +510,20 @@
.'</props>',
'type' => 'string',
'required' => true,
- 'enumValueTitles' => [
- 'UNSTRUCTURED' => 'UNSTRUCTURED',
- ],
+ 'enumValueTitles' => ['UNSTRUCTURED' => 'UNSTRUCTURED'],
'example' => 'UNSTRUCTURED',
- 'enum' => [
- 'UNSTRUCTURED',
- 'SESSION_FILE',
- ],
+ 'enum' => ['UNSTRUCTURED', 'SESSION_FILE'],
],
],
[
'name' => 'OssRegionId',
'in' => 'formData',
- 'schema' => [
- 'description' => 'OSS Bucket的地域ID。获取方式请参见[OSS地域和访问域名](~~31837~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cn-beijing',
- ],
+ 'schema' => ['description' => 'OSS Bucket的地域ID。获取方式请参见[OSS地域和访问域名](~~31837~~)。', 'type' => 'string', 'required' => true, 'example' => 'cn-beijing'],
],
[
'name' => 'OssBucketName',
'in' => 'formData',
- 'schema' => [
- 'description' => 'OSS Bucket名称,详见[存储空间](~~177682~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'bucketNamexxxxx',
- ],
+ 'schema' => ['description' => 'OSS Bucket名称,详见[存储空间](~~177682~~)。', 'type' => 'string', 'required' => true, 'example' => 'bucketNamexxxxx'],
],
[
'name' => 'FileDetails',
@@ -1156,25 +538,65 @@
'description' => '文件对象。',
'type' => 'object',
'properties' => [
- 'FileName' => [
- 'description' => '导入文件的名称,注意后缀需要带上文件格式类型。'."\n"
- .'- 支持格式:pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。'."\n"
- .'- 文件名称长度限制4-128个字符。'."\n"
- .'- 对文件上传要求限制,请参见[知识库配额与限制](~~2880605~~)。'."\n"
- .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。',
+ 'FileName' => ['description' => '导入文件的名称,注意后缀需要带上文件格式类型。'."\n"
+ .'- 支持格式:pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。'."\n"
+ .'- 文件名称长度限制4-128个字符。'."\n"
+ .'- 对文件上传要求限制,请参见[知识库配额与限制](~~2880605~~)。'."\n"
+ ."\n"
+ .'><notice>当导入的文件名称与知识库中已有文件名称重复时,接口仍会返回`Status`为`SUCCESS`,但该文件实际不会被导入知识库,已有的同名文件保持不变。请确保每次导入的文件名称唯一。></notice>'."\n"
+ .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。', 'type' => 'string', 'required' => true, 'example' => 'this_is_temp_xxxx.pdf', 'maxLength' => 500, 'minLength' => 1],
+ 'OssKey' => ['description' => '导入文件在OSS Bucket中的键名(Key),详见[对象命名](~~273129~~)。', 'type' => 'string', 'required' => true, 'example' => 'root/path/this_is_temp_xxxx.pdf', 'maxLength' => 256, 'minLength' => 1],
+ 'Parser' => [
+ 'title' => '解析器类型。可能取值范围包括:'."\n"
+ ."\n"
+ .'DOCMIND(智能文档解析)'."\n"
+ .'DOCMIND_DIGITAL(电子文档解析)'."\n"
+ .'DOCMIND_LLM_VERSION(大模型文档解析)'."\n"
+ .'DASH_QWEN_VL_PARSER(Qwen VL 解析)'."\n"
+ .'DOCMIND_LLM_VERSION_MEDIA(音视频解析)'."\n"
+ .'AUTO_SELECT(自动选择解析器',
+ 'description' => '解析器类型。可能取值范围包括:'."\n"
+ ."\n"
+ .'- DOCMIND(智能文档解析)'."\n"
+ .'- DOCMIND_DIGITAL(电子文档解析)'."\n"
+ .'- DOCMIND_LLM_VERSION(大模型文档解析)'."\n"
+ .'- DASH_QWEN_VL_PARSER(Qwen VL 解析)'."\n"
+ .'- DOCMIND_LLM_VERSION_MEDIA(音视频解析)'."\n"
+ .'- AUTO_SELECT(自动选择解析器)'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ .'<note>会以当前设置的解析器对您上传的文件进行解析,若输入AUTO_SELECT则会使用所属类目配置的解析器。</note>'."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ .'<note>当CategoryType为UNSTRUCTURED时,解析器会根据当前类目的数据解析设置,对您上传的文件进行解析。</note>'."\n"
+ .'<note>当CategoryType为SESSION_FILE时,系统将使用默认方式(不支持更改)解析文件内容。</note>'."\n"
+ .'</props>',
'type' => 'string',
- 'required' => true,
- 'example' => 'this_is_temp_xxxx.pdf',
- 'maxLength' => 500,
- 'minLength' => 1,
+ 'required' => false,
+ 'example' => 'AUTO_SELECT',
+ 'default' => 'AUTO_SELECT',
+ 'enum' => ['DOCMIND', 'DOCMIND_DIGITAL', 'DOCMIND_LLM_VERSION', 'DASH_QWEN_VL_PARSER', 'DOCMIND_LLM_VERSION_MEDIA', 'AUTO_SELECT'],
],
- 'OssKey' => [
- 'description' => '导入文件在OSS Bucket中的键名(Key),详见[对象命名](~~273129~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'root/path/this_is_temp_xxxx.pdf',
- 'maxLength' => 256,
- 'minLength' => 1,
+ 'ParserConfig' => [
+ 'title' => '解析器配置,仅当类型被设置为 Qwen VL 解析时才需要传入。',
+ 'description' => '解析器配置,仅当类型被设置为 Qwen VL 解析时才需要传入。',
+ 'type' => 'object',
+ 'properties' => [
+ 'ModelName' => [
+ 'title' => '模型名称。',
+ 'description' => '模型名称。',
+ 'type' => 'string',
+ 'required' => false,
+ 'example' => 'qwen-vl-max',
+ 'enum' => ['qwen-vl-max', 'qwen-vl-plus', 'qwen3-vl-plus'],
+ ],
+ 'ModelPrompt' => ['title' => '调用 Qwen VL 解析时的 Prompt。', 'description' => '调用Qwen VL解析时的Prompt。', 'type' => 'string', 'required' => false, 'example' => '#角色'."\n"
+ .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
+ .'# 任务目标'."\n"
+ .'请结合输入图片,详细描述图片中的内容。', 'maxLength' => 1000, 'minLength' => 1],
+ ],
+ 'required' => false,
],
],
'required' => true,
@@ -1189,27 +611,17 @@
'in' => 'formData',
'style' => 'json',
'schema' => [
+ 'title' => '',
'description' => '文件关联的标签列表。默认值为空,即文件不关联任何标签。最多传入 10 个标签。',
'type' => 'array',
- 'items' => [
- 'description' => '文件的标签。每个标签最多 12 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '产品介绍',
- ],
+ 'items' => ['description' => '文件的标签。每个标签最多 12 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-。', 'type' => 'string', 'required' => false, 'example' => '产品介绍'],
'required' => false,
],
],
[
'name' => 'OverWriteFileByOssKey',
'in' => 'formData',
- 'schema' => [
- 'title' => '是否按照osossKey覆盖类目中的相同文件',
- 'description' => '是否按照OssKey覆盖类目中的相同文件,默认值为false,即不覆盖。',
- 'type' => 'boolean',
- 'required' => false,
- 'example' => 'false',
- ],
+ 'schema' => ['title' => '是否按照osossKey覆盖类目中的相同文件', 'description' => '是否按照OssKey覆盖类目中的相同文件,默认值为false,即不覆盖。', 'type' => 'boolean', 'required' => false, 'example' => 'false'],
],
],
'responses' => [
@@ -1219,11 +631,7 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'success',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
'Data' => [
'description' => '接口业务数据字段。',
'type' => 'object',
@@ -1232,71 +640,37 @@
'description' => '文件导入结果列表。',
'type' => 'array',
'items' => [
+ 'description' => '文件导入结果列表。',
'type' => 'object',
'properties' => [
- 'FileId' => [
- 'description' => '文件 ID,请妥善保管该值,它将用于后续与此文件相关的所有API操作。',
- 'type' => 'string',
- 'example' => 'file_809f469a59ac449586ec692576xxxxx_102248XXX',
- ],
- 'OssKey' => [
- 'description' => '导入文件在OSS Bucket中的键名(Key)。',
- 'type' => 'string',
- 'example' => 'root/path/this_is_temp_xxxx.pdf',
- ],
- 'Status' => [
- 'description' => '文件导入状态。状态可能值为:'."\n"
- ."\n"
- .'- SUCCESS:导入(应用数据)完成。'."\n"
- .'- FAILED:导入(应用数据)失败。'."\n"
- ."\n"
- .'> 状态为SUCCESS的文件才能用于创建/更新知识库。'."\n"
- .'>',
- 'type' => 'string',
- 'example' => 'SUCCESS',
- ],
- 'Msg' => [
- 'description' => '文件导入失败时返回错误信息。',
- 'type' => 'string',
- 'example' => 'size too large',
- ],
+ 'FileId' => ['description' => '文件 ID,请妥善保管该值,它将用于后续与此文件相关的所有API操作。', 'type' => 'string', 'example' => 'file_809f469a59ac449586ec692576xxxxx_102248XXX'],
+ 'OssKey' => ['description' => '导入文件在OSS Bucket中的键名(Key)。', 'type' => 'string', 'example' => 'root/path/this_is_temp_xxxx.pdf'],
+ 'Status' => ['description' => '文件导入状态。状态可能值为:'."\n"
+ ."\n"
+ .'- SUCCESS:导入(应用数据)完成。'."\n"
+ .'- FAILED:导入(应用数据)失败。'."\n"
+ ."\n"
+ .'> 状态为SUCCESS的文件才能用于创建/更新知识库。'."\n"
+ .'>', 'type' => 'string', 'example' => 'SUCCESS'],
+ 'Msg' => ['description' => '文件导入失败时返回错误信息。', 'type' => 'string', 'example' => 'size too large'],
],
],
],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Cant find out category for category_id param.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功 。'."\n"
- .'- false:失败。',
- 'type' => 'string',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Cant find out category for category_id param.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 。'."\n"
+ .'- false:失败。', 'type' => 'string', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"AddFileResultList\\": [\\n {\\n \\"FileId\\": \\"file_809f469a59ac449586ec692576xxxxx_102248XXX\\",\\n \\"OssKey\\": \\"root/path/this_is_temp_xxxx.pdf\\",\\n \\"Status\\": \\"SUCCESS\\",\\n \\"Msg\\": \\"size too large\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Cant find out category for category_id param.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": \\"true\\"\\n}","type":"json"}]',
+ 'staticInfo' => ['returnType' => 'synchronous'],
'title' => '从已授权OSS Bucket中导入文件',
+ 'summary' => '将已授权OSS Bucket中的文件导入阿里云百炼应用数据中。',
'description' => '- 请确保该OSS Bucket与阿里云百炼同属一个阿里云账号(主账号),并已按[从OSS导入数据配置说明](~~2782155~~)完成授权。'."\n"
.' '."\n"
.' - 支持的Bucket存储类型不包括归档、冷归档或深度冷归档。支持内容加密的Bucket。支持公共读写/公共读/私有的Bucket。'."\n"
@@ -1307,109 +681,220 @@
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
- ],
- 'ApplyFileUploadLease' => [
- 'summary' => '请求一个上传租约用于上传知识库文件,或智能体应用会话交互的文件。',
- 'path' => '/{WorkspaceId}/datacenter/category/{CategoryId}',
- 'methods' => [
- 'post',
+ 'changeSet' => [
+ ['createdAt' => '2025-09-10T05:36:04.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-08-22T09:15:24.000Z', 'description' => '请求参数发生变更'],
],
- 'schemes' => [
- 'https',
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddFilesFromAuthorizedOss'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddFilesFromAuthorizedOss',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"AddFileResultList\\": [\\n {\\n \\"FileId\\": \\"file_809f469a59ac449586ec692576xxxxx_102248XXX\\",\\n \\"OssKey\\": \\"root/path/this_is_temp_xxxx.pdf\\",\\n \\"Status\\": \\"SUCCESS\\",\\n \\"Msg\\": \\"size too large\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Cant find out category for category_id param.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": \\"true\\"\\n}","type":"json"}]',
+ ],
+ 'AddTable' => [
+ 'summary' => '为表格数据连接器添加表格。',
+ 'path' => '/{WorkspaceId}/datacenter/table',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'CategoryId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
+ ],
+ [
+ 'name' => 'TableName',
+ 'in' => 'formData',
+ 'schema' => ['description' => '表名。', 'type' => 'string', 'required' => true, 'example' => 'ads_wjjr_basc_enterprise_di', 'maxLength' => 64, 'minLength' => 1],
+ ],
+ [
+ 'name' => 'TableDesc',
+ 'in' => 'formData',
+ 'schema' => ['title' => '表格描述', 'description' => '表格描述', 'type' => 'string', 'required' => false, 'example' => 'table description', 'maxLength' => 200, 'minLength' => 1],
+ ],
+ [
+ 'name' => 'ConnectorId',
+ 'in' => 'formData',
+ 'schema' => ['description' => '连接器ID。', 'type' => 'string', 'required' => true, 'example' => 'connector-d51861492df64257'],
+ ],
+ [
+ 'name' => 'TableColumns',
+ 'in' => 'formData',
+ 'style' => 'json',
'schema' => [
- 'description' => '上传用于构建[知识库](~~2807740~~)的文件时:'."\n"
- ."\n"
- .'- 该字段代表上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击类目名称旁的 ID 图标获取。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
- .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。'."\n"
- .'>'."\n"
- .'<props="china">'."\n"
- .'上传用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件时:'."\n"
- ."\n"
- .'- 此处传入default即可,系统会自动创建或者匹配默认类目,后续会开放动态文件类目接口及控制台管理页面。'."\n"
- .'</props>',
- 'type' => 'string',
+ 'title' => '表格的列信息',
+ 'description' => '表格的列信息',
+ 'type' => 'array',
+ 'items' => [
+ 'title' => '单个列信息',
+ 'description' => '单个列信息',
+ 'type' => 'object',
+ 'properties' => [
+ 'ColumnName' => ['title' => '列名称', 'description' => '列名称', 'type' => 'string', 'required' => true, 'example' => 'column1', 'maxLength' => 15, 'minLength' => 1],
+ 'ColumnDesc' => ['title' => '列描述', 'description' => '列描述', 'type' => 'string', 'required' => false, 'example' => 'desc', 'maxLength' => 15, 'minLength' => 0],
+ 'DataType' => [
+ 'title' => '数据类型',
+ 'description' => '数据类型',
+ 'type' => 'string',
+ 'required' => true,
+ 'example' => 'string',
+ 'default' => 'string',
+ 'enum' => ['string', 'double', 'long', 'datetime', 'image_url'],
+ ],
+ ],
+ 'required' => true,
+ ],
'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
+ 'minItems' => 1,
],
],
+ ],
+ 'responses' => [
+ 200 => [
+ 'schema' => [
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.Forbidden'],
+ 'Data' => [
+ 'description' => '返回内容',
+ 'type' => 'object',
+ 'properties' => [
+ 'TableId' => ['description' => '表格ID', 'type' => 'string', 'example' => 'table_b6ddc67e7df14db38b74ef5e2e0fe24e_12792097'],
+ ],
+ ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '778C0B3B-03C1-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'True'],
+ ],
+ ],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '添加表格',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:AddTable权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ ."\n"
+ .'- 本接口不具备幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddTable',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.Forbidden\\",\\n \\"Data\\": {\\n \\"TableId\\": \\"table_b6ddc67e7df14db38b74ef5e2e0fe24e_12792097\\"\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"778C0B3B-03C1-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'ApplyFileUploadLease' => [
+ 'summary' => '请求一个上传租约用于上传知识库文件,或智能体应用会话交互的文件。',
+ 'path' => '/{WorkspaceId}/datacenter/category/{CategoryId}',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'CategoryId',
+ 'in' => 'path',
+ 'schema' => ['description' => '上传用于构建[知识库](~~2807740~~)的文件时:'."\n"
+ ."\n"
+ .'- 该字段代表上传文件所属类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击类目名称旁的 ID 图标获取。此处允许传入default,即使用系统创建的“默认类目”。'."\n"
+ .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。'."\n"
+ .'>'."\n"
+ .'<props="china">'."\n"
+ .'上传用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件时:'."\n"
+ ."\n"
+ .'- 此处传入default即可,系统会自动创建或者匹配默认类目,后续会开放动态文件类目接口及控制台管理页面。'."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
+ ],
[
'name' => 'FileName',
'in' => 'formData',
- 'schema' => [
- 'description' => '上传用于构建[知识库](~~2807740~~)的文件:'."\n"
- .'- 该字段代表上传文件的名称,注意后缀需要带上文件格式类型。支持格式:pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。'."\n"
- .'- 文件名称长度限制4-128个字符。其它限制请参考[知识库配额与限制](~~2880605~~)。'."\n"
- .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。'."\n"
- .'>'."\n"
- .'<props="china">'."\n"
- .'上传用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件:'."\n"
- ."\n"
- .'- 该字段代表上传文件的名称,注意后缀需要带上文件格式类型。支持格式:'."\n"
- .' - 文档:doc、docx、wps、ppt、pptx、xls、xlsx、md、txt、pdf。'."\n"
- .' - 图片:png、jpg、jpeg、bmp、gif。'."\n"
- .' - 音频:aac、amr、flac、flv、m4a、mp3、mpeg、ogg、opus、wav、webm、wma。'."\n"
- .' - 视频:mp4、mkv、avi、mov、wmv。'."\n"
- .'- 文件名称长度限制4-128个字符。'."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'XXXX产品清单.pdf',
- ],
+ 'schema' => ['description' => '上传用于构建[知识库](~~2807740~~)的文件:'."\n"
+ .'- 该字段代表上传文件的名称,注意后缀需要带上文件格式类型,支持格式:'."\n"
+ .' - 文档(小于150MB):doc、docx、wps、ppt、pptx、xls、xlsx、md、txt、pdf、epub、mobi。'."\n"
+ .' - 表格(建议10MB以内,10万行以内):xls、xlsx。'."\n"
+ .' - 纯文本(建议不要超过10MB):md、txt。'."\n"
+ .' - 图片(小于20MB,最短边 > 15px, 长边 < 8192px,长宽比 < 50):png、jpg、jpeg、bmp、gif。'."\n"
+ .' - 音频:aac、amr、flac、flv、m4a、mp3、mpeg、ogg、opus、wav、webm、wma。'."\n"
+ .' - 视频:mp4、mkv、avi、mov、wmv。'."\n"
+ .'- 文件名称长度限制4-128个字符。其它限制请参考[知识库配额与限制](~~2880605~~)。'."\n"
+ .'> 如需新增数据表并上传数据,请使用阿里云百炼控制台,API不支持。'."\n"
+ .'>'."\n"
+ .'<props="china">'."\n"
+ .'上传用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件:'."\n"
+ ."\n"
+ .'- 该字段代表上传文件的名称,注意后缀需要带上文件格式类型。支持格式:'."\n"
+ .' - 文档:doc、docx、wps、ppt、pptx、xls、xlsx、md、txt、pdf、epub、mobi。'."\n"
+ .' - 图片:png、jpg、jpeg、bmp、gif。'."\n"
+ .' - 音频:aac、amr、flac、flv、m4a、mp3、mpeg、ogg、opus、wav、webm、wma。'."\n"
+ .' - 视频:mp4、mkv、avi、mov、wmv。'."\n"
+ .'- 文件名称长度限制4-128个字符。'."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'XXXX产品清单.pdf'],
],
[
'name' => 'Md5',
'in' => 'formData',
- 'schema' => [
- 'description' => '上传文件的MD5值,服务端会验证该字段(当前暂未开启),请正确填写。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '19657c391f6c70bcea63c154d8606bb3',
- 'maxLength' => 64,
- 'minLength' => 1,
- ],
+ 'schema' => ['description' => '上传文件的MD5值,服务端会验证该字段(当前暂未开启),请正确填写。', 'type' => 'string', 'required' => true, 'example' => '19657c391f6c70bcea63c154d8606bb3', 'maxLength' => 64, 'minLength' => 1],
],
[
'name' => 'SizeInBytes',
'in' => 'formData',
- 'schema' => [
- 'description' => '上传文件的大小,单位字节,服务端会验证该字段(当前暂未开启),请正确填写。取值范围:1B-100M。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '1000',
- ],
+ 'schema' => ['description' => '上传文件的大小,单位字节,服务端会验证该字段(当前暂未开启),请正确填写。取值范围:1B-100M。', 'type' => 'string', 'required' => true, 'example' => '1000'],
],
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '上传文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'schema' => ['description' => '上传文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
'name' => 'CategoryType',
@@ -1428,10 +913,7 @@
'required' => false,
'example' => 'UNSTRUCTURED',
'default' => 'UNSTRUCTURED',
- 'enum' => [
- 'UNSTRUCTURED',
- 'SESSION_FILE',
- ],
+ 'enum' => ['UNSTRUCTURED', 'SESSION_FILE'],
],
],
[
@@ -1465,88 +947,45 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'DataCenter.FileTooLarge',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'DataCenter.FileTooLarge'],
'Data' => [
'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
- 'FileUploadLeaseId' => [
- 'description' => '租约唯一 ID,后续调用 **AddFile** 接口时,需要使用该参数。',
- 'type' => 'string',
- 'example' => '1e6a159107384782be5e45ac4759b247.1719325231035',
- ],
+ 'FileUploadLeaseId' => ['description' => '租约唯一 ID,后续调用 **AddFile** 接口时,需要使用该参数。', 'type' => 'string', 'example' => '1e6a159107384782be5e45ac4759b247.1719325231035'],
'Param' => [
'description' => '用于上传文件的 HTTP 请求参数。',
'type' => 'object',
'properties' => [
- 'Headers' => [
- 'description' => '需要放到Header中的K-V字段,K和V均为字符串。'."\n"
- ."\n"
- .'> 返回的Content-Type可能为空值,后续按照空值上传即可。',
- 'type' => 'any',
- 'example' => '"X-bailian-extra":"MTAwNTQyNjQ5NTE2OTE3OA==",'."\n"
- .'"Content-Type":"application/pdf"',
- ],
- 'Method' => [
- 'description' => 'HTTP 调用方法,可能值为:'."\n"
- .'- PUT'."\n"
- .'- POST',
- 'type' => 'string',
- 'example' => 'PUT',
- ],
- 'Url' => [
- 'description' => '文件的上传 URL 地址。'."\n"
- ."\n"
- .'> 该URL为预签名URL,不支持FormData方式上传,需使用二进制方式上传。',
- 'type' => 'string',
- 'example' => 'https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D',
- ],
+ 'Headers' => ['description' => '需要放到Header中的K-V字段,K和V均为字符串。'."\n"
+ ."\n"
+ .'> 返回的Content-Type可能为空值,后续按照空值上传即可。', 'type' => 'any', 'example' => '"X-bailian-extra":"MTAwNTQyNjQ5NTE2OTE3OA==",'."\n"
+ .'"Content-Type":"application/pdf"'],
+ 'Method' => ['description' => 'HTTP 调用方法,可能值为:'."\n"
+ .'- PUT'."\n"
+ .'- POST', 'type' => 'string', 'example' => 'PUT'],
+ 'Url' => ['description' => '文件的上传 URL 地址。'."\n"
+ ."\n"
+ .'> 该URL为预签名URL,不支持FormData方式上传,需使用二进制方式上传。', 'type' => 'string', 'example' => 'https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D'],
],
],
- 'Type' => [
- 'description' => '文件的上传方式,可能值为:'."\n"
- .'- OSS.PreSignedURL'."\n"
- .'- HTTP',
- 'type' => 'string',
- 'example' => 'HTTP',
- ],
+ 'Type' => ['description' => '文件的上传方式,可能值为:'."\n"
+ .'- OSS.PreSignedURL'."\n"
+ .'- HTTP', 'type' => 'string', 'example' => 'HTTP'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"FileUploadLeaseId\\": \\"1e6a159107384782be5e45ac4759b247.1719325231035\\",\\n \\"Param\\": {\\n \\"Headers\\": \\"\\\\\\"X-bailian-extra\\\\\\":\\\\\\"MTAwNTQyNjQ5NTE2OTE3OA==\\\\\\",\\\\n\\\\\\"Content-Type\\\\\\":\\\\\\"application/pdf\\\\\\"\\",\\n \\"Method\\": \\"PUT\\",\\n \\"Url\\": \\"https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D\\"\\n },\\n \\"Type\\": \\"HTTP\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
'title' => '申请文件上传租约',
'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ApplyFileUploadLease权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
@@ -1555,167 +994,60 @@
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'DeleteFile' => [
- 'summary' => '永久删除应用数据中的指定文件。不支持通过API删除数据表,详见下方接口说明。',
- 'path' => '/{WorkspaceId}/datacenter/file/{FileId}/',
- 'methods' => [
- 'delete',
+ 'changeSet' => [
+ ['createdAt' => '2025-04-07T07:31:45.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-12-26T07:33:02.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-08-20T07:11:43.000Z', 'description' => '请求参数发生变更'],
],
- 'schemes' => [
- 'https',
- ],
- 'security' => [
- [
- 'AK' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ApplyFileUploadLease'],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
- 'parameters' => [
- [
- 'name' => 'FileId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- ],
+ 'ramActions' => [
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oxxxx',
- ],
- ],
- ],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'InvalidParameter',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'FileId' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- ],
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Current file status does not support delete.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功 。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:ApplyFileUploadLease',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"InvalidParameter\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\"\\n },\\n \\"Message\\": \\"Current file status does not support delete.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '删除文件',
- 'description' => '- 不支持通过API删除数据表。如需删除数据表或表中特定的数据,请前往<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>操作。'."\n"
- .'- 本接口用于删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中的文件,不会影响已构建好的知识库。如需删除知识库中的文件,请调用 **DeleteIndexDocument** 接口。'."\n"
- .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 本接口仅能删除状态为解析失败(PARSE_FAILED)或解析完成(PARSE_SUCCESS)的文件。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
],
- 'DescribeFile' => [
- 'summary' => '查询应用数据中文件的基本信息,包括文件名称、类型、状态等。',
- 'path' => '/{WorkspaceId}/datacenter/file/{FileId}/',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'ApplyTempStorageLease' => [
+ 'summary' => '该接口用于高代码部署,其他场景暂不支持。用于申请临时文件上传许可,之后需要自己完成文件上传动作。',
+ 'path' => '/{WorkspaceId}/datacenter',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
+ 'name' => 'FileName',
+ 'in' => 'formData',
+ 'schema' => ['title' => '文件名称,需要包含文件后缀', 'description' => '文件名称,需要包含文件后缀', 'type' => 'string', 'required' => true, 'example' => 'example.txt'],
],
[
- 'name' => 'FileId',
+ 'name' => 'SizeInBytes',
+ 'in' => 'formData',
+ 'schema' => ['title' => '文件大小(单位字节)', 'description' => '文件大小(单位字节)', 'type' => 'integer', 'format' => 'int64', 'required' => true, 'minimum' => '0', 'example' => '1024'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
+ 'schema' => ['title' => '百炼业务空间id', 'description' => '百炼业务空间id', 'type' => 'string', 'required' => true, 'example' => 'llm-mbhn96xxxx'],
],
],
'responses' => [
@@ -1725,196 +1057,79 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Success',
- ],
+ 'Code' => ['title' => '错误状态码。', 'description' => '错误状态码。', 'type' => 'string', 'example' => 'DataCenter.FileTooLarge'],
'Data' => [
+ 'title' => '接口业务数据字段。',
'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
- 'CategoryId' => [
- 'description' => '文件所属类目 ID。',
- 'type' => 'string',
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx',
- ],
- 'CreateTime' => [
- 'description' => '文件实际添加到阿里云百炼中的时间戳,格式: yyyy-MM-dd HH:mm:ss,时区:UTC + 8。',
- 'type' => 'string',
- 'example' => '2024-09-09 12:45:43',
- ],
- 'FileId' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- 'FileName' => [
- 'description' => '文件名称。',
- 'type' => 'string',
- 'example' => 'XXX产品介绍.pdf',
- ],
- 'FileType' => [
- 'description' => '文件类型,扩展名。可能值为: pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。',
- 'type' => 'string',
- 'example' => 'pdf',
- ],
- 'Parser' => [
- 'description' => '解析该文件使用的解析器类型。可能值为:'."\n"
- .'- DASHSCOPE_DOCMIND:默认文档解析器。',
- 'type' => 'string',
- 'example' => 'DASHSCOPE_DOCMIND',
- ],
- 'SizeInBytes' => [
- 'description' => '文件大小,单位字节Byte。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '1234',
- ],
- 'Status' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'用于文档类知识库的文件(类型为UNSTRUCTURED),状态可能值为:'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'用于非结构化知识库的文件(类型为UNSTRUCTURED),状态可能值为:'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'- INIT: 待解析。'."\n"
- .'- IN_PARSE_QUEUE:解析队列排队中。'."\n"
- .'- PARSING: 解析中。'."\n"
- .'- PARSE_SUCCESS:解析完成。'."\n"
- .'<note>必须等到状态为PARSE_SUCCESS才能将文档导入知识库。</note>'."\n"
- .'- PARSE_FAILED:解析失败。'."\n"
- ."\n"
- .'<props="china">'."\n"
- .'用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件(类型为SESSION_FILE),状态可能值为:'."\n"
- ."\n"
- .'- INIT: 待解析。'."\n"
- .'- IN_PARSE_QUEUE:解析队列排队中。'."\n"
- .'- PARSING: 解析中。'."\n"
- .'- PARSE_SUCCESS:解析完成。'."\n"
- .'- PARSE_FAILED:解析失败。'."\n"
- .'- SAFE_CHECKING: 安全检测中。'."\n"
- .'- SAFE_CHECK_FAILED: 安全检测失败。'."\n"
- .'- INDEX_BUILDING:索引构建中。'."\n"
- .'- INDEX_BUILD_SUCCESS:索引构建成功。'."\n"
- .'- INDEX_BUILDING_FAILED:索引构建失败。'."\n"
- .'- INDEX_DELETED:文件索引已删除。'."\n"
- .'- FILE_IS_READY:文件准备完毕。'."\n"
- .'<note>必须等到状态为FILE_IS_READY才能进行问答。</note>'."\n"
- .'- FILE_EXPIRED:文件过期。'."\n"
- .'<note>仅用户当前会话有效,用户关闭会话后文件过期(最长有效期为7天),不支持长期保存。</note>'."\n"
- .'</props>',
- 'type' => 'string',
- 'example' => 'PARSE_SUCCESS',
- ],
- 'Tags' => [
- 'description' => '文件关联的标签列表,一个文件支持关联多个标签。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件的标签。',
- 'type' => 'string',
- 'example' => '产品介绍',
+ 'TempStorageLeaseId' => ['title' => '租约唯一 ID,后续应用内获取上传的文件时,需要使用该参数。', 'description' => '租约唯一 ID,后续应用内获取上传的文件时,需要使用该参数。', 'type' => 'string', 'example' => '1e6a159107384782be5e45ac4759b247.1719325231035'],
+ 'Param' => [
+ 'title' => '用于上传文件的 HTTP 参数。',
+ 'description' => '用于上传文件的 HTTP 参数。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Headers' => ['title' => '需要放到Header中的K-V字段,K和V均为字符串。', 'description' => '需要放到Header中的K-V字段,K和V均为字符串。', 'type' => 'any', 'example' => 'Content-Type: application/json'],
+ 'Method' => ['title' => 'HTTP 调用方法,可能值为:'."\n"
+ .'PUT'."\n"
+ .'POST', 'description' => 'HTTP 调用方法,可能值为:'."\n"
+ .'PUT'."\n"
+ .'POST', 'type' => 'string', 'example' => 'PUT'],
+ 'Url' => ['title' => '文件上传的授权 URL 地址。', 'description' => '文件上传的授权 URL 地址。', 'type' => 'string', 'example' => 'https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D'],
],
],
- 'ParseResultDownloadUrl' => [
- 'type' => 'string',
- ],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Requests throttling triggered.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['title' => '错误信息。', 'description' => '错误信息。', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource'],
+ 'RequestId' => ['title' => '请求 ID。', 'description' => '请求 ID。', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['title' => '接口返回的状态码。', 'description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['title' => '接口调用是否成功', 'description' => '接口调用是否成功', 'type' => 'boolean', 'default' => 'true'],
],
],
],
- 403 => [
- 'schema' => [
- 'type' => 'object',
- 'properties' => [
- 'Code' => [
- 'type' => 'string',
- ],
- 'HttpStatusCode' => [
- 'type' => 'integer',
- 'format' => 'int32',
- ],
- 'Message' => [
- 'type' => 'string',
- ],
- 'Success' => [
- 'type' => 'boolean',
- ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"TempStorageLeaseId\\": \\"1e6a159107384782be5e45ac4759b247.1719325231035\\",\\n \\"Param\\": {\\n \\"Headers\\": \\"Content-Type: application/json\\",\\n \\"Method\\": \\"PUT\\",\\n \\"Url\\": \\"https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D\\"\\n }\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '申请临时文件上传许可',
+ 'description' => '1、该接口用于高代码部署,其他场景暂不支持。'."\n"
+ .'2、通过此接口获取到临时文件上传许可之后,需要自己完成文件上传动作。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:ApplyTempStorageLease',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CreateTime\\": \\"2024-09-09 12:45:43\\",\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"FileName\\": \\"XXX产品介绍.pdf\\",\\n \\"FileType\\": \\"pdf\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\",\\n \\"SizeInBytes\\": 1234,\\n \\"Status\\": \\"PARSE_SUCCESS\\",\\n \\"Tags\\": [\\n \\"产品介绍\\"\\n ],\\n \\"ParseResultDownloadUrl\\": \\"\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '查询文件状态',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:DescribeFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- ."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
],
- 'UpdateFileTag' => [
- 'summary' => '更新指定文件标签。',
- 'path' => '/{WorkspaceId}/datacenter/file/{FileId}',
- 'methods' => [
- 'put',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'BatchUpdateFileTag' => [
+ 'summary' => '该接口用于批量更新数据连接中的文档标签。',
+ 'path' => '/{WorkspaceId}/datacenter/batchupdatetag',
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'update',
'riskType' => 'none',
'chargeType' => 'free',
- 'abilityTreeNodes' => [
- 'FEATUREsfm8JET0F',
- ],
+ 'abilityTreeNodes' => ['FEATUREsfm8JET0F'],
'autoTest' => true,
'tenantRelevance' => 'tenant',
],
@@ -1922,338 +1137,46 @@
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
+ 'schema' => ['description' => '业务空间 ID。在百炼的<props="china">[控制台首页](https://bailian.console.aliyun.com/knowledge-base#/home)</props><props="intl">[控制台首页](https://bailian.console.alibabacloud.com/#/home)</props>,单击页面左上角业务空间详情图标获取。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
],
[
- 'name' => 'FileId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '数据中心的文件 ID,您可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- ],
- [
- 'name' => 'Tags',
+ 'name' => 'FileInfos',
'in' => 'formData',
'style' => 'json',
'schema' => [
- 'title' => '文档标签,单个文档最多支持添加10个标签',
- 'description' => '文件的标签。最多传入32个标签,每个标签最多32个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-,标签中不能包含空格。',
+ 'description' => '需要更新的文档列表',
'type' => 'array',
'items' => [
- 'description' => '标签值。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '标签A',
- ],
- 'required' => true,
- 'maxItems' => 32,
- 'minItems' => 1,
- ],
- ],
- ],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'Code' => [
- 'description' => '错误状态码',
- 'type' => 'string',
- 'example' => 'Success',
- ],
- 'Data' => [
- 'description' => '返回内容',
- 'type' => 'object',
- 'properties' => [
- 'FileId' => [
- 'description' => '文件 ID',
- 'type' => 'string',
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- ],
- ],
- 'Message' => [
- 'description' => '错误信息',
- 'type' => 'string',
- 'example' => 'Requests throttling triggered.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- ],
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '更新文件标签',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:UpdateFileTag权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
- ],
- 'GetParseSettings' => [
- 'summary' => '查询指定类目的数据解析设置。',
- 'path' => '/{WorkspaceId}/datacenter/parser/settings',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
- 'security' => [
- [
- 'AK' => [],
- ],
- ],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
- ],
- 'parameters' => [
- [
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
- ],
- [
- 'name' => 'CategoryId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`,或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://bailian.console.alibabacloud.com/?tab=app#/data-center)-非结构化数据页签</props>,单击类目名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- ],
- ],
- ],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '本次请求requestId',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833',
- ],
- 'Data' => [
- 'description' => '请求成功返回的业务数据。',
- 'type' => 'array',
- 'items' => [
- 'description' => '返回具体内容',
- 'type' => 'object',
- 'properties' => [
- 'FileType' => [
- 'description' => '文件类型,扩展名,可能值为: pdf、docx、doc等,列举当前类目中支持的所有文件类型。',
- 'type' => 'string',
- 'example' => 'pdf',
- ],
- 'ParserDisplayName' => [
- 'description' => '解析方式的显示名称。',
- 'type' => 'string',
- 'example' => '电子文档解析',
- ],
- 'ParserConfig' => [
- 'description' => '解析器配置,仅在类型被设置为Qwen VL解析时才会返回。',
- 'type' => 'object',
- 'properties' => [
- 'ModelName' => [
- 'description' => '模型名称。',
- 'type' => 'string',
- 'enumValueTitles' => [
- 'qwen-vl-max' => 'qwen-vl-max',
- 'qwen-vl-plus' => 'qwen-vl-plus',
- ],
- 'example' => 'qwen-vl-max',
- ],
- 'ModelPrompt' => [
- 'description' => '调用Qwen VL解析时的Prompt。',
- 'type' => 'string',
- 'example' => '#角色'."\n"
- .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
- .'# 任务目标'."\n"
- .'请结合输入图片,详细描述图片中的内容。',
- ],
- ],
- ],
- 'Parser' => [
- 'description' => '解析该类目下当前类型文件使用的解析器。可能值为:'."\n"
- .'- DOCMIND:智能文档解析'."\n"
- .'- DOCMIND_DIGITAL:电子文档解析'."\n"
- .'- DOCMIND_LLM_VERSION:大模型文档解析'."\n"
- .'- DASH_QWEN_VL_PARSER:Qwen VL解析',
- 'type' => 'string',
- 'example' => 'DOCMIND',
- ],
- ],
+ 'type' => 'object',
+ 'properties' => [
+ 'FileId' => ['description' => '数据中心的文件 ID,您可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'file_3d5319366e2c46309f4c11cfbeacd5fd_10045951'],
+ 'tags' => [
+ 'description' => '- 文件关联的标签列表。最多传入100个标签,所有标签字符长度总和不能超过700。',
+ 'type' => 'array',
+ 'items' => ['description' => '标签值,每个标签最多32个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-,标签中不能包含空格。', 'type' => 'string', 'required' => false, 'example' => 'TagA'],
+ 'required' => true,
+ 'maxItems' => 100,
+ 'minItems' => 1,
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功 。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'True',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'workspace id is null or invalid.',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'success',
- ],
+ 'required' => true,
+ 'description' => '',
],
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Data\\": [\\n {\\n \\"FileType\\": \\"pdf\\",\\n \\"ParserDisplayName\\": \\"电子文档解析\\",\\n \\"ParserConfig\\": {\\n \\"ModelName\\": \\"qwen-vl-max\\",\\n \\"ModelPrompt\\": \\"#角色\\\\n你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。\\\\n# 任务目标\\\\n请结合输入图片,详细描述图片中的内容。\\"\\n },\\n \\"Parser\\": \\"DOCMIND\\"\\n }\\n ],\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"Code\\": \\"success\\"\\n}","type":"json"}]',
- 'title' => '获取类目解析设置',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetParseSettings权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- ."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'GetAvailableParserTypes' => [
- 'summary' => '根据输入的文件类型(文件扩展名),获取所有支持的解析器类型列表。',
- 'path' => '/{WorkspaceId}/datacenter/parser/parsertype',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
- 'security' => [
- [
- 'AK' => [],
- ],
- ],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
- ],
- 'parameters' => [
- [
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
+ 'maxItems' => 20,
+ 'minItems' => 1,
],
],
[
- 'name' => 'FileType',
- 'in' => 'query',
+ 'name' => 'UpdateMode',
+ 'in' => 'formData',
'schema' => [
- 'description' => '文件类型(扩展名),用于获取支持该文件类型的解析器。可能值为: '."\n"
- .'- doc'."\n"
- .'- docx'."\n"
- .'- ppt'."\n"
- .'- pptx'."\n"
- .'- xls'."\n"
- .'- xlsx'."\n"
- .'- md'."\n"
- .'- txt'."\n"
- .'- pdf'."\n"
- .'- png'."\n"
- .'- jpg'."\n"
- .'- jpeg'."\n"
- .'- bmp'."\n"
- .'- gif'."\n"
- .'- html',
+ 'description' => '更新模式,仅支持APPEND(追加)和OVERWRITE(覆盖)',
'type' => 'string',
- 'required' => true,
- 'example' => 'pdf',
- 'enum' => [
- 'doc',
- 'docx',
- 'ppt',
- 'pptx',
- 'xls',
- 'xlsx',
- 'md',
- 'txt',
- 'pdf',
- 'png',
- 'jpg',
- 'jpeg',
- 'bmp',
- 'gif',
- 'html',
- ],
+ 'required' => false,
+ 'example' => 'OVERWRITE',
+ 'default' => 'OVERWRITE',
+ 'enum' => ['OVERWRITE', 'APPEND'],
],
],
],
@@ -2264,136 +1187,73 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-7734-4F9A-8464-2446XXXXXXX',
- ],
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'Success'],
'Data' => [
- 'description' => '请求成功返回的业务数据。',
+ 'description' => '接口返回的业务字段。',
'type' => 'object',
'properties' => [
- 'FileType' => [
- 'description' => '文件类型,与输入参数中的FileType相同。',
- 'type' => 'string',
- 'example' => 'pdf',
- ],
- 'ParserList' => [
- 'description' => '当前类型支持的解析器列表。',
+ 'UpdateFileTagResultList' => [
+ 'description' => '标签更新的结果列表',
'type' => 'array',
'items' => [
- 'description' => '解析器对象。',
'type' => 'object',
'properties' => [
- 'DisplayName' => [
- 'description' => '解析方式的显示名称。',
- 'type' => 'string',
- 'example' => '智能文档解析',
- ],
- 'Parser' => [
- 'description' => '解析器code。可能值为:'."\n"
- .'- DOCMIND(智能文档解析)'."\n"
- .'- DOCMIND_DIGITAL (电子文档解析)'."\n"
- .'- DOCMIND_LLM_VERSION (大模型文档解析)'."\n"
- .'- DASH_QWEN_VL_PARSER (Qwen-VL解析)',
- 'type' => 'string',
- 'example' => 'DOCMIND',
- ],
+ 'FileId' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_f40f2a32205d44b4a93b11617113da15_10045951'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'ErrorCode' => ['description' => '返回错误码,仅当Success为false时返回。', 'type' => 'string', 'example' => 'NoPermission'],
+ 'ErrorMessage' => ['description' => '错误描述信息,仅当 Success 为 false 时返回。', 'type' => 'string', 'example' => 'FileId not exists.'],
],
+ 'description' => '',
],
],
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Message' => [
- 'description' => '错误信息',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource',
- ],
- 'Code' => [
- 'description' => '返回的错误code。',
- 'type' => 'string',
- 'example' => 'DataCenter.Throttling',
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Required parameter(FileId) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '批量更新文档标签',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-2446XXXXXXX\\",\\n \\"Data\\": {\\n \\"FileType\\": \\"pdf\\",\\n \\"ParserList\\": [\\n {\\n \\"DisplayName\\": \\"智能文档解析\\",\\n \\"Parser\\": \\"DOCMIND\\"\\n }\\n ]\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"Code\\": \\"DataCenter.Throttling\\"\\n}","type":"json"}]',
- 'title' => '获取文件支持的解析器类型',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetAvailableParserTypes权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- ."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"UpdateFileTagResultList\\": [\\n {\\n \\"FileId\\": \\"file_f40f2a32205d44b4a93b11617113da15_10045951\\",\\n \\"Success\\": true,\\n \\"ErrorCode\\": \\"NoPermission\\",\\n \\"ErrorMessage\\": \\"FileId not exists.\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Required parameter(FileId) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
],
'ChangeParseSetting' => [
'summary' => '配置特定文件类型的解析方式。例如,为 .pdf 文件指定使用大模型文档解析,为 .jpg 文件指定使用Qwen VL解析。',
'path' => '/{WorkspaceId}/datacenter/parser/settings',
- 'methods' => [
- 'put',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
+ 'schema' => ['description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
'name' => 'CategoryId',
'in' => 'formData',
- 'schema' => [
- 'description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`,或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://bailian.console.alibabacloud.com/?tab=app#/data-center)-非结构化数据页签</props>,单击类目名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx',
- 'maxLength' => 128,
- 'minLength' => 1,
- ],
+ 'schema' => ['description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`,或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://bailian.console.alibabacloud.com/?tab=app#/data-center)-非结构化数据页签</props>,单击类目名称旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx', 'maxLength' => 128, 'minLength' => 1],
],
[
'name' => 'FileType',
@@ -2418,23 +1278,7 @@
'type' => 'string',
'required' => true,
'example' => 'pdf',
- 'enum' => [
- 'doc',
- 'docx',
- 'ppt',
- 'pptx',
- 'xls',
- 'xlsx',
- 'md',
- 'txt',
- 'pdf',
- 'png',
- 'jpg',
- 'jpeg',
- 'bmp',
- 'gif',
- 'html',
- ],
+ 'enum' => ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'md', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'bmp', 'gif', 'html'],
],
],
[
@@ -2445,25 +1289,13 @@
.'- DOCMIND(智能文档解析)'."\n"
.'- DOCMIND_DIGITAL (电子文档解析)'."\n"
.'- DOCMIND_LLM_VERSION (大模型文档解析)'."\n"
- .'- DASH_QWEN_VL_PARSER (Qwen VL解析)',
+ .'- DASH_QWEN_VL_PARSER (Qwen VL解析)'."\n"
+ .'- DOCMIND_LLM_VERSION_MEDIA(音视频解析)',
'type' => 'string',
'required' => true,
- 'enumValueTitles' => [
- 'DOCMIND' => '智能文档解析',
- 'DOCMIND_LLM_VERSION' => '大模型文档解析',
- 'DOCMIND_DIGITAL' => '电子文档解析',
- 'DASH_QWEN_VL_PARSER' => 'QWEN VL解析',
- ],
+ 'enumValueTitles' => ['DOCMIND' => '智能文档解析', 'DOCMIND_LLM_VERSION' => '大模型文档解析', 'DOCMIND_DIGITAL' => '电子文档解析', 'DASH_QWEN_VL_PARSER' => 'QWEN VL解析'],
'example' => 'DOCMIND',
- 'enum' => [
- 'DOCMIND',
- 'DOCMIND_DIGITAL',
- 'DOCMIND_LLM_VERSION',
- 'DASH_SENSEVOICE',
- 'RAG_VIDEO_PARSER',
- 'DASH_QWEN_VL_PARSER',
- 'BAILIAN_TXT_PARSER',
- ],
+ 'enum' => ['DOCMIND', 'DOCMIND_DIGITAL', 'DOCMIND_LLM_VERSION', 'DASH_SENSEVOICE', 'RAG_VIDEO_PARSER', 'DASH_QWEN_VL_PARSER', 'BAILIAN_TXT_PARSER'],
],
],
[
@@ -2478,25 +1310,14 @@
'description' => '模型名称。',
'type' => 'string',
'required' => false,
- 'enumValueTitles' => [
- 'qwen-vl-max' => 'qwen-vl-max',
- 'qwen-vl-plus' => 'qwen-vl-plus',
- ],
+ 'enumValueTitles' => ['qwen-vl-max' => 'qwen-vl-max', 'qwen-vl-plus' => 'qwen-vl-plus'],
'example' => 'qwen-vl-max',
- 'enum' => [
- 'qwen-vl-max',
- 'qwen-vl-plus',
- ],
- ],
- 'modelPrompt' => [
- 'description' => '调用Qwen VL解析时的Prompt。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '#角色'."\n"
- .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
- .'# 任务目标'."\n"
- .'请结合输入图片,详细描述图片中的内容。',
+ 'enum' => ['qwen-vl-max', 'qwen-vl-plus', 'qwen3-vl-plus'],
],
+ 'modelPrompt' => ['description' => '调用Qwen VL解析时的Prompt。', 'type' => 'string', 'required' => false, 'example' => '#角色'."\n"
+ .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
+ .'# 任务目标'."\n"
+ .'请结合输入图片,详细描述图片中的内容。', 'maxLength' => 1500, 'minLength' => 1],
],
'required' => false,
],
@@ -2509,55 +1330,27 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '7BA8ADD9-53D6-53F0-918F-A1E776AD230E',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '7BA8ADD9-53D6-53F0-918F-A1E776AD230E'],
'Data' => [
'description' => '请求成功返回的业务数据。',
'type' => 'object',
'properties' => [
- 'ChangeResult' => [
- 'description' => '配置是否发生变更。'."\n"
- .'- true:配置已更新。'."\n"
- .'- false:配置未发生变更,修改失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'ChangeResult' => ['description' => '配置是否发生变更。'."\n"
+ .'- true:配置已更新。'."\n"
+ .'- false:配置未发生变更,修改失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功 。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource.',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'InvalidParameter',
- ],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource.'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'InvalidParameter'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"7BA8ADD9-53D6-53F0-918F-A1E776AD230E\\",\\n \\"Data\\": {\\n \\"ChangeResult\\": true\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"Code\\": \\"InvalidParameter\\"\\n}","type":"json"}]',
+ 'staticInfo' => ['returnType' => 'synchronous'],
'title' => '修改类目解析设置',
'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ChangeParseSetting权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
."\n"
@@ -2565,84 +1358,79 @@
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:ChangeParseSetting',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"7BA8ADD9-53D6-53F0-918F-A1E776AD230E\\",\\n \\"Data\\": {\\n \\"ChangeResult\\": true\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"Code\\": \\"InvalidParameter\\"\\n}","type":"json"}]',
],
'CreateIndex' => [
'summary' => '使用此API可创建两类知识库:基于文档或音视频的非结构化知识库,以及用于数据查询或图片问答的结构化知识库。',
'path' => '/{WorkspaceId}/index/create',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'none',
'chargeType' => 'free',
- 'abilityTreeNodes' => [
- 'FEATUREsfmCPN1XS',
- ],
+ 'abilityTreeNodes' => ['FEATUREsfmCPN1XS'],
],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
'allowEmptyValue' => false,
- 'schema' => [
- 'description' => '业务空间 ID,即在该业务空间中创建知识库。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'schema' => ['description' => '业务空间 ID,即在该业务空间中创建知识库。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
'name' => 'Name',
'in' => 'query',
'allowEmptyValue' => false,
- 'schema' => [
- 'description' => '知识库名称。长度为 1~20 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '企业帮助文档库',
- ],
+ 'schema' => ['description' => '知识库名称。长度为 1~20 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。', 'type' => 'string', 'required' => true, 'example' => '企业帮助文档库'],
],
[
'name' => 'StructureType',
'in' => 'query',
'schema' => [
- 'description' => '知识库类型。取值范围:'."\n"
+ 'description' => '知识库类型。'."\n"
+ ."\n"
+ .'**取值范围**:'."\n"
."\n"
- .'- unstructured:文档搜索类知识库。'."\n"
- .'使用场景默认为为基础文档问答,如需创建图文并茂回复场景还需传递knowledgeScene参数并设置为visual_document_qa。'."\n"
+ .'- unstructured:文档搜索或音视频类知识库。文档搜索类型的使用场景默认为基础文档问答。<props="china">如需创建其他场景还需传递knowledgeType和knowledgeScene参数。</props>'."\n"
."\n"
.'<props="china">'."\n"
."\n"
.'- structured:数据查询或图片问答类知识库。'."\n"
."\n"
- .'- multimedia:音视频知识库。'."\n"
- ."\n"
.'</props>'."\n"
."\n"
.'> 请注意,知识库创建后将无法更改其类型。'."\n"
.'>',
'type' => 'string',
'required' => true,
- 'enumValueTitles' => [
- 'unstructured' => 'unstructured',
- ],
+ 'enumValueTitles' => ['unstructured' => 'unstructured'],
'example' => 'unstructured',
],
],
@@ -2722,10 +1510,7 @@
.'</props>',
'type' => 'string',
'required' => false,
- 'enumValueTitles' => [
- 'gte-rerank-hybrid' => '官方排序',
- 'gte-rerank' => 'gte-rerank排序',
- ],
+ 'enumValueTitles' => ['gte-rerank-hybrid' => '官方排序', 'gte-rerank' => 'gte-rerank排序'],
'example' => 'gte-rerank-hybrid',
],
],
@@ -2733,79 +1518,56 @@
'name' => 'RerankMinScore',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => '相似度阈值,仅相似度分数超过此数值的文本切片才会被召回,用于筛选排序模型返回的文本切片。取值范围[0.01-1.00]。'."\n"
- ."\n"
- .'若未指定,默认采用 0.01。',
- 'type' => 'number',
- 'format' => 'double',
- 'required' => false,
- 'example' => '0.20',
- ],
+ 'schema' => ['description' => '相似度阈值,仅相似度分数超过此数值的文本切片才会被召回,用于筛选排序模型返回的文本切片。取值范围[0.01-1.00]。'."\n"
+ ."\n"
+ .'若未指定,默认采用 0.01。', 'type' => 'number', 'format' => 'double', 'required' => false, 'example' => '0.20'],
],
[
'name' => 'ChunkSize',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'分段长度,即每个文本切片的字符数上限。超过该长度时:'."\n"
- ."\n"
- .'- **智能切分**(未指定`chunkMode`):文本很可能会被截断。'."\n"
- .'- **自定义切分**(指定了`chunkMode`):文本将被强制截断。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- .'分段长度,即每个文本切片的字符数上限。超过该长度时,文本很可能会被截断。'."\n"
- .'</props>'."\n"
- ."\n\n"
- .'取值范围[1-6000]。若未指定,默认采用 500。'."\n"
- ."\n"
- .'> 若设置了`ChunkSize`且小于100,则必须同时设置`OverlapSize`。您也可以不指定这2个参数,系统将使用默认值。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '128',
- ],
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'分段长度,即每个文本切片的字符数上限。超过该长度时:'."\n"
+ ."\n"
+ .'- **智能切分**(未指定`chunkMode`):文本很可能会被截断。'."\n"
+ .'- **自定义切分**(指定了`chunkMode`):文本将被强制截断。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ .'分段长度,即每个文本切片的字符数上限。超过该长度时,文本很可能会被截断。'."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'取值范围[1-6000]。若未指定,默认采用 500。'."\n"
+ ."\n"
+ .'> 若设置了`ChunkSize`且小于100,则必须同时设置`OverlapSize`。您也可以不指定这2个参数,系统将使用默认值。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '128'],
],
[
'name' => 'OverlapSize',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => '分段重叠长度,表示当前文本切片与前一个文本切片的重叠字符数。取值范围[0-1024]。'."\n"
- ."\n"
- .'若未指定,默认采用 100。'."\n"
- .'>`OverlapSize`必须小于`ChunkSize`,否则将导致切分异常。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '16',
- ],
+ 'schema' => ['description' => '分段重叠长度,表示当前文本切片与前一个文本切片的重叠字符数。取值范围[0-1024]。'."\n"
+ ."\n"
+ .'若未指定,默认采用 100。'."\n"
+ .'>`OverlapSize`必须小于`ChunkSize`,否则将导致切分异常。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '16'],
],
[
'name' => 'Separator',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'分句标识符,仅在`chunkMode`=**regex**时生效(其他模式下即使传入也不生效)。可传入一个正则表达式(不支持多个),用于将文件分割为小段的文本切片。'."\n"
- ."\n"
- .'使用智能切分(未指定`chunkMode`)时,保持默认空值即可。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => '(?<=。)',
- ],
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'分句标识符,仅在`chunkMode`=**regex**时生效(其他模式下即使传入也不生效)。可传入一个正则表达式(不支持多个),用于将文件分割为小段的文本切片。'."\n"
+ ."\n"
+ .'使用智能切分(未指定`chunkMode`)时,保持默认空值即可。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => '(?<=。)'],
],
[
'name' => 'SourceType',
@@ -2825,10 +1587,7 @@
.'>',
'type' => 'string',
'required' => false,
- 'enumValueTitles' => [
- 'DATA_CENTER_CATEGORY' => '类目类型',
- 'DATA_CENTER_FILE' => '文件类型',
- ],
+ 'enumValueTitles' => ['DATA_CENTER_CATEGORY' => '类目类型', 'DATA_CENTER_FILE' => '文件类型'],
'example' => 'DATA_CENTER_FILE',
],
],
@@ -2840,12 +1599,7 @@
'schema' => [
'description' => '创建知识库时可同步导入文件。此处可指定需要导入的文件列表(传入文件 ID,建议导入不超过10000个。如有剩余文件,后续可调用 **SubmitIndexAddDocumentsJob** 接口继续导入)。',
'type' => 'array',
- 'items' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`,或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>-文件页签,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
+ 'items' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`,或者在<props="china">[数据连接](https://bailian.console.aliyun.com/cn-beijing?tab=app#/connector/list)的文件连接器</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>-文件页签,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
'required' => false,
],
],
@@ -2857,13 +1611,8 @@
'schema' => [
'description' => '创建知识库时可同步导入文件。此处通过指定类目 ID,可导入对应类目下的所有文件(建议导入不超过10000个。如有剩余文件,后续可调用 **SubmitIndexAddDocumentsJob** 接口继续导入)。',
'type' => 'array',
- 'items' => [
- 'description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`。或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center'."\n"
- .')</props>-文件页签,单击类目旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'ca_hiu2383nfxxxx',
- ],
+ 'items' => ['description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`。或者在<props="china">[数据连接](https://bailian.console.aliyun.com/cn-beijing?tab=app#/connector/list)的文件连接器</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center'."\n"
+ .')</props>-文件页签,单击类目旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'ca_hiu2383nfxxxx'],
'required' => false,
],
],
@@ -2875,7 +1624,7 @@
'schema' => [
'description' => '<props="china">'."\n"
."\n"
- .'在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-表格页签,单击表格名称旁的 ID 图标获取。若列表包含多个ID时,只取第一个。'."\n"
+ .'在[数据连接](https://bailian.console.aliyun.com/cn-beijing?tab=app#/connector/list)-表格连接器的表格页签,单击表格名称旁的 ID 图标获取。若列表包含多个ID时,只取第一个。'."\n"
."\n"
.'</props>'."\n"
."\n\n"
@@ -2885,86 +1634,7 @@
.'>'."\n"
.'</props>',
'type' => 'array',
- 'items' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'required' => false,
- ],
- ],
- [
- 'name' => 'DataSource',
- 'in' => 'query',
- 'style' => 'json',
- 'schema' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'object',
- 'properties' => [
- 'CredentialId' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'CredentialKey' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'Database' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'xxx',
- ],
- 'Endpoint' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'IsPrivateLink' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'boolean',
- 'required' => false,
- ],
- 'Region' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'SubPath' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'SubType' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'Table' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- 'Type' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- ],
- ],
+ 'items' => ['type' => 'string', 'required' => false, 'description' => ''],
'required' => false,
],
],
@@ -2978,10 +1648,7 @@
.'> 若您尚未在阿里云百炼上使用过ADB存储,可前往<props="china">[创建知识库](https://bailian.console.aliyun.com/#/knowledge-base/create)</props><props="intl">[创建知识库](https://bailian.console.alibabacloud.com/#/knowledge-base/create)</props>页面选择向量存储类型为ADB-PG,并按界面提示完成授权。如果您传入了ADB,则必须指定`SinkInstanceId`和`SinkRegion`参数。',
'type' => 'string',
'required' => true,
- 'enumValueTitles' => [
- 'BUILT_IN' => 'BUILT_IN',
- 'ADB' => 'ADB',
- ],
+ 'enumValueTitles' => ['BUILT_IN' => 'BUILT_IN', 'ADB' => 'ADB'],
'example' => 'BUILT_IN',
],
],
@@ -2989,23 +1656,13 @@
'name' => 'SinkInstanceId',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => 'AnalyticDB for PostgreSQL 实例 ID(仅在`SinkType`指定 ADB 时才需要传入)。请前往[AnalyticDB for PostgreSQL数据实例列表](https://gpdbnext.console.aliyun.com/gpdb/list)页面获取此ID。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'gp-bp32109xxxx',
- ],
+ 'schema' => ['description' => 'AnalyticDB for PostgreSQL 实例 ID(仅在`SinkType`指定 ADB 时才需要传入)。请前往[AnalyticDB for PostgreSQL数据实例列表](https://gpdbnext.console.aliyun.com/gpdb/list)页面获取此ID。', 'type' => 'string', 'required' => false, 'example' => 'gp-bp32109xxxx'],
],
[
'name' => 'SinkRegion',
'in' => 'query',
'allowEmptyValue' => true,
- 'schema' => [
- 'description' => 'AnalyticDB for PostgreSQL 实例所在地域(仅在`SinkType`指定 ADB 时才需要传入)。您可调用<props="china">[ DescribeRegions ](https://help.aliyun.com/zh/analyticdb-for-postgresql/developer-reference/api-gpdb-2016-05-03-describeregions)</props><props="intl">[ DescribeRegions ](https://www.alibabacloud.com/help/zh/analyticdb/analyticdb-for-postgresql/developer-reference/api-gpdb-2016-05-03-describeregions?spm=a2c63.p38356.0.i3)</props>获取地域列表。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'cn-hangzhou',
- ],
+ 'schema' => ['description' => 'AnalyticDB for PostgreSQL 实例所在地域(仅在`SinkType`指定 ADB 时才需要传入)。您可调用<props="china">[ DescribeRegions ](https://help.aliyun.com/zh/analyticdb-for-postgresql/developer-reference/api-gpdb-2016-05-03-describeregions)</props><props="intl">[ DescribeRegions ](https://www.alibabacloud.com/help/zh/analyticdb/analyticdb-for-postgresql/developer-reference/api-gpdb-2016-05-03-describeregions?spm=a2c63.p38356.0.i3)</props>获取地域列表。', 'type' => 'string', 'required' => false, 'example' => 'cn-hangzhou'],
],
[
'name' => 'Columns',
@@ -3028,67 +1685,47 @@
.'>',
'type' => 'object',
'properties' => [
- 'Column' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'school',
- ],
- 'IsRecall' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'是否参与模型回复。开启后表示本列的检索结果将作为大模型生成回答时的输入信息。取值范围:'."\n"
- ."\n"
- .'- true:开启。'."\n"
- .'- false:不开启。'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- .'>'."\n"
- ."\n"
- .'</props>',
- 'type' => 'boolean',
- 'required' => false,
- 'example' => 'true',
- ],
- 'IsSearch' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'是否参与知识库检索。开启后表示允许知识库在此列数据中进行搜索。取值范围:'."\n"
- ."\n"
- .'- true:开启。'."\n"
- .'- false:不开启。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- .'>'."\n"
- .'</props>',
- 'type' => 'boolean',
- 'required' => false,
- 'example' => 'true'."\n",
- ],
- 'Name' => [
- 'description' => '<props="china">'."\n"
- .'字段名称。必须与应用数据中创建的数据表的表头一致。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- .'>'."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => '学校',
- ],
+ 'Column' => ['description' => '> 该参数暂不开放,请勿传入。'."\n"
+ .'>', 'type' => 'string', 'required' => false, 'example' => 'school'],
+ 'IsRecall' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'是否参与模型回复。开启后表示本列的检索结果将作为大模型生成回答时的输入信息。取值范围:'."\n"
+ ."\n"
+ .'- true:开启。'."\n"
+ .'- false:不开启。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ .'>'."\n"
+ ."\n"
+ .'</props>', 'type' => 'boolean', 'required' => false, 'example' => 'true'],
+ 'IsSearch' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'是否参与知识库检索。开启后表示允许知识库在此列数据中进行搜索。取值范围:'."\n"
+ ."\n"
+ .'- true:开启。'."\n"
+ .'- false:不开启。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ .'>'."\n"
+ .'</props>', 'type' => 'boolean', 'required' => false, 'example' => 'true'."\n"],
+ 'Name' => ['description' => '<props="china">'."\n"
+ .'字段名称。必须与应用数据中创建的数据表的表头一致。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ .'>'."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => '学校'],
'Type' => [
'description' => '<props="china">'."\n"
."\n"
@@ -3122,13 +1759,8 @@
[
'name' => 'Description',
'in' => 'query',
- 'schema' => [
- 'description' => '知识库描述。长度为 0~1000 个英文或中文字符。'."\n"
- .'默认值为空。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '企业帮助文档库包括了公司制度、产品清单等重要资料。',
- ],
+ 'schema' => ['description' => '知识库描述。长度为 0~1000 个英文或中文字符。'."\n"
+ .'默认值为空。', 'type' => 'string', 'required' => false, 'example' => '企业帮助文档库包括了公司制度、产品清单等重要资料。'],
],
[
'name' => 'metaExtractColumns',
@@ -3140,18 +1772,8 @@
'items' => [
'type' => 'object',
'properties' => [
- 'Key' => [
- 'description' => '元数据字段,长度为 1~50 个字符,必须为英文或下划线。如果指定本参数,则必须指定`Value`和`Type`参数。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'author',
- ],
- 'Value' => [
- 'description' => '元数据字段的值。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'Tim',
- ],
+ 'Key' => ['description' => '元数据字段,长度为 1~50 个字符,必须为英文或下划线。如果指定本参数,则必须指定`Value`和`Type`参数。', 'type' => 'string', 'required' => false, 'example' => 'author'],
+ 'Value' => ['description' => '元数据字段的值。', 'type' => 'string', 'required' => false, 'example' => 'Tim'],
'Type' => [
'description' => '元数据字段的取值方法。取值范围:'."\n"
."\n"
@@ -3162,21 +1784,10 @@
.'- keywords:关键词搜索。',
'type' => 'string',
'required' => false,
- 'enumValueTitles' => [
- 'constant' => '常量抽取',
- 'keywords' => '关键词抽取',
- 'custom_prompt' => '大模型',
- 'variable' => '变量抽取',
- 'regular' => '正则',
- ],
+ 'enumValueTitles' => ['constant' => '常量抽取', 'keywords' => '关键词抽取', 'custom_prompt' => '大模型', 'variable' => '变量抽取', 'regular' => '正则'],
'example' => 'constant',
],
- 'Desc' => [
- 'description' => '元数据字段的中文描述。长度为 0~1000 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。默认值为空。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '作者名',
- ],
+ 'Desc' => ['description' => '元数据字段的中文描述。长度为 0~1000 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。默认值为空。', 'type' => 'string', 'required' => false, 'example' => '作者名'],
'EnableLlm' => [
'description' => '开启后表示该元数据字段和值将和文本切片的内容一同参与大模型的回答生成过程。取值范围:'."\n"
."\n"
@@ -3186,10 +1797,7 @@
.'默认值为 false。',
'type' => 'boolean',
'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
'example' => 'false',
],
'EnableSearch' => [
@@ -3201,14 +1809,12 @@
.'默认值为 false。',
'type' => 'boolean',
'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
'example' => 'false',
],
],
'required' => false,
+ 'description' => '',
],
'required' => false,
],
@@ -3229,10 +1835,7 @@
.'若未指定,默认不开启。',
'type' => 'boolean',
'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
'example' => 'false',
],
],
@@ -3263,13 +1866,7 @@
.'</props>',
'type' => 'string',
'required' => false,
- 'enumValueTitles' => [
- 'regex' => '按照正则切分',
- 'length' => '按长度切分',
- 'h1' => '按照一级标题切分',
- 'h2' => '按照二级标题切分',
- 'page' => '按页切分',
- ],
+ 'enumValueTitles' => ['regex' => '按照正则切分', 'length' => '按长度切分', 'h1' => '按照一级标题切分', 'h2' => '按照二级标题切分', 'page' => '按页切分'],
'example' => 'regex',
],
],
@@ -3285,23 +1882,15 @@
.'若未指定,默认为开启。',
'type' => 'boolean',
'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
'example' => 'true',
],
],
[
'name' => 'CreateIndexType',
'in' => 'query',
- 'schema' => [
- 'description' => '> 该参数暂不开放,请勿传入。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => false,
- 'example' => '1',
- ],
+ 'schema' => ['description' => '> 该参数暂不开放,请勿传入。'."\n"
+ .'>', 'type' => 'string', 'required' => false, 'example' => 'standard'],
],
[
'name' => 'pipelineCommercialType',
@@ -3325,33 +1914,21 @@
'required' => false,
'example' => 'standard',
'default' => 'standard',
- 'enum' => [
- 'enterprise',
- 'standard',
- ],
+ 'enum' => ['enterprise', 'standard'],
],
],
[
'name' => 'pipelineCommercialCu',
'in' => 'query',
'allowEmptyValue' => false,
- 'schema' => [
- 'description' => '<props="china">指定知识库的 RCU 数量(仅当 pipelineCommercialType 指定 enterprise 时才需要传入)。取值范围:[1-200]。'."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- .'>'."\n"
- .'</props>',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '200',
- 'minimum' => '1',
- 'example' => '1',
- 'default' => '1',
- ],
+ 'schema' => ['description' => '<props="china">指定知识库的 RCU 数量(仅当 pipelineCommercialType 指定 enterprise 时才需要传入)。取值范围:[1-200]。'."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ .'>'."\n"
+ .'</props>', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '200', 'minimum' => '1', 'example' => '1', 'default' => '1'],
],
[
'name' => 'pipelineRetrieveRateLimitStrategy',
@@ -3373,72 +1950,121 @@
'required' => false,
'example' => 'downgrade',
'default' => 'downgrade',
- 'enum' => [
- 'downgrade',
- ],
+ 'enum' => ['downgrade'],
],
],
[
'name' => 'datasourceCode',
'in' => 'query',
- 'schema' => [
- 'description' => '数据源Code。创建数据查询类知识库时必填,与table、database配合使用。'."\n"
- ."\n"
- .'可在[应用数据](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/data-center/data-source)页面的数据源卡片上获取。'."\n"
- .'> '."\n"
- .'> - 本接口不支持关联自定义数据库,请使用阿里云百炼控制台创建。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '260xxx',
- ],
+ 'schema' => ['description' => '数据源Code。创建数据查询类知识库时必填,与table、database配合使用。'."\n"
+ ."\n"
+ .'<props="china">建议使用新参数 connectId,可在[数据连接](https://bailian.console.aliyun.com/cn-beijing?tab=app#/connector/list)页面的数据连接器卡片上获取。 当前参数仍可兼容使用,但未来将不再维护。</props>'."\n"
+ ."\n"
+ .'> '."\n"
+ .'> - 本接口不支持关联自定义数据库,请使用阿里云百炼控制台创建。', 'type' => 'string', 'required' => false, 'example' => '260xxx'],
],
[
'name' => 'table',
'in' => 'query',
- 'schema' => [
- 'description' => '数据表名称。创建数据查询类知识库时必填。'."\n"
- ."\n"
- .'该数据表必须存在于由 datasourceCode 指定的数据源内。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'lance',
- ],
+ 'schema' => ['description' => '数据表名称。创建数据查询类知识库时必填。'."\n"
+ ."\n"
+ .'该数据表必须存在于由 connectId 或 datasourceCode 指定的数据源内。', 'type' => 'string', 'required' => false, 'example' => 'lance'],
],
[
'name' => 'database',
'in' => 'query',
- 'schema' => [
- 'description' => '数据库名称。创建数据查询知识库时必填。'."\n"
- ."\n"
- .'该数据表必须存在于由 datasourceCode 指定的数据源内。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'database_a6eacabe6',
- ],
+ 'schema' => ['description' => '数据库名称。创建数据查询知识库时必填。'."\n"
+ ."\n"
+ .'该数据库必须存在于由 datasourceCode 指定的数据源内。', 'type' => 'string', 'required' => false, 'example' => 'database_a6eacabe6'],
+ ],
+ [
+ 'name' => 'knowledgeType',
+ 'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'具体的知识类型,用于进一步指明知识库处理的数据种类。'."\n"
+ .'<notice>此参数与 knowledgeScene 必须一同提供或一同省略,不可单独设置。如果一同省略,系统将根据 structureType 采用默认配置。></notice>'."\n"
+ ."\n"
+ .'**设置约束**: 此参数的取值必须与您选择的 structureType 匹配,并决定了 knowledgeScene 的可用值。'."\n"
+ ."\n"
+ .'**取值范围**:'."\n"
+ .'- document: 文档搜索。需与 structureType: unstructured 配合使用。'."\n"
+ .'- table: 数据查询。需与 structureType: structured 配合使用。'."\n"
+ .'- image: 图片问答。需与 structureType: structured 配合使用。'."\n"
+ .'- multimedia: 音视频搜索。需与 structureType: unstructured 配合使用。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'<props="intl">该参数暂不开放,请勿传入。</props>', 'type' => 'string', 'required' => false, 'example' => 'document'],
],
[
'name' => 'knowledgeScene',
'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'知识库的具体使用场景。'."\n"
+ .'<notice>此参数与 knowledgeType 必须一同提供或一同省略,不可单独设置。如果一同省略,系统将根据 structureType 采用默认配置。></notice>'."\n"
+ ."\n"
+ .'**设置约束**: 此参数的取值完全依赖于您所设置的 knowledgeType。'."\n"
+ ."\n"
+ .'**取值与联动关系**:'."\n"
+ .'- 当 knowledgeType 为 document 时,knowledgeType可设置为'."\n"
+ .'basic_document_qa(基础文档问答)、visual_document_qa(图文并茂回复)或 lite_document_qa(极速问答)、visual_perception_qa(视觉理解)。'."\n"
+ ."\n"
+ .'- 当 knowledgeType 为 table 时,knowledgeType设置为basic_table_qa(基础表格问答)。'."\n"
+ ."\n"
+ .'- 当 knowledgeType 为 image 时,knowledgeType 设置为 image_qa(图片问答)。'."\n"
+ ."\n"
+ .'- 当knowledgeType 为 multimedia 时,knowledgeType 设置为 basic_multimedia_qa(音视频搜索问答)。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">该参数暂不开放,请勿传入。</props>', 'type' => 'string', 'required' => false, 'example' => 'basic_document_qa'],
+ ],
+ [
+ 'name' => 'connectId',
+ 'in' => 'query',
+ 'schema' => ['title' => '连接器标识符', 'description' => '<props="china">连接器标识符,可在[数据连接](https://bailian.console.aliyun.com/cn-beijing?tab=app#/connector/list)页面的数据连接器卡片上获取。该参数替换了datasourceCode参数,后续需统一使用 connectId。'."\n"
+ .'创建数据查询类知识库时还需填写table参数。</props>'."\n"
+ ."\n"
+ .'<props="intl">该参数暂不开放,请勿传入。</props>', 'type' => 'string', 'required' => false, 'example' => 'conn_mysql_xxx_xxx'],
+ ],
+ [
+ 'name' => 'channelType',
+ 'in' => 'query',
+ 'schema' => ['title' => '渠道类型', 'description' => '<props="china">该参数暂不开放,请勿传入。</props>', 'type' => 'string', 'required' => false, 'example' => 'connector'],
+ ],
+ [
+ 'name' => 'RerankMode',
+ 'in' => 'query',
+ 'allowEmptyValue' => true,
'schema' => [
- 'description' => '创建文档搜索类知识库(StructureType 为 unstructured)时需选择的使用场景。'."\n"
+ 'description' => '<props="china">'."\n"
+ .'指定重排序模型的指令干预模式,以决定其评分偏好。'."\n"
."\n"
- .'- 默认基础文档问答场景:不传递当前参数'."\n"
+ .'**可选值:**'."\n"
."\n"
- .'- 图文并茂回复场景:参数值设置为visual_document_qa'."\n"
+ .'- **qa**:(默认值) 问答模式。模型倾向于为能直接回答查询(Query)的候选项赋予更高分。建议在问答场景使用。'."\n"
."\n"
- .'> '."\n"
- .'> - 传递当前参数时必须设置StructureType 为 unstructured。',
+ .'- **similar**: 相似模式。模型倾向于为与查询内容一致性高的候选项赋予更高分。建议在匹配检索场景使用。'."\n"
+ ."\n"
+ .'- **custom**: 自定义模式。模型的排序行为由 rerank_instruct 参数中的指令决定。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">该参数暂不开放,请勿传入。</props>',
'type' => 'string',
'required' => false,
+ 'enumValueTitles' => ['similar: 相似模式。' => 'similar: 相似模式。', 'custom: 自定义模式。' => 'custom: 自定义模式。', 'qa:(默认值) 问答模式。' => 'qa:(默认值) 问答模式。'],
+ 'example' => 'qa',
],
],
[
- 'name' => 'connectId',
+ 'name' => 'RerankInstruct',
'in' => 'query',
- 'schema' => [
- 'type' => 'string',
- 'required' => false,
- ],
+ 'allowEmptyValue' => true,
+ 'schema' => ['description' => '<props="intl">该参数暂不开放,请勿传入。</props>'."\n"
+ ."\n"
+ .'<props="china">提供一个自然语言指令,用于精细化控制重排序模型的行为。'."\n"
+ .'<notice>此参数仅在 rerank_mode 设置为 "custom" 时生效。></notice></props>', 'type' => 'string', 'required' => false],
],
],
'responses' => [
@@ -3448,52 +2074,27 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码',
- 'type' => 'string',
- ],
+ 'Code' => ['description' => '错误状态码', 'type' => 'string'],
'Data' => [
'description' => '请求成功时返回的业务数据',
'type' => 'object',
'properties' => [
- 'Id' => [
- 'description' => '知识库 ID,又称`IndexId`,创建的知识库唯一标识'."\n"
- .'> 请妥善保管该值,它将用于后续所有与此知识库相关的API操作.'."\n"
- .'>',
- 'type' => 'string',
- 'example' => 'jkurxhxxxx',
- ],
+ 'Id' => ['description' => '知识库 ID,又称`IndexId`,创建的知识库唯一标识'."\n"
+ .'> 请妥善保管该值,它将用于后续所有与此知识库相关的API操作。'."\n"
+ .'>', 'type' => 'string', 'example' => 'jkurxhxxxx'],
],
],
- 'Message' => [
- 'description' => '错误信息',
- 'type' => 'string',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A--2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码',
- 'type' => 'string',
- 'example' => '"200"',
- ],
- 'Success' => [
- 'description' => '请求是否成功,可能值为:'."\n"
- .'- true:成功'."\n"
- .'- false:失败',
- 'type' => 'boolean',
- 'example' => 'true'."\n",
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A--2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '"200"'],
+ 'Success' => ['description' => '请求是否成功,可能值为:'."\n"
+ .'- true:成功'."\n"
+ .'- false:失败', 'type' => 'boolean', 'example' => 'true'."\n"],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"\\",\\n \\"Data\\": {\\n \\"Id\\": \\"jkurxhxxxx\\"\\n },\\n \\"Message\\": \\"\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A--2446A84821CA\\",\\n \\"Status\\": \\"\\\\\\"200\\\\\\"\\",\\n \\"Success\\": true\\n}","type":"json"}]',
'title' => '创建知识库',
'description' => '- **权限要求**:'."\n"
@@ -3505,86 +2106,147 @@
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'GetIndexJobStatus' => [
- 'summary' => '查询指定的知识库创建任务或知识库追加任务的当前状态。',
- 'path' => '/{WorkspaceId}/index/job/status',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
+ 'changeSet' => [
+ ['createdAt' => '2025-12-03T12:10:50.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-07-30T09:21:00.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-06-04T01:43:41.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-04-21T03:29:44.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-01-03T03:32:34.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-11-07T09:52:44.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-09-17T11:04:42.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateIndex'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'CreateMemory' => [
+ 'summary' => '创建一个长期记忆体。',
+ 'path' => '/{workspaceId}/memories',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/x-www-form-urlencoded',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'WorkspaceId',
+ 'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID,请确保您要操作的知识库在此业务空间中。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
- 'name' => 'JobId',
+ 'name' => 'description',
'in' => 'query',
+ 'allowEmptyValue' => true,
+ 'schema' => ['title' => '长期记忆体的描述信息,默认为空', 'description' => '长期记忆体的描述信息。长度为 1~50 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。', 'type' => 'string', 'required' => false, 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '知识库作业任务 ID,即 **SubmitIndexJob** 接口或 **SubmitIndexAddDocumentsJob** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '20230718xxxx-146c93bf',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'memoryId' => ['title' => '长期记忆Id', 'description' => '长期记忆体 ID。'."\n"
+ .'> 请妥善保管该值,它将用于后续所有与此长期记忆体相关的API操作。'."\n"
+ .'>', 'type' => 'string', 'example' => '6bff4f317a14442fbc9f73d29dbxxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A--2446A84821CA'],
+ ],
],
],
+ ],
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'Memory.DescriptionInvalid', 'errorMessage' => 'Input parameter description is invalid.', 'description' => '长期记忆的描述信息无效'],
+ ],
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbxxxx\\",\\n \\"requestId\\": \\"17204B98-xxxx-4F9A--2446A84821CA\\"\\n}","type":"json"}]',
+ 'title' => '创建长期记忆体',
+ 'description' => '- 您可以将对话过程中的特定信息(即记忆片段,详见[长期记忆](https://help.aliyun.com/zh/model-studio/user-guide/long-term-memory))存储到长期记忆体(Memory)中,智能体应用将在后续对话中持续引用这些信息(非自动,您需要先调用[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口创建长期记忆体,获取`memoryId`。然后[通过API调用智能体应用](https://help.aliyun.com/zh/model-studio/user-guide/application-calling)时,传入该`memoryId`)。'."\n"
+ .' > 长期记忆体尚不支持存储与管理用户画像,请您通过控制台进行相关操作,详见[长期记忆](https://help.aliyun.com/zh/model-studio/user-guide/long-term-memory#578ebae524m6l)。'."\n"
+ .'- 若传入`memoryId`,系统会根据对话记录,在指定长期记忆体下自动创建记忆片段(MemoryNode)。您也可以调用[ CreateMemoryNode ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememorynode)接口手动创建记忆片段。'."\n"
+ .'- 本接口不具备幂等性。'."\n"
+ ."\n"
+ .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateMemory'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'IndexId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ ],
+ 'CreateMemoryNode' => [
+ 'summary' => '创建记忆片段。',
+ 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
- 'name' => 'PageNumber',
- 'in' => 'query',
- 'schema' => [
- 'description' => '**SubmitIndexJob** 接口和 **SubmitIndexAddDocumentsJob** 接口均支持批量导入文件。本接口返回的字段包括知识库作业任务的总状态`Status`及各文件导入的状态`Document.Status`。若文件较多,可通过`PageNumber`参数进行分页查询。起始值为 1,默认值为 1。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
- ],
+ 'name' => 'workspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => false, 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
[
- 'name' => 'pageSize',
+ 'name' => 'memoryId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体 ID。即 **CreateMemory** 接口返回的`memoryId`。', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n"],
+ ],
+ [
+ 'name' => 'content',
'in' => 'query',
- 'schema' => [
- 'description' => '指定分页查询时每页展示的文件导入任务数量。最大值不限。默认值为 10。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '10',
- ],
+ 'schema' => ['title' => '长期记忆内容', 'description' => '记忆片段内容。长度为 1~200 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。', 'type' => 'string', 'required' => true, 'example' => '用户喜欢吃西红柿炒鸡蛋'],
],
],
'responses' => [
@@ -3594,167 +2256,162 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.Forbidden',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'Documents' => [
- 'description' => '本次导入的文件列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件对象。',
- 'type' => 'object',
- 'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.Document.ChunkError',
- ],
- 'DocId' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx',
- ],
- 'DocName' => [
- 'description' => '文件名称。',
- 'type' => 'string',
- 'example' => 'XXX产品介绍',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'document parse error',
- ],
- 'Status' => [
- 'description' => '文件导入状态。可能值:'."\n"
- .'- INSERT_ERROR:文件导入失败。'."\n"
- .'- RUNNING:文件导入中。'."\n"
- .'- DELETED:文件已删除。'."\n"
- .'- FINISH:文件导入成功。',
- 'type' => 'string',
- 'enumValueTitles' => [],
- 'example' => 'RUNNING',
- ],
- 'GmtModified' => [
- 'type' => 'integer',
- 'format' => 'int64',
- ],
- ],
- ],
- ],
- 'JobId' => [
- 'description' => '作业任务ID。',
- 'type' => 'string',
- 'example' => '66122af12a4e45ddae6bd6c84555xxxx',
- ],
- 'Status' => [
- 'description' => '知识库作业任务的当前状态。可能值:'."\n"
- .'- COMPLETED:执行成功。'."\n"
- .'- FAILED:执行失败。'."\n"
- .'- RUNNING:执行中。'."\n"
- .'- PENDING:等待执行。',
- 'type' => 'string',
- 'enumValueTitles' => [
- 'COMPLETED' => '执行成功',
- 'FAILED' => '执行失败',
- 'RUNNING' => '执行中',
- 'PENDING' => '等待执行',
- ],
- 'example' => 'PENDING',
- ],
- ],
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource.',
- ],
- 'RequestId' => [
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'title' => 'Id of the request',
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'memoryNodeId' => ['title' => '长期记忆节点Id', 'description' => '记忆片段 ID。', 'type' => 'string', 'example' => '68de06c95368463a8be4a84efcxxxxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'Memory.MemoryNodeContentInvalid', 'errorMessage' => 'Memory node content is invalid.', 'description' => '长期记忆节点的内容无效'],
+ ],
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ['errorCode' => 'Memory.MemoryNodeNotFound', 'errorMessage' => 'MemoryNode not found.', 'description' => '长期记忆节点未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.Forbidden\\",\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"Code\\": \\"Index.Document.ChunkError\\",\\n \\"DocId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"DocName\\": \\"XXX产品介绍\\",\\n \\"Message\\": \\"document parse error\\",\\n \\"Status\\": \\"RUNNING\\",\\n \\"GmtModified\\": 0\\n }\\n ],\\n \\"JobId\\": \\"66122af12a4e45ddae6bd6c84555xxxx\\",\\n \\"Status\\": \\"PENDING\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '查询知识库创建任务状态',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetIndexJobStatus权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 您需要有一个正在执行中的知识库作业任务(创建知识库任务可以调用 **SubmitIndexJob** 接口,创建知识库追加任务可以调用 **SubmitIndexAddDocumentsJob** 接口),并且获得相应的`JobId`。'."\n"
- .'- 本接口调用间隔建议在 5 秒以上。'."\n"
- .'- 本接口具有幂等性。',
- ],
- 'SubmitIndexJob' => [
- 'summary' => '提交指定的 CreateIndex 任务以完成知识库创建。',
- 'path' => '/{WorkspaceId}/index/submit_index_job',
- 'methods' => [
- 'post',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efcxxxxxx\\",\\n \\"requestId\\": \\"8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5\\"\\n}","type":"json"}]',
+ 'title' => '创建记忆片段',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateMemoryNode'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'CreatePromptTemplate' => [
+ 'summary' => '创建Prompt模板。',
+ 'path' => '/{workspaceId}/promptTemplates',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'WorkspaceId',
+ 'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx'."\n",
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-czal8nvvwb8d4xxx'."\n"],
],
[
- 'name' => 'IndexId',
+ 'name' => 'name',
'in' => 'query',
+ 'schema' => ['title' => '模板名称', 'description' => '模板名称', 'type' => 'string', 'required' => true, 'example' => '小红书文案助手'],
+ ],
+ [
+ 'name' => 'content',
+ 'in' => 'query',
+ 'schema' => ['title' => 'prompt模板内容', 'description' => 'prompt模板内容', 'type' => 'string', 'required' => true, 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'promptTemplateId' => ['title' => 'prompt模板Id', 'description' => 'prompt模板Id', 'type' => 'string', 'example' => '6e49109bfeb94a39bb268f4e483ccxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx'."\n"],
+ ],
+ ],
+ ],
+ ],
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'PromptTemplate.ContentInvalid', 'errorMessage' => 'Input parameter Content is invalid.', 'description' => '入参Content的格式无效。'],
+ ['errorCode' => 'PromptTemplate.NameInvalid', 'errorMessage' => 'Input parameter Name is invalid.', 'description' => '输入参数Name的格式无效。'],
+ ],
+ 500 => [
+ ['errorCode' => 'PromptTemplate.InternalError', 'errorMessage' => 'Prompt template service inner exception.', 'description' => 'prompt模板服务内部异常'],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"promptTemplateId\\": \\"6e49109bfeb94a39bb268f4e483ccxxx\\",\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '创建Prompt模板',
+ 'description' => '本接口暂不支持文生图Prompt模板的创建。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreatePromptTemplate'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreatePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
+ ],
+ 'DeleteCategory' => [
+ 'summary' => '永久性删除指定的类目。',
+ 'path' => '/{WorkspaceId}/datacenter/category/{CategoryId}/',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'CategoryId',
+ 'in' => 'path',
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
+ ],
+ ],
'responses' => [
200 => [
'schema' => [
@@ -3762,300 +2419,322 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
'Data' => [
- 'description' => '接口返回的业务字段。',
+ 'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
- 'Id' => [
- 'description' => '任务 ID,即调用 **GetIndexJobStatus** 接口时需要用到的任务`JobId`。',
- 'type' => 'string',
- 'example' => 'eFDr2fGRzP9gdDZWAdo3xxxx',
- ],
- 'IndexId' => [
- 'description' => '知识库 ID。',
- 'type' => 'string',
- 'example' => '79c0alxxxx',
- ],
+ 'CategoryId' => ['description' => '被删除的类目 ID。', 'type' => 'string', 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'workspace id is null or invalid.'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'RagIndex.IdempotentParameterMismatch',
- 'errorMessage' => 'The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.',
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"Id\\": \\"eFDr2fGRzP9gdDZWAdo3xxxx\\",\\n \\"IndexId\\": \\"79c0alxxxx\\"\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '提交知识库创建任务',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:SubmitIndexJob权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,您必须预先调用 **CreateIndex** 接口,并且获取到对应的`IndexId`。'."\n"
- .'- 调用本接口后,任务需一定时间执行,高峰期可能耗时数小时。任务完成前请勿重复发起请求。如果需要查询任务的执行状态,可调用 **GetIndexJobStatus** 接口查询。'."\n"
- .'- 知识库创建完成后,接下来您便可以在<props="china">[应用管理](https://bailian.console.aliyun.com/?tab=app#/app-center)</props><props="intl">[应用管理](https://modelstudio.console.alibabacloud.com/?tab=app#/app-center)</props>中将创建好的知识库与您位于相同的业务空间里的智能体应用<props="china">或者工作流应用</props>'."\n"
- .'关联(或者通过[应用调用](~~2846132~~)的`rag_options`传入`IndexID`),以便为您的阿里云百炼应用补充私有知识和提供最新信息。当然,您也可以选择不使用阿里云百炼应用,直接通过调用 **Retrieve** 接口来查询知识库。'."\n"
- .'- 本接口不具备幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"Code\\": \\"success\\"\\n}","type":"json"}]',
+ 'title' => '删除类目',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'SubmitIndexAddDocumentsJob' => [
- 'summary' => '向指定知识库中追加导入已解析的文件。',
- 'path' => '/{WorkspaceId}/index/add_documents_to_index',
- 'methods' => [
- 'post',
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteCategory'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'DeleteChunk' => [
+ 'summary' => '删除知识库中的指定文本切片,被删的文本切片将无法被检索和召回。',
+ 'path' => '/{WorkspaceId}/chunk/delete',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'abilityTreeNodes' => [
- 'FEATUREsfm4VA8MJ',
- ],
- ],
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
+ 'name' => 'PipelineId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
+ ],
+ [
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx'."\n",
- ],
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
- 'name' => 'IndexId',
+ 'name' => 'ChunkIds',
'in' => 'query',
+ 'style' => 'json',
'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
+ 'description' => '需要删除的文本切片列表(单次最多传入10个文本切片ID)。',
+ 'type' => 'array',
+ 'items' => ['description' => '文本切片ID,即 **ListChunks** 接口返回的Node对象里`Metadata`中的`_id`字段。', 'type' => 'string', 'required' => true, 'example' => 'llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0'],
'required' => true,
- 'example' => '79c0alxxxx',
],
],
- [
- 'name' => 'SourceType',
- 'in' => 'query',
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '数据来源类型。取值范围:'."\n"
- .'- DATA_CENTER_CATEGORY:类目类型,即导入<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中指定类目下的所有文档,支持导入多个类目。'."\n"
- .'- DATA_CENTER_FILE:文档类型,即导入<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>下的指定文件,支持导入多个文件。'."\n"
- ."\n"
- .'> 如果本参数传入DATA_CENTER_CATEGORY,则必须指定`CategoryIds`参数;如果本参数传入DATA_CENTER_FILE,则必须指定`DocumentIds`参数。'."\n"
- .'>',
- 'type' => 'string',
- 'required' => true,
- 'enumValueTitles' => [
- 'DATA_CENTER_CATEGORY' => '类目类型',
- 'DATA_CENTER_FILE' => '文档类型',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'."\n"],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'."\n"],
+ 'Data' => ['description' => '请求成功返回的业务数据。', 'type' => 'boolean', 'example' => 'true'."\n"],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'."\n"],
],
- 'example' => 'DATA_CENTER_FILE',
],
],
- [
- 'name' => 'DocumentIds',
- 'in' => 'query',
- 'style' => 'json',
- 'schema' => [
- 'description' => '文件 ID 列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'doc_ea4a504d9ce545508d8aa6d90371bf54xxxxxxxx',
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\\\n\\",\\n \\"Code\\": \\"\\",\\n \\"Message\\": \\"\\",\\n \\"Success\\": true,\\n \\"Data\\": true,\\n \\"Status\\": \\"200\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '删除切片',
+ 'description' => '<warning> 文本切片被删除后无法恢复(硬删除),请谨慎操作。'."\n"
+ .'- **权限要求**:'."\n"
+ .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:DeleteChunk权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
+ .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
+ .'- **调用方式**:推荐使用最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>调用,SDK已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
+ .'- **生效延迟**:更新后通常立即生效,高峰期可能稍有延迟(秒级)。'."\n"
+ .'- **幂等性**:本接口具有幂等性。对已成功删除的文本切片进行重复操作时,接口将返回成功响应。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteChunk',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- 'required' => false,
],
],
+ ],
+ ],
+ 'DeleteConnector' => [
+ 'summary' => '删除连接器',
+ 'path' => '/{WorkspaceId}/datacenter/connector/{ConnectorId}',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'CategoryIds',
- 'in' => 'query',
- 'style' => 'json',
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'ConnectorId',
+ 'in' => 'path',
+ 'schema' => ['description' => '所属数据连接(Connector)的实例id,请到百炼控制台获取。', 'type' => 'string', 'required' => true, 'example' => 'connector-d51861492df64257', 'maxLength' => 256, 'minLength' => 1],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所在工作空间ID', 'type' => 'string', 'required' => true, 'example' => 'llm-mbhn96xxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '类目 ID 列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>-文件页签,单击类目旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx'."\n",
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Data' => [
+ 'description' => '接口业务数据字段',
+ 'type' => 'object',
+ 'properties' => [
+ 'ConnectorId' => ['description' => '连接器 ID', 'type' => 'string', 'example' => 'conn_file_e0c9db4030b2465a9478028f7d76cd92_1234'],
+ ],
+ ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '1C139002-0EC5-584C-A755-4B8B9FA080BE'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
- 'required' => false,
],
],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '删除连接器',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteConnector权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)来调用本接口。'."\n"
+ .'- 本接口不具备幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"ConnectorId\\": \\"conn_file_e0c9db4030b2465a9478028f7d76cd92_1234\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"RequestId\\": \\"1C139002-0EC5-584C-A755-4B8B9FA080BE\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'DeleteFile' => [
+ 'path' => '/{WorkspaceId}/datacenter/file/{FileId}/',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'ChunkMode',
- 'in' => 'query',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- .'启用自定义切分(仅对您本次追加的文件生效)。更多信息,请参见[知识库](~~2807740~~)。可能取值(不支持同时传入多个值):'."\n"
- ."\n"
- .'- **length**:按长度切分。严格按照您指定的`ChunkSize`和`OverlapSize`切分。 若您未传入这两个参数,系统将采用默认值(`ChunkSize`为500,`OverlapSize`为100)。按长度切分不支持`Separator`(即使传入也不生效)。'."\n"
- .'- **page**:按页切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值500)。按页切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
- .'- **h1**:按照一级标题切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按照一级标题切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
- .'- **h2**:按照二级标题切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按照二级标题切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
- .'- **regex**:按照正则切分,此时必须指定`Separator`参数。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按正则切分不支持`OverlapSize`(即使传入也不生效)。'."\n"
- ."\n"
- .'默认值为空,采用智能切分。'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'length',
- ],
+ 'AK' => [],
],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
- 'name' => 'Separator',
- 'in' => 'query',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- .'分句标识符,仅在`chunkMode`=**regex**时生效(否则即使传入也不生效)。可传入一个正则表达式(不支持多个),用于将文件分割为小段的文本切片。更多信息,请参见[知识库](~~2807740~~)。'."\n"
- ."\n"
- .'使用智能切分(未指定`chunkMode`)时,保持默认空值即可。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => '(?<=。)',
- ],
+ 'name' => 'FileId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx', 'maxLength' => 128, 'minLength' => 32],
],
[
- 'name' => 'ChunkSize',
- 'in' => 'query',
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oxxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '<props="china">'."\n"
- .'分段长度,即您希望每个文本切片的字符数上限(仅对您本次追加的文件生效)。超过该长度时:'."\n"
- ."\n"
- .'- **智能切分**(未指定`chunkMode`):文本很可能会被截断。'."\n"
- .'- **自定义切分**(指定了`chunkMode`):文本将被强制切割。'."\n"
- ."\n"
- .'取值范围[1-6000]。如果未传入本参数,将使用默认值 500。'."\n"
- ."\n"
- .'更多信息,请参见[知识库](~~2807740~~)。'."\n"
- ."\n"
- .'> 请注意,如果您指定了`ChunkSize`参数且小于100,则必须指定`OverlapSize`参数。您也可以不指定这2个参数(系统将采用默认值)。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '128',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'InvalidParameter'],
+ 'Data' => [
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'FileId' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
+ ],
+ ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Current file status does not support delete.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ ],
],
],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '删除文件',
+ 'summary' => '永久删除应用数据中的指定文件。不支持通过API删除数据表,详见下方接口说明。',
+ 'description' => '- 不支持通过API删除数据表。如需删除数据表或表中特定的数据,请前往<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>操作。'."\n"
+ .'- 本接口用于删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中的文件,不会影响已构建好的知识库。如需删除知识库中的文件,请调用 **DeleteIndexDocument** 接口。'."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口仅能删除状态为解析失败(PARSE_FAILED)或解析完成(PARSE_SUCCESS)的文件。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteFile'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'OverlapSize',
- 'in' => 'query',
- 'schema' => [
- 'description' => '<props="china">'."\n"
- .'分段重叠长度(仅对您本次追加的文件生效)。它表示当前文本切片与上一个文本切片的重叠字符数。更多信息,请参见[知识库](~~2807740~~)。取值范围[0-1024]。'."\n"
- ."\n"
- .'如果未传入本参数,将使用默认值 100。'."\n"
- .'>请注意,`OverlapSize`的值必须小于`ChunkSize`的值,否则会导致切分异常。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 该参数暂不开放,请勿传入。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '16',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"InvalidParameter\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\"\\n },\\n \\"Message\\": \\"Current file status does not support delete.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'DeleteFiles' => [
+ 'summary' => '批量删除文件',
+ 'path' => '/{WorkspaceId}/datacenter/file/delete',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'EnableHeaders',
- 'in' => 'query',
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-mbhn96xxxx'],
+ ],
+ [
+ 'name' => 'FileIds',
+ 'in' => 'formData',
+ 'style' => 'json',
'schema' => [
- 'description' => 'Excel文件表头是否支持拼装。开启后,知识库会将所有xlsx、xls格式文件的首行数据视为表头,并自动拼接到每个文本切片中(数据行),避免大模型误将表头视为普通数据行来处理。'."\n"
- ."\n\n"
- .'> 建议仅在导入文件均为xlsx、xls格式且含表头时开启,否则无需开启。'."\n"
- .'>'."\n"
- ."\n"
- .'取值范围:'."\n"
- .'- true:开启。'."\n"
- .'- false:不开启。'."\n"
- ."\n"
- .'默认值为 false,即不开启。',
- 'type' => 'boolean',
- 'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
- 'example' => 'false',
+ 'description' => '需要删除的文件id列表,单次删除最多支持20个文件',
+ 'type' => 'array',
+ 'items' => ['description' => '需要删除的文件id', 'type' => 'string', 'required' => false, 'example' => 'file_xxxx'],
+ 'required' => true,
+ 'maxItems' => 20,
+ 'minItems' => 1,
],
],
],
@@ -4066,683 +2745,804 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'DataCenter.FileTooLarge'],
'Data' => [
- 'description' => '接口返回的业务字段。',
+ 'description' => '返回内容',
'type' => 'object',
'properties' => [
- 'Id' => [
- 'description' => '任务 ID,又称`JobId`。',
- 'type' => 'string',
- 'example' => '42687eb254a34802bed398357f5498ae',
+ 'DeleteFileResultList' => [
+ 'description' => '删除结果',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '单个文件删除结果',
+ 'type' => 'object',
+ 'properties' => [
+ 'FileId' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_6b193b9b4b1546ef9eaa7340e69adfca_10052857'],
+ 'Status' => ['description' => '文件删除状态。状态可能值为:'."\n"
+ ."\n"
+ .'- DELETED:删除成功。'."\n"
+ .'- FAILED:删除失败。'."\n"
+ .'- NOT_FOUND:未查询到文件', 'type' => 'string', 'example' => 'DELETED'],
+ ],
+ ],
],
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '17204B98-7734-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'IdempotentParameterMismatch',
- 'errorMessage' => 'The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.',
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Data\\": {\\n \\"Id\\": \\"42687eb254a34802bed398357f5498ae\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Code\\": \\"Index.InvalidParameter\\"\\n}","type":"json"}]',
- 'title' => '提交知识库追加任务',
- 'description' => '<props="china">'."\n"
- ."\n"
- .'- 本接口不支持数据查询/图片问答类知识库。关于如何更新数据查询/图片问答类知识库,请参见[知识库](~~2807740~~)一文中关于更新知识库的说明。'."\n"
- ."\n\n"
- .'</props>'."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'- 本接口不支持数据查询/图片问答类知识库。关于如何更新数据查询/图片问答类知识库,请参见[知识库](~~2807740~~)一文中关于更新知识库的说明。'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:SubmitIndexAddDocumentsJob权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库ID`IndexId`有效)。'."\n"
- .'- 调用该接口前,请先调用 **AddFile** 接口将您需要追加导入的文件上传至阿里云百炼。'."\n"
- .'- 调用本接口后,任务需一定时间执行,高峰期可能耗时数小时。任务完成前请勿重复发起请求。如果需要查询任务的执行状态,可调用 **GetIndexJobStatus** 接口查询。此接口返回的文件列表`Documents`为您本次追加(由您提供的`job_id`唯一确定)全部文件,您可以查看每个文件是否导入(解析)成功。注意频繁调用 GetIndexJobStatus 接口会被限流,频率请勿高于20次/分钟。 '."\n"
- .'- 本接口调用成功后,将执行一段时间,请求返回前请勿重复发起请求。本接口不具备幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '批量删除文件',
+ 'description' => '- 不支持通过API删除数据表。如需删除数据表或表中特定的数据,请前往<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>操作。'."\n"
+ .'- 本接口用于删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中的文件,不会影响已构建好的知识库。如需删除知识库中的文件,请调用 **DeleteIndexDocument** 接口。'."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteFiles权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口仅能删除状态为解析失败(PARSE_FAILED)或解析完成(PARSE_SUCCESS)的文件。'."\n"
+ .'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'Retrieve' => [
- 'summary' => '在指定的知识库中检索信息。',
- 'path' => '/{WorkspaceId}/index/retrieve',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
],
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"DeleteFileResultList\\": [\\n {\\n \\"FileId\\": \\"file_6b193b9b4b1546ef9eaa7340e69adfca_10052857\\",\\n \\"Status\\": \\"DELETED\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'DeleteIndex' => [
+ 'summary' => '永久性删除指定的知识库。',
+ 'path' => '/{WorkspaceId}/index/delete',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'Query',
+ 'name' => 'IndexId',
'in' => 'query',
- 'schema' => [
- 'description' => '输入文本(原始输入prompt)。Query的长度和字符没有限制。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '阿里云百炼平台介绍',
- ],
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => 'f89ie0xxxx'],
],
[
- 'name' => 'DenseSimilarityTopK',
- 'in' => 'query',
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '向量检索 Top K,通过生成输入文本的向量并在知识库中检索与其向量表示最相似的 K 个文本切片。K的取值范围[0-100]。'."\n"
- .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
- ."\n"
- .'默认值为100。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '100',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功'."\n"
+ .'- false:失败', 'type' => 'boolean', 'example' => 'true'],
+ ],
],
],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '删除知识库',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteIndex权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ .'- 如果知识库正在被应用调用,需要先解除关联后才可删除。此操作当前只能通过控制台完成。具体操作请参见[知识库](~~2807740~~)。'."\n"
+ .'- 删除操作不可逆,被删知识库将无法恢复,请谨慎操作。'."\n"
+ .'- 调用本接口不会删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中已导入的文件。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteIndex'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'EnableReranking',
- 'in' => 'query',
- 'schema' => [
- 'description' => '是否开启重排序。更多信息,请参见[知识库](~~2807740~~)。取值范围:'."\n"
- .'- true:开启。'."\n"
- .'- false:不开启。'."\n"
- ."\n"
- .'默认值为 true。',
- 'type' => 'boolean',
- 'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- 'example' => 'true',
],
],
+ ],
+ ],
+ 'DeleteIndexDocument' => [
+ 'summary' => '永久删除指定知识库中的文件。',
+ 'path' => '/{WorkspaceId}/index/delete_index_document',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'EnableRewrite',
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
+ ],
+ [
+ 'name' => 'IndexId',
'in' => 'query',
- 'schema' => [
- 'description' => '是否开启<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>。'."\n"
- .'取值范围:'."\n"
- .'- true:开启。'."\n"
- .'- false:不开启。'."\n"
- ."\n"
- .'默认值为 false。',
- 'type' => 'boolean',
- 'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
- 'example' => 'false',
- ],
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
],
[
- 'name' => 'Rerank',
+ 'name' => 'DocumentIds',
'in' => 'query',
'style' => 'json',
'schema' => [
- 'description' => '重排序配置。',
+ 'description' => '文件 ID 列表。',
'type' => 'array',
- 'items' => [
- 'description' => '重排序配置对象。',
- 'type' => 'object',
- 'properties' => [
- 'ModelName' => [
- 'description' => '使用指定的排序模型。此处指定值将覆盖创建知识库时所选择的排序模型。取值范围:'."\n"
- ."\n"
- .'<props="china">'."\n"
- ."\n"
- .'- qwen3-rerank-hybrid:qwen3-rerank(hybrid)排序。'."\n"
- .'- qwen3-rerank:qwen3-rerank排序。'."\n"
- .'- gte-rerank-hybrid:gte-rerank(hybrid)排序。'."\n"
- .'- gte-rerank:gte-rerank排序。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'- gte-rerank-hybrid:官方排序。'."\n"
- .'- gte-rerank:gte-rerank排序。'."\n"
- ."\n\n"
- ."\n"
- .'</props>'."\n"
- ."\n\n"
- .'默认值为空,使用创建知识库时选择的排序模型。'."\n"
- ."\n\n"
- .'<props="china">'."\n"
- ."\n"
- .'> 如仅需语义排序,可使用`qwen3-rerank`;若同时需要语义排序和文本匹配特征以确保相关性,建议使用`qwen3-rerank-hybrid`。'."\n"
- .'>'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'> 如仅需语义排序,可使用`gte-rerank`;若同时需要语义排序和文本匹配特征以确保相关性,建议使用`gte-rerank-hybrid`。'."\n"
- .'>'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n\n"
- ."\n"
- .'<props="china">'."\n"
- ."\n"
- .'> `gte-rerank-hybrid`与`gte-rerank`后续停止更新,不建议使用。'."\n"
- .'>'."\n"
- ."\n\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'gte-rerank-hybrid' => 'gte-rerank(hybrid)排序',
- 'gte-rerank' => 'gte-rerank排序',
+ 'items' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件</props>页签,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx'],
+ 'required' => true,
+ ],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
+ 'schema' => [
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Data' => [
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'DeletedDocument' => [
+ 'description' => '已成功删除的文件 ID 列表。',
+ 'type' => 'array',
+ 'items' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx'],
],
- 'example' => 'gte-rerank-hybrid',
],
],
- 'required' => false,
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
],
- 'required' => false,
],
],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"DeletedDocument\\": [\\n \\"file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx\\"\\n ]\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
+ 'title' => '删除知识库下的文件',
+ 'description' => '- 本接口不支持删除数据查询/图片问答类知识库中的数据。请通过阿里云百炼控制台操作。'."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteIndexDocument权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ .'- 仅能删除知识库中状态为导入失败(INSERT_ERROR)或导入成功(FINISH)的文件。如需查询指定知识库下的文件状态,可调用 **ListIndexDocuments** 接口。'."\n"
+ .'- 删除操作不可逆,被删的文件内容将无法恢复,且 **Retrieve** 接口将无法再获取其相关信息,请谨慎操作。'."\n"
+ .'- 调用本接口不会删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中已导入的文档。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteIndexDocument'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'RerankMinScore',
- 'in' => 'query',
- 'schema' => [
- 'description' => '相似度阈值。该阈值表示允许召回的文本切片的最低相似度分数,用于筛选Rank模型返回的文本切片,即只有分数超过此数值的文本切片才会被召回。取值范围[0.01-1.00]。此参数的优先级大于知识库相似度阈值配置。'."\n"
- ."\n"
- .'当未指定具体值时,默认采用该知识库配置的相似度阈值。',
- 'type' => 'number',
- 'format' => 'float',
- 'required' => false,
- 'example' => '0.20',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteIndexDocument',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ ],
+ 'DeleteMemory' => [
+ 'summary' => '永久性删除指定的长期记忆体。',
+ 'path' => '/{workspaceId}/memories/{memoryId}',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'RerankTopN',
- 'in' => 'query',
- 'schema' => [
- 'description' => '重排序后的 Top N 返回数据。取值范围[1-20],默认值为5。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '5',
- ],
+ 'AK' => [],
],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
- 'name' => 'Rewrite',
- 'in' => 'query',
- 'style' => 'json',
+ 'name' => 'workspaceId',
+ 'in' => 'path',
+ 'schema' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
+ ],
+ [
+ 'name' => 'memoryId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体 ID,对应[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口返回的`memoryId`。', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx'."\n"],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '多轮对话改写配置。',
- 'type' => 'array',
- 'items' => [
- 'description' => '多轮对话改写配置对象。',
- 'type' => 'object',
- 'properties' => [
- 'ModelName' => [
- 'description' => '多轮对话改写模型名称。它会基于会话上下文自动调整原始输入prompt(用户问题)以提升检索效果。取值范围:'."\n"
- .'- conv-rewrite-qwen-1.8b:conv-rewrite-qwen-1.8b模型(目前只支持该模型)'."\n"
- ."\n"
- .'默认值为空,采用conv-rewrite-qwen-1.8b模型。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'conv-rewrite-qwen-1.8b' => 'conv-rewrite-qwen-1.8b模型',
- ],
- 'example' => 'conv-rewrite-qwen-1.8b',
- ],
- ],
- 'required' => false,
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n"],
],
- 'required' => false,
],
],
+ ],
+ 'errorCodes' => [
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '删除长期记忆体',
+ 'description' => '- 调用本接口前,请确保您的长期记忆体已经创建完成且未被删除(即`memoryId`有效)。'."\n"
+ .'- 删除操作不可逆,被删的长期记忆体包括它的所有长期记忆体节点将无法恢复,且[ GetMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-getmemory)接口将无法再获取其相关信息,请谨慎操作。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteMemory'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'SparseSimilarityTopK',
- 'in' => 'query',
- 'schema' => [
- 'description' => '关键词检索TopK,即在知识库中查找与输入文本的关键词精确匹配的切片。它可以帮助您过滤掉无关的文本切片,提供更准确的结果。'."\n"
- .'取值范围[0-100]。'."\n"
- .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
- ."\n"
- .'默认值为:100。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '100',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ ],
+ 'DeleteMemoryNode' => [
+ 'summary' => '删除记忆片段。',
+ 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes/{memoryNodeId}',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'WorkspaceId',
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx'."\n",
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
[
- 'name' => 'IndexId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。'."\n"
- ."\n"
- .'> - 请确保对应知识库已成功创建且未被删除。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '5pwe0mxxxx',
- ],
+ 'name' => 'memoryId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体Id', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n"],
],
[
- 'name' => 'SaveRetrieverHistory',
- 'in' => 'query',
+ 'name' => 'memoryNodeId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆节点Id', 'description' => '记忆片段Id', 'type' => 'string', 'required' => true, 'example' => '68de06c95368463a8be4a84efc872cc5'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '是否保存历史文本切片召回测试数据。取值范围:'."\n"
- .'- true:保存。'."\n"
- .'- false:不保存。'."\n"
- ."\n"
- .'默认值为:false。',
- 'type' => 'boolean',
- 'required' => false,
- 'example' => 'false',
- 'default' => 'false',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'],
+ ],
],
],
+ ],
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'Memory.MemoryNodeContentInvalid', 'errorMessage' => 'Memory node content is invalid.', 'description' => '长期记忆节点的内容无效'],
+ ],
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ['errorCode' => 'Memory.MemoryNodeNotFound', 'errorMessage' => 'MemoryNode not found.', 'description' => '长期记忆节点未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\"\\n}","type":"json"}]',
+ 'title' => '删除记忆片段',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteMemoryNode'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'SearchFilters',
- 'in' => 'query',
- 'style' => 'json',
- 'schema' => [
- 'description' => '支持通过SearchFilter设置个性化的检索条件(比如标签),对语义检索结果进行过滤,以排除与查询Query无关的信息。使用方法请参见[知识库SearchFilters](~~2869641~~)。',
- 'type' => 'array',
- 'items' => [
- 'description' => '检索条件对象。',
- 'type' => 'object',
- 'required' => false,
- 'additionalProperties' => [
- 'type' => 'string',
- ],
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- 'required' => false,
],
],
+ ],
+ ],
+ 'DeletePromptTemplate' => [
+ 'summary' => '基于模板Id删除Prompt模板。',
+ 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
+ 'methods' => ['delete'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
- 'name' => 'Images',
- 'in' => 'query',
- 'allowEmptyValue' => true,
- 'style' => 'simple',
+ 'name' => 'workspaceId',
+ 'in' => 'path',
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdxxx'],
+ ],
+ [
+ 'name' => 'promptTemplateId',
+ 'in' => 'path',
+ 'schema' => ['title' => '模板Id', 'description' => '模板Id', 'type' => 'string', 'required' => true, 'example' => '6e49109bfeb94a39bb268f4e483ccxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '支持在提问时传入图片URL地址。',
- 'type' => 'array',
- 'items' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'检索图片问答类知识库时您可传入图片URL地址。当该知识库中存在图片索引时,系统会将输入图片转为向量并检索到相关记录;如果不存在图片索引,则输入的图片不会用于检索。'."\n"
- .'> 本字段不支持文档搜索/数据查询/音视频搜索类知识库(即使传入也不生效)'."\n"
- ."\n"
- .'> 请确保链接公开可访问且指向一个有效的图片文件。格式示例:https://example.com/downloads/pic.jpg'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n\n"
- ."\n\n"
- .'<props="intl">'."\n"
- ."\n"
- .'检索图片问答知识库时您可传入图片URL地址。当该知识库中存在图片索引时,系统会将输入图片转为向量并检索到相关记录;如果不存在图片索引,则输入的图片不会用于检索。'."\n"
- .'> 本字段不支持文档搜索/数据查询知识库(即使传入也不生效)'."\n"
- ."\n"
- .'> 请确保链接公开可访问且指向一个有效的图片文件。格式示例:https://example.com/downloads/pic.jpg'."\n"
- ."\n\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'https://example.com/downloads/pic.jpg',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx'],
],
- 'required' => false,
],
],
+ ],
+ 'errorCodes' => [
+ 404 => [
+ ['errorCode' => 'PromptTemplate.TemplateNotFound', 'errorMessage' => 'Prompt template not found.', 'description' => '未找到Prompt模板'],
+ ],
+ 500 => [
+ ['errorCode' => 'PromptTemplate.InternalError', 'errorMessage' => 'Prompt template service inner exception.', 'description' => 'prompt模板服务内部异常'],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\"\\n}","type":"json"}]',
+ 'title' => '删除Prompt模板',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeletePromptTemplate'],
+ ],
+ ],
+ 'ramActions' => [
[
- 'name' => 'QueryHistory',
- 'in' => 'query',
- 'allowEmptyValue' => false,
- 'style' => 'json',
- 'schema' => [
- 'description' => '<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>支持您传入自己管理的对话历史。仅在EnableRewrite=**true** 时生效(否则即使传入也不生效)。',
- 'type' => 'array',
- 'items' => [
- 'type' => 'object',
- 'properties' => [
- 'role' => [
- 'description' => '角色。'."\n"
- ."\n"
- .'取值范围:'."\n"
- ."\n"
- .'- user:传入此角色,此时content表示您输入给阿里云百炼应用的文本。'."\n"
- .'- assistant:传入此角色,此时content表示阿里云百炼应用的回复。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'user'."\n",
- ],
- 'content' => [
- 'description' => '对应角色的问题或者回答内容。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '代表一段文本。',
- ],
- ],
- 'required' => false,
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeletePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- 'required' => false,
],
],
],
+ ],
+ 'DescribeFile' => [
+ 'summary' => '查询应用数据中文件的基本信息,包括文件名称、类型、状态等。',
+ 'path' => '/{WorkspaceId}/datacenter/file/{FileId}/',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
+ ],
+ [
+ 'name' => 'FileId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签</props>,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
+ ],
+ ],
'responses' => [
200 => [
'schema' => [
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Success'],
'Data' => [
'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
- 'Nodes' => [
- 'description' => '命中的文本切片列表。',
+ 'CategoryId' => ['description' => '文件所属类目 ID。', 'type' => 'string', 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
+ 'CreateTime' => ['description' => '文件实际添加到阿里云百炼中的时间戳,格式: yyyy-MM-dd HH:mm:ss,时区:UTC + 8。', 'type' => 'string', 'example' => '2024-09-09 12:45:43'],
+ 'FileId' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
+ 'FileName' => ['description' => '文件名称。', 'type' => 'string', 'example' => 'XXX产品介绍.pdf'],
+ 'FileType' => ['description' => '文件类型,扩展名。可能值为: pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。', 'type' => 'string', 'example' => 'pdf'],
+ 'Parser' => ['description' => '解析该文件使用的解析器类型。可能值为:'."\n"
+ .'- DASHSCOPE_DOCMIND:默认文档解析器。', 'type' => 'string', 'example' => 'DASHSCOPE_DOCMIND'],
+ 'SizeInBytes' => ['description' => '文件大小,单位字节Byte。', 'type' => 'integer', 'format' => 'int64', 'example' => '1234'],
+ 'Status' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'用于文档类知识库的文件(类型为UNSTRUCTURED),状态可能值为:'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'用于非结构化知识库的文件(类型为UNSTRUCTURED),状态可能值为:'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'- INIT: 待解析。'."\n"
+ .'- IN_PARSE_QUEUE:解析队列排队中。'."\n"
+ .'- PARSING: 解析中。'."\n"
+ .'- PARSE_SUCCESS:解析完成。'."\n"
+ .'<note>必须等到状态为PARSE_SUCCESS才能将文档导入知识库。</note>'."\n"
+ .'- PARSE_FAILED:解析失败。'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ .'用于智能体应用[会话交互](https://help.aliyun.com/zh/model-studio/user-guide/file-interaction)的文件(类型为SESSION_FILE),状态可能值为:'."\n"
+ ."\n"
+ .'- INIT: 待解析。'."\n"
+ .'- IN_PARSE_QUEUE:解析队列排队中。'."\n"
+ .'- PARSING: 解析中。'."\n"
+ .'- PARSE_SUCCESS:解析完成。'."\n"
+ .'- PARSE_FAILED:解析失败。'."\n"
+ .'- SAFE_CHECKING: 安全检测中。'."\n"
+ .'- SAFE_CHECK_FAILED: 安全检测失败。'."\n"
+ .'- INDEX_BUILDING:索引构建中。'."\n"
+ .'- INDEX_BUILD_SUCCESS:索引构建成功。'."\n"
+ .'- INDEX_BUILDING_FAILED:索引构建失败。'."\n"
+ .'- INDEX_DELETED:文件索引已删除。'."\n"
+ .'- FILE_IS_READY:文件准备完毕。'."\n"
+ .'<note>必须等到状态为FILE_IS_READY才能进行问答。</note>'."\n"
+ .'- FILE_EXPIRED:文件过期。'."\n"
+ .'<note>仅用户当前会话有效,用户关闭会话后文件过期(最长有效期为7天),不支持长期保存。</note>'."\n"
+ .'</props>', 'type' => 'string', 'example' => 'PARSE_SUCCESS'],
+ 'Tags' => [
+ 'description' => '文件关联的标签列表,一个文件支持关联多个标签。',
'type' => 'array',
- 'items' => [
- 'description' => '文本切片对象。',
- 'type' => 'object',
- 'properties' => [
- 'Metadata' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'文本切片的元数据Map。'."\n"
- ."\n"
- .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
- ."\n"
- .'> 检索文档搜索类识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'> 检索音视频搜索类知识库时,若切片包含音频,将通过元数据 Map 中` audio_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'> 检索音视频搜索类知识库时,若切片包含视频,将通过元数据 Map 中` video_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'</props>'."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'文本切片的元数据Map。'."\n"
- ."\n"
- .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
- ."\n"
- .'> 检索文档搜索类知识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'any',
- 'example' => '{'."\n"
- .' "parent": "",'."\n"
- .' "file_path": "https://***",'."\n"
- .' "image_url": ['."\n"
- .' "http://***"'."\n"
- .' ],'."\n"
- .' "nid": "***",'."\n"
- .' "title": "阿里云百炼文档",'."\n"
- .' "doc_id": "doc_***",'."\n"
- .' "content": "阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建",'."\n"
- .' "workspace_id": "ws_***",'."\n"
- .' "hier_title": "阿里云百炼文档",'."\n"
- .' "doc_name": "阿里云百炼文档介绍.pdpf",'."\n"
- .' "pipeline_id": "rhd***",'."\n"
- .' "_id": "ws_***"'."\n"
- .'}',
- ],
- 'Score' => [
- 'description' => '文本切片的相似度得分,可能值范围:[0-1]。',
- 'type' => 'number',
- 'format' => 'double',
- 'example' => '0.3',
- ],
- 'Text' => [
- 'description' => '文本切片内容。',
- 'type' => 'string',
- 'example' => '阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建。',
- ],
- ],
- ],
+ 'items' => ['description' => '文件的标签。', 'type' => 'string', 'example' => '产品介绍'],
],
+ 'ParseResultDownloadUrl' => ['type' => 'string', 'description' => ''],
+ 'ParseErrorMessage' => ['title' => '解析失败原因', 'description' => '解析失败原因', 'type' => 'string', 'example' => 'Error Message'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-7734-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Requests throttling triggered.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
+ 403 => [
+ 'schema' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['type' => 'string', 'description' => ''],
+ 'HttpStatusCode' => ['type' => 'integer', 'format' => 'int32', 'description' => ''],
+ 'Message' => ['type' => 'string', 'description' => ''],
+ 'Success' => ['type' => 'boolean', 'description' => ''],
+ ],
+ 'description' => '',
+ ],
+ ],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"Nodes\\": [\\n {\\n \\"Metadata\\": \\"{\\\\n \\\\\\"parent\\\\\\": \\\\\\"\\\\\\",\\\\n \\\\\\"file_path\\\\\\": \\\\\\"https://***\\\\\\",\\\\n \\\\\\"image_url\\\\\\": [\\\\n \\\\\\"http://***\\\\\\"\\\\n ],\\\\n \\\\\\"nid\\\\\\": \\\\\\"***\\\\\\",\\\\n \\\\\\"title\\\\\\": \\\\\\"阿里云百炼文档\\\\\\",\\\\n \\\\\\"doc_id\\\\\\": \\\\\\"doc_***\\\\\\",\\\\n \\\\\\"content\\\\\\": \\\\\\"阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建\\\\\\",\\\\n \\\\\\"workspace_id\\\\\\": \\\\\\"ws_***\\\\\\",\\\\n \\\\\\"hier_title\\\\\\": \\\\\\"阿里云百炼文档\\\\\\",\\\\n \\\\\\"doc_name\\\\\\": \\\\\\"阿里云百炼文档介绍.pdpf\\\\\\",\\\\n \\\\\\"pipeline_id\\\\\\": \\\\\\"rhd***\\\\\\",\\\\n \\\\\\"_id\\\\\\": \\\\\\"ws_***\\\\\\"\\\\n}\\",\\n \\"Score\\": 0.3,\\n \\"Text\\": \\"阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建。\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '检索知识库',
- 'description' => '<props="china">'."\n"
- ."\n"
- .'- **调用方式**:可通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)(配合阿里云访问密钥[AccessKey](~~116401~~))或[Spring AI Alibaba](~~2990886~~)(配合阿里云百炼[API-Key](~~2712195~~))检索知识库,两者均已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
- .'- **权限要求**:'."\n"
- .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:Retrieve权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
- .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
- .'- **响应延迟**:由于接口调用包含复杂的检索和匹配,响应时间可能较长,建议您合理设置请求的超时与重试策略。'."\n"
- .'- **幂等性**:本接口具有幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CreateTime\\": \\"2024-09-09 12:45:43\\",\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"FileName\\": \\"XXX产品介绍.pdf\\",\\n \\"FileType\\": \\"pdf\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\",\\n \\"SizeInBytes\\": 1234,\\n \\"Status\\": \\"PARSE_SUCCESS\\",\\n \\"Tags\\": [\\n \\"产品介绍\\"\\n ],\\n \\"ParseResultDownloadUrl\\": \\"\\",\\n \\"ParseErrorMessage\\": \\"Error Message\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '查询文件状态',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:DescribeFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
."\n"
- .'</props>'."\n"
- ."\n\n"
- .'<props="intl">'."\n"
+ .'- 本接口具有幂等性。'."\n"
."\n"
- .'- **调用方式**:推荐使用最新版[阿里云百炼 SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)调用,SDK 已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
- .'- **权限要求**:'."\n"
- .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:Retrieve权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
- .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
- .'- **响应延迟**:由于接口调用包含复杂的检索和匹配,响应时间可能较长,建议您合理设置请求的超时与重试策略。'."\n"
- .'- **幂等性**:本接口具有幂等性。'."\n"
- .'</props>',
- ],
- 'ListIndexDocuments' => [
- 'summary' => '获取指定知识库中的文件,以及它们的概要信息。',
- 'path' => '/{WorkspaceId}/index/list_index_documents',
- 'methods' => [
- 'get',
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2024-09-18T08:46:20.000Z', 'description' => '响应参数发生变更'],
],
- 'schemes' => [
- 'https',
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DescribeFile'],
+ ],
],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:DescribeFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'GetAlipayTransferStatus' => [
+ 'summary' => '查询应用中绑定的支付宝钱包的打赏状态。',
+ 'path' => '/openapi/alipay/transfer/status',
+ 'methods' => ['get', 'post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/x-www-form-urlencoded',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
'parameters' => [
[
- 'name' => 'IndexId',
+ 'name' => 'workspace_id',
'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx',
- ],
+ 'schema' => ['description' => '百炼工作空间ID', 'type' => 'string', 'required' => false, 'example' => 'llm-cxxxxxxb8d47ks'],
],
[
- 'name' => 'DocumentStatus',
+ 'name' => 'code',
'in' => 'query',
+ 'schema' => ['description' => '支付宝打赏链接请求返回的打赏code', 'type' => 'string', 'required' => false, 'example' => 'xxx-xxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '即通过文件导入状态对接口返回的文件列表进行过滤。取值范围:'."\n"
- .'- INSERT_ERROR:文件导入失败。'."\n"
- .'- RUNNING:文件导入中。'."\n"
- .'- DELETED:文件已删除。'."\n"
- .'- FINISH:文件导入成功。'."\n"
- ."\n"
- .'默认值为空,即不使用文件导入状态对结果进行过滤。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'INSERT_ERROR' => '文件导入失败',
- 'RUNNING' => '文件导入中',
- 'DELETED' => '文件已删除',
- 'FINISH' => '文件导入成功',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'requestId' => ['title' => 'Id of the request', 'description' => '请求的唯一ID', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n"],
+ 'data' => [
+ 'description' => '打赏的结果数据',
+ 'type' => 'object',
+ 'properties' => [
+ 'code' => ['description' => '打赏对应的code', 'type' => 'string', 'example' => '0'],
+ 'walletItemCode' => ['description' => '支付宝商品钱包code', 'type' => 'string', 'example' => 'xsdfsdf'],
+ 'mainAccountId' => ['description' => '主账号id(API忽略)', 'type' => 'string', 'example' => '1007576424487905'],
+ 'accountId' => ['description' => '子账号id(API忽略)', 'type' => 'string', 'example' => '1348393307144609'],
+ 'alipayOrderId' => ['description' => '支付宝的订单id', 'type' => 'string', 'example' => '1234234'],
+ 'status' => ['description' => '打赏状态'."\n"
+ .'- 1 (成功)'."\n"
+ .'- 0 (删除)'."\n"
+ .'- 2 (待打赏)'."\n"
+ .'- 3 (取消)'."\n"
+ .'- 4 (退款)'."\n"
+ .'- 5(关闭)'."\n"
+ .'- 6(失败)'."\n"
+ .'- 7(纠纷、异常)', 'type' => 'integer', 'format' => 'int64', 'example' => '1'],
+ 'creator' => ['description' => '创建者(API忽略)', 'type' => 'string', 'example' => '234234'],
+ 'modifier' => ['description' => '修改者(API忽略)', 'type' => 'string', 'example' => '234234'],
+ 'alipayOrderDetail' => ['description' => '支付细节(API忽略)', 'type' => 'string', 'example' => '{}'],
+ 'title' => ['description' => '转账标题', 'type' => 'string', 'example' => 'test'],
+ 'qrURL' => ['description' => '打赏链接(API忽略)', 'type' => 'string', 'example' => 'https://xxx.aliyun.com'],
+ 'transAmount' => ['description' => '订单总金额,单位为:元。', 'type' => 'string', 'example' => '0.22'],
+ 'scope' => ['description' => '打赏应用的所属状态', 'type' => 'string', 'example' => 'publish'],
+ ],
+ ],
],
- 'example' => 'FINISH',
],
],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"data\\": {\\n \\"code\\": \\"0\\",\\n \\"walletItemCode\\": \\"xsdfsdf\\",\\n \\"mainAccountId\\": \\"1007576424487905\\",\\n \\"accountId\\": \\"1348393307144609\\",\\n \\"alipayOrderId\\": \\"1234234\\",\\n \\"status\\": 1,\\n \\"creator\\": \\"234234\\",\\n \\"modifier\\": \\"234234\\",\\n \\"alipayOrderDetail\\": \\"{}\\",\\n \\"title\\": \\"test\\",\\n \\"qrURL\\": \\"https://xxx.aliyun.com\\",\\n \\"transAmount\\": \\"0.22\\",\\n \\"scope\\": \\"publish\\"\\n }\\n}","type":"json"}]',
+ 'title' => '查询支付宝打赏状态',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAlipayTransferStatus',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'GetAlipayUrl' => [
+ 'summary' => '获取应用上支付宝的打赏链接。',
+ 'path' => '/openapi/alipay/transfer/url',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
+ 'parameters' => [
[
- 'name' => 'DocumentName',
+ 'name' => 'workspace_id',
'in' => 'query',
- 'schema' => [
- 'description' => '即通过文件名称(不含后缀)对接口返回的文件列表进行过滤。默认值为空,即不使用文件名称对结果进行过滤。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'product-overview',
- ],
+ 'schema' => ['description' => '百炼工作空间的id', 'type' => 'string', 'required' => false, 'example' => 'xxxllm-czb8d47ks'],
],
[
- 'name' => 'EnableNameLike',
+ 'name' => 'app_id',
'in' => 'query',
+ 'schema' => ['description' => '百炼应用的id', 'type' => 'string', 'required' => false, 'example' => 'asfasdfxxasdf'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '是否开启文件名称的模糊匹配,与`DocumentName`参数配合使用。取值范围:'."\n"
- .'- true:根据文件名称对接口返回的文件列表进行模糊匹配。'."\n"
- .'- false:默认根据文件名称进行精确匹配。'."\n"
- ."\n"
- .'默认值为false。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'requestId' => ['description' => '请求的唯一id', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n"],
+ 'data' => [
+ 'description' => '返回数据',
+ 'type' => 'object',
+ 'properties' => [
+ 'qrUrl' => ['description' => '生成的打赏链接', 'type' => 'string', 'example' => 'https://xxxxxx.aliyun-inc.com'],
+ 'code' => ['description' => '对应的打赏的code,用于回查打赏状态', 'type' => 'string', 'example' => 'xxsdfasfw'],
+ ],
+ ],
],
- 'example' => 'false',
],
],
- [
- 'name' => 'PageNumber',
- 'in' => 'query',
- 'schema' => [
- 'description' => '指定要查询的页码。起始值为1。默认值为1。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"data\\": {\\n \\"qrUrl\\": \\"https://xxxxxx.aliyun-inc.com\\",\\n \\"code\\": \\"xxsdfasfw\\"\\n }\\n}","type":"json"}]',
+ 'title' => '获取支付宝打赏URL',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAlipayUrl',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ ],
+ 'GetAvailableParserTypes' => [
+ 'summary' => '根据输入的文件类型(文件扩展名),获取所有支持的解析器类型列表。',
+ 'path' => '/{WorkspaceId}/datacenter/parser/parsertype',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'PageSize',
- 'in' => 'query',
- 'schema' => [
- 'description' => '指定分页查询时每页展示的文件数量。最大值不限。'."\n"
- .'默认值为10。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '10',
- ],
+ 'AK' => [],
],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
+ 'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
+ ],
+ [
+ 'name' => 'FileType',
+ 'in' => 'query',
'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
+ 'description' => '文件类型(扩展名),用于获取支持该文件类型的解析器。可能值为: '."\n"
+ .'- doc'."\n"
+ .'- docx'."\n"
+ .'- ppt'."\n"
+ .'- pptx'."\n"
+ .'- xls'."\n"
+ .'- xlsx'."\n"
+ .'- md'."\n"
+ .'- txt'."\n"
+ .'- pdf'."\n"
+ .'- png'."\n"
+ .'- jpg'."\n"
+ .'- jpeg'."\n"
+ .'- bmp'."\n"
+ .'- gif'."\n"
+ .'- html',
'type' => 'string',
'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
+ 'example' => 'pdf',
+ 'enum' => ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'md', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'bmp', 'gif', 'html'],
],
],
],
@@ -4753,281 +3553,194 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'InvalidParameter',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-7734-4F9A-8464-2446XXXXXXX'],
'Data' => [
- 'description' => '接口业务数据字段。',
+ 'description' => '请求成功返回的业务数据。',
'type' => 'object',
'properties' => [
- 'Documents' => [
- 'description' => '返回知识库中的文件列表,按文档导入时间倒序排序(与控制台一致)。',
+ 'FileType' => ['description' => '文件类型,与输入参数中的FileType相同。', 'type' => 'string', 'example' => 'pdf'],
+ 'ParserList' => [
+ 'description' => '当前类型支持的解析器列表。',
'type' => 'array',
'items' => [
- 'description' => '文件对象。',
+ 'description' => '解析器对象。',
'type' => 'object',
'properties' => [
- 'SourceId' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'对于文档搜索/音视频搜索类知识库,该参数指的是类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n\n"
- .'对于数据查询/图片问答类知识库,该参数指的是数据表 ID。您可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-表格页签,单击数据表名称旁的 ID 图标获取。'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'对于文档搜索类知识库,该参数指的是类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
- ."\n\n"
- .'对于数据查询/图片问答类知识库,该参数指的是数据表 ID。您可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-表格页签,单击数据表名称旁的 ID 图标获取。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx',
- ],
- 'Id' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx',
- ],
- 'Name' => [
- 'description' => '文件名称。',
- 'type' => 'string',
- 'example' => 'product-overview',
- ],
- 'Size' => [
- 'description' => '文件大小,单位字节Byte。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '996765',
- ],
- 'DocumentType' => [
- 'description' => '文件格式类型。可能值为: pdf、docx、doc、txt、md、pptx、ppt、png、jpg、jpeg、bmp、gif、EXCEL。',
- 'type' => 'string',
- 'example' => 'pdf',
- ],
- 'Status' => [
- 'description' => '文件导入状态。可能值为:'."\n"
- .'- INSERT_ERROR:文件导入失败。'."\n"
- .'- RUNNING:文件导入中。'."\n"
- .'- DELETED:文件已删除。'."\n"
- .'- FINISH:文件导入成功。',
- 'type' => 'string',
- 'enumValueTitles' => [
- 'INSERT_ERROR' => '文件导入失败',
- 'RUNNING' => '文件导入中',
- 'DELETED' => '文件已删除',
- 'FINISH' => '文件导入成功',
- ],
- 'example' => 'RUNNING',
- ],
- 'Code' => [
- 'description' => '文件导入错误状态码。',
- 'type' => 'string',
- 'example' => '110002',
- ],
- 'Message' => [
- 'description' => '文件导入错误信息。',
- 'type' => 'string',
- 'example' => 'check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid',
- ],
- 'GmtModified' => [
- 'description' => '文件导入知识库的时间,采用Unix timestamp格式。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '1744856423000',
- ],
+ 'DisplayName' => ['description' => '解析方式的显示名称。', 'type' => 'string', 'example' => '智能文档解析'],
+ 'Parser' => ['description' => '解析器code。可能值为:'."\n"
+ .'- DOCMIND(智能文档解析)'."\n"
+ .'- DOCMIND_DIGITAL (电子文档解析)'."\n"
+ .'- DOCMIND_LLM_VERSION (大模型文档解析)'."\n"
+ .'- DASH_QWEN_VL_PARSER (Qwen-VL解析)', 'type' => 'string', 'example' => 'DOCMIND'],
],
],
],
- 'IndexId' => [
- 'description' => '知识库 ID。',
- 'type' => 'string',
- 'example' => 'pno97txxxx',
- ],
- 'TotalCount' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '2437',
- ],
- 'PageNumber' => [
- 'description' => '返回指定的页码。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '1',
- ],
- 'PageSize' => [
- 'description' => '返回指定的每页条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
- ],
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource'],
+ 'Code' => ['description' => '返回的错误code。', 'type' => 'string', 'example' => 'DataCenter.Throttling'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"SourceId\\": \\"cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\\",\\n \\"Id\\": \\"doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\\",\\n \\"Name\\": \\"product-overview\\",\\n \\"Size\\": 996765,\\n \\"DocumentType\\": \\"pdf\\",\\n \\"Status\\": \\"RUNNING\\",\\n \\"Code\\": \\"110002\\",\\n \\"Message\\": \\"check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid\\",\\n \\"GmtModified\\": 1744856423000\\n }\\n ],\\n \\"IndexId\\": \\"pno97txxxx\\",\\n \\"TotalCount\\": 2437,\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
- 'title' => '查询知识库下的文件列表',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndexFiles权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-2446XXXXXXX\\",\\n \\"Data\\": {\\n \\"FileType\\": \\"pdf\\",\\n \\"ParserList\\": [\\n {\\n \\"DisplayName\\": \\"智能文档解析\\",\\n \\"Parser\\": \\"DOCMIND\\"\\n }\\n ]\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"Code\\": \\"DataCenter.Throttling\\"\\n}","type":"json"}]',
+ 'title' => '获取文件支持的解析器类型',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetAvailableParserTypes权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ ."\n"
.'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过15次/秒。如遇限流,请稍后重试。',
- ],
- 'ListIndexFileDetails' => [
- 'summary' => '获取指定知识库中的文件,以及它们的详细信息。',
- 'path' => '/{WorkspaceId}/index/list_index_file_detail',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAvailableParserTypes',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'GetConnector' => [
+ 'summary' => '获取连接器信息。当前接口仅支持获取文件连接器信息。',
+ 'path' => '/{WorkspaceId}/datacenter/connector',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'IndexId',
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID,获取方式请参见[如何使用业务空间](~~2587495~~)', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
+ ],
+ [
+ 'name' => 'ConnectorName',
'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '79c0alxxxx',
- ],
+ 'schema' => ['title' => '查询的连接器名称,模糊查询'."\n"
+ .'连接器名称', 'description' => '查询的连接器名称,精确查询', 'type' => 'string', 'required' => false, 'example' => '连接器名称', 'maxLength' => 20, 'minLength' => 0],
],
[
- 'name' => 'DocumentStatus',
+ 'name' => 'ConnectorId',
'in' => 'query',
+ 'schema' => ['title' => '', 'description' => '所属连接器 ID,请到[百炼控制台](https://bailian.console.aliyun.com/cn-beijing/?tab=app#/connector/list)获取', 'type' => 'string', 'required' => false, 'example' => 'conn_file_xxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '即通过文件导入状态对接口返回的文件列表进行过滤。取值范围:'."\n"
- ."\n"
- .'- INSERT_ERROR:文件导入失败。'."\n"
- .'- RUNNING:文件导入中。'."\n"
- .'- DELETED:文件已删除。'."\n"
- .'- FINISH:文件导入成功。'."\n"
- ."\n"
- .'默认值为空,即不使用文件导入状态对结果进行过滤。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'INSERT_ERROR' => '文件导入失败',
- 'RUNNING' => '文件导入中',
- 'DELETED' => '文件已删除',
- 'FINISH' => '文件导入成功',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'success'],
+ 'Data' => [
+ 'description' => '接口业务数据字段',
+ 'type' => 'object',
+ 'properties' => [
+ 'ConnectorId' => ['description' => '连接器 ID', 'type' => 'string', 'example' => 'conn_file_e0c9db4030b2465a9478028f7d76cd92_1234'],
+ 'ConnectorName' => ['description' => '连接器名称', 'type' => 'string', 'example' => 'name'],
+ 'ConnectorType' => ['description' => '连接器类型', 'type' => 'string', 'example' => 'FILE'],
+ 'Description' => ['description' => '连接器描述', 'type' => 'string', 'example' => 'Description'],
+ ],
+ ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Requests throttling triggered.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '7BA8ADD9-53D6-53F0-918F-A1E776AD230E'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 '."\n"
+ .'- false:失败', 'type' => 'boolean', 'example' => 'True'],
],
- 'example' => 'FINISH',
],
],
- [
- 'name' => 'DocumentName',
- 'in' => 'query',
- 'schema' => [
- 'description' => '即通过文件名称对接口返回的文件详情列表进行过滤。默认值为空,即不使用文件名称对结果进行过滤。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '翻译平台运维文档',
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '获取连接器信息',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:GetConnector权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)来调用本接口。'."\n"
+ .'- 本接口具备幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"ConnectorId\\": \\"conn_file_e0c9db4030b2465a9478028f7d76cd92_1234\\",\\n \\"ConnectorName\\": \\"name\\",\\n \\"ConnectorType\\": \\"FILE\\",\\n \\"Description\\": \\"Description\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"7BA8ADD9-53D6-53F0-918F-A1E776AD230E\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'GetIndexJobStatus' => [
+ 'summary' => '查询指定的知识库创建任务或知识库追加任务的当前状态。',
+ 'path' => '/{WorkspaceId}/index/job/status',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'PageNumber',
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/x-www-form-urlencoded'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '业务空间 ID,请确保您要操作的知识库在此业务空间中。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
+ ],
+ [
+ 'name' => 'JobId',
'in' => 'query',
- 'schema' => [
- 'description' => '指定要查询的页码。起始值为 1。默认值为 1。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
- ],
+ 'schema' => ['description' => '知识库作业任务 ID,即 **SubmitIndexJob** 接口或 **SubmitIndexAddDocumentsJob** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '20230718xxxx-146c93bf'],
],
[
- 'name' => 'PageSize',
+ 'name' => 'IndexId',
'in' => 'query',
- 'schema' => [
- 'description' => '指定分页查询时每页展示的文件数量 ,最大值10。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '10',
- ],
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
],
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'name' => 'PageNumber',
+ 'in' => 'query',
+ 'schema' => ['description' => '**SubmitIndexJob** 接口和 **SubmitIndexAddDocumentsJob** 接口均支持批量导入文件。本接口返回的字段包括知识库作业任务的总状态`Status`及各文件导入的状态`Document.Status`。若文件较多,可通过`PageNumber`参数进行分页查询。起始值为 1,默认值为 1。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'],
],
[
- 'name' => 'EnableNameLike',
+ 'name' => 'pageSize',
'in' => 'query',
- 'schema' => [
- 'description' => '是否开启文件名称的模糊匹配,与`DocumentName`参数配合使用。取值范围:'."\n"
- ."\n"
- .'- true:根据文件名称对接口返回的文件列表进行模糊匹配。'."\n"
- .'- false:默认根据文件名称进行精确匹配。'."\n"
- ."\n"
- .'默认值为 false。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [
- 'true' => '开启',
- 'false' => '不开启',
- ],
- 'example' => 'false',
- ],
+ 'schema' => ['description' => '指定分页查询时每页展示的文件导入任务数量。最大值不限。默认值为 10。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
],
],
'responses' => [
@@ -5037,311 +3750,275 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'InvalidParameter'."\n",
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.Forbidden'],
'Data' => [
'description' => '接口业务数据字段。',
'type' => 'object',
'properties' => [
'Documents' => [
- 'description' => '返回知识库中的文件列表,按文件导入时间倒序排序(与控制台一致)。',
+ 'description' => '本次导入的文件列表。',
'type' => 'array',
'items' => [
'description' => '文件对象。',
'type' => 'object',
'properties' => [
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.Document.ChunkError'],
+ 'DocId' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
+ 'DocName' => ['description' => '文件名称。', 'type' => 'string', 'example' => 'XXX产品介绍'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'document parse error'],
'Status' => [
- 'description' => '文件导入状态。可能值为:'."\n"
- ."\n"
- .'- INSERT_ERROR:文件导入失败。'."\n"
- .'- RUNNING:文件导入中。'."\n"
- .'- DELETED:文件已删除。'."\n"
- .'- FINISH:文件导入成功。',
+ 'description' => '文件导入状态。可能值:'."\n"
+ .'- INSERT_ERROR:导入索引失败。'."\n"
+ .'- RUNNING:索引构建中。'."\n"
+ .'- DELETED:已经删除。'."\n"
+ .'- FINISH:索引构建成功。'."\n"
+ .'- PARSE_FAILED:解析失败'."\n"
+ .'- DOC_PARSING:解析中',
'type' => 'string',
+ 'enumValueTitles' => [],
'example' => 'RUNNING',
],
- 'EnableHeaders' => [
- 'description' => 'Excel文件表头是否支持拼装。',
- 'type' => 'string',
- 'example' => 'true',
- ],
- 'OverlapSize' => [
- 'description' => '分段重叠长度。',
- 'type' => 'string',
- 'example' => '100',
- ],
- 'Message' => [
- 'description' => '文件导入错误信息。',
- 'type' => 'string',
- 'example' => 'check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid',
- ],
- 'Size' => [
- 'description' => '文件大小,单位字节Byte。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '996764'."\n",
- ],
- 'SourceId' => [
- 'description' => '类目 ID。',
- 'type' => 'string',
- 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx'."\n",
- ],
- 'GmtModified' => [
- 'description' => '文件导入知识库的时间,采用 Unix timestamp 格式。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '1744856423000'."\n",
- ],
- 'DocumentType' => [
- 'description' => '文件格式类型。可能值为: pdf、docx、doc、txt、md、pptx、ppt、png、jpg、jpeg、bmp、gif、EXCEL。',
- 'type' => 'string',
- 'example' => 'pdf',
- ],
- 'ChunkMode' => [
- 'description' => '自定义切分。',
- 'type' => 'string',
- 'example' => 'DashSplitter',
- ],
- 'Code' => [
- 'description' => '文件导入错误状态码。',
- 'type' => 'string',
- 'example' => '110002',
- ],
- 'separator' => [
- 'description' => '分句标识符。',
- 'type' => 'string',
- 'example' => '" "',
- ],
- 'Name' => [
- 'description' => '文件名称。',
- 'type' => 'string',
- 'example' => '翻译平台运维文档'."\n",
- ],
- 'ChunkSize' => [
- 'description' => '分段长度,即文本切片的字符数。',
- 'type' => 'string',
- 'example' => '600',
- ],
- 'Id' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx'."\n",
- ],
+ 'GmtModified' => ['type' => 'integer', 'format' => 'int64', 'description' => ''],
],
],
],
- 'IndexId' => [
- 'description' => '知识库 ID。',
+ 'JobId' => ['description' => '作业任务ID。', 'type' => 'string', 'example' => '66122af12a4e45ddae6bd6c84555xxxx'],
+ 'Status' => [
+ 'description' => '知识库作业任务的当前状态。可能值:'."\n"
+ .'- COMPLETED:执行成功。'."\n"
+ .'- FAILED:执行失败。'."\n"
+ .'- RUNNING:执行中。'."\n"
+ .'- PENDING:等待执行。',
'type' => 'string',
- 'example' => '79c0alxxxx',
- ],
- 'TotalCount' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '2437',
- ],
- 'PageNumber' => [
- 'description' => '返回指定的页码。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '1',
- ],
- 'PageSize' => [
- 'description' => '返回指定的每页条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
+ 'enumValueTitles' => ['COMPLETED' => '执行成功', 'FAILED' => '执行失败', 'RUNNING' => '执行中', 'PENDING' => '等待执行'],
+ 'example' => 'PENDING',
],
],
],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'User not authorized to operate on the specified resource.'],
+ 'RequestId' => ['description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['title' => 'Id of the request', 'description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.Forbidden\\",\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"Code\\": \\"Index.Document.ChunkError\\",\\n \\"DocId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\",\\n \\"DocName\\": \\"XXX产品介绍\\",\\n \\"Message\\": \\"document parse error\\",\\n \\"Status\\": \\"RUNNING\\",\\n \\"GmtModified\\": 0\\n }\\n ],\\n \\"JobId\\": \\"66122af12a4e45ddae6bd6c84555xxxx\\",\\n \\"Status\\": \\"PENDING\\"\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'gatewayOptions' => [
+ 'gatewayProtocols' => [],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"InvalidParameter\\\\n\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"Status\\": \\"RUNNING\\",\\n \\"EnableHeaders\\": \\"true\\",\\n \\"OverlapSize\\": \\"100\\",\\n \\"Message\\": \\"check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid\\",\\n \\"Size\\": 996764,\\n \\"SourceId\\": \\"cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\\\\n\\",\\n \\"GmtModified\\": 1744856423000,\\n \\"DocumentType\\": \\"pdf\\",\\n \\"ChunkMode\\": \\"DashSplitter\\",\\n \\"Code\\": \\"110002\\",\\n \\"separator\\": \\"\\\\\\" \\\\\\"\\",\\n \\"Name\\": \\"翻译平台运维文档\\\\n\\",\\n \\"ChunkSize\\": \\"600\\",\\n \\"Id\\": \\"doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\\\\n\\"\\n }\\n ],\\n \\"IndexId\\": \\"79c0alxxxx\\",\\n \\"TotalCount\\": 2437,\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
- 'title' => '查询知识库下的文件详情',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndexFiles权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ 'title' => '查询知识库创建任务状态',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetIndexJobStatus权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 您需要有一个正在执行中的知识库作业任务(创建知识库任务可以调用 **SubmitIndexJob** 接口,创建知识库追加任务可以调用 **SubmitIndexAddDocumentsJob** 接口),并且获得相应的`JobId`。'."\n"
+ .'- 本接口调用间隔建议在 5 秒以上。'."\n"
.'- 本接口具有幂等性。',
- ],
- 'UpdateIndex' => [
- 'summary' => '更新指定知识库的部分配置。',
- 'path' => '/{WorkspaceId}/index/update',
- 'methods' => [
- 'post',
+ 'changeSet' => [
+ ['createdAt' => '2025-03-25T06:25:53.000Z', 'description' => '响应参数发生变更'],
+ ['createdAt' => '2024-09-05T07:46:53.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '20', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetIndexJobStatus'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetIndexJobStatus',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'GetIndexMonitor' => [
+ 'summary' => '调用GetIndexMonitor接口,查询指定知识库在特定时间范围内的监控数据。这些数据对于性能分析、容量规划和成本管理至关重要。'."\n"
+ ."\n"
+ .'监控数据主要包含两大维度:'."\n"
+ ."\n"
+ .'存储监控:获取知识库的索引存储限额和当前使用量。'."\n"
+ .'检索(QPS)监控:获取查询时间段内总的及按时间窗口细分的检索性能指标,包括QPS峰值、总请求数、平均QPS,并细分为成功、失败和被限流的请求。',
+ 'path' => '/{WorkspaceId}/rag/index/monitor',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '业务空间 ID',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
+ 'schema' => ['description' => '知识库所在工作空间ID', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
],
[
- 'name' => 'Id',
+ 'name' => 'IndexId',
'in' => 'query',
- 'allowEmptyValue' => false,
'schema' => [
- 'title' => '幂等参数',
- 'description' => '知识库 ID',
+ 'description' => '目标知识库的唯一ID',
'type' => 'string',
'required' => true,
- 'example' => '79c0alxxxx',
+ 'enumValueTitles' => [],
+ 'example' => 'kb-123456xxxx'."\n",
],
],
[
- 'name' => 'Name',
+ 'name' => 'StartTimestamp',
'in' => 'query',
- 'schema' => [
- 'description' => '知识库名称',
- 'type' => 'string',
- 'required' => false,
- 'example' => '企业帮助文档库',
- ],
+ 'schema' => ['description' => '查询起始时间,秒级Unix时间戳', 'type' => 'integer', 'format' => 'int64', 'required' => true, 'example' => '1767604500'],
],
[
- 'name' => 'Description',
+ 'name' => 'EndTimestamp',
'in' => 'query',
- 'schema' => [
- 'description' => '知识库描述',
- 'type' => 'string',
- 'required' => false,
- 'example' => '企业知识库',
- ],
+ 'schema' => ['description' => '查询结束时间,最大支持起始时间+30d,秒级Unix时间戳', 'type' => 'integer', 'format' => 'int64', 'required' => true, 'example' => '1767604500'],
],
- [
- 'name' => 'RerankMinScore',
- 'in' => 'query',
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '排序最低分数,取值范围[0-1]',
- 'type' => 'string',
- 'required' => false,
- 'example' => '0.01',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Code' => ['description' => '状态码', 'type' => 'string', 'example' => '200'],
+ 'Data' => ['description' => '响应的核心数据对象。'."\n"
+ ."\n"
+ .'**pipelineCommercialType**(String):知识库规格'."\n"
+ ."\n"
+ .'- standard:标准版'."\n"
+ ."\n"
+ .'- enterprise:旗舰版'."\n"
+ ."\n"
+ .'**storageMonitorData**(Object): 知识库的存储监控数据'."\n"
+ ."\n\n"
+ .' - indexStorageLimit(Number): 知识库的索引存储限额,单位为 GB。'."\n"
+ ."\n"
+ .'- indexStorageUsage(Number): 知识库当前已占用的索引存储额度,单位为 GB。'."\n"
+ ."\n"
+ .'**pipelineCommercialCu**(Integer):表示旗舰版知识库的RCU,如2。'."\n"
+ ."\n"
+ .'**qpsMonitorData** (Object): 知识库在整个查询时间段内的检索(QPS)聚合监控数据'."\n"
+ ."\n"
+ .'- peakQps(Integer): 整个时间段内的最高 QPS 峰值'."\n"
+ ."\n"
+ .'- totalRequests(Integer): 整个时间段内的总请求次数'."\n"
+ ."\n"
+ .'- avgQpsOfActiveSeconds(Number): 整个时间段内,所有活跃秒(即有调用的秒)的平均 QPS'."\n"
+ ."\n"
+ .'- monitorData(Array): 按时间窗口划分的详细监控数据数组。数组中的每个对象代表一个时间窗口的统计信息。'."\n"
+ ."\n\n"
+ .' <details>'."\n"
+ .' <summary>子属性</summary>'."\n"
+ .' '."\n"
+ .' - successData(Object):该窗口内请求成功的统计数据。'."\n"
+ ."\n"
+ .' - limitData(Object): 该窗口内被限流的统计数据。'."\n"
+ ."\n"
+ .' - failData(Object): 该窗口内调用失败的统计数据。'."\n"
+ ."\n"
+ .' - peakQpsInWindowRange(Integer): 该窗口内的总 QPS 峰值(成功+限流+失败)。'."\n"
+ ."\n"
+ .' - totalRequests(Integer): 该窗口内的总请求数(成功+限流+失败)。'."\n"
+ ."\n"
+ .' - windowRange(Integer): 时间窗口的开始时间(秒级 Unix 时间戳)。'."\n"
+ ."\n"
+ .' - windowRangeEnd(Integer): 时间窗口的结束时间(秒级 Unix 时间戳)。'."\n"
+ ."\n"
+ .' - avgQpsOfActiveSeconds(Number): 该窗口内活跃秒的平均 QPS。'."\n"
+ ."\n"
+ .' **successData, limitData, failData 这三个对象的内部结构完全相同,具体如下:**'."\n"
+ ."\n"
+ .' - peakQpsInWindowRange(Integer): 对应状态下的 QPS 峰值。'."\n"
+ ."\n"
+ .' - totalRequests(Integer): 对应状态下的总请求数。'."\n"
+ ."\n"
+ .' - avgQpsOfActiveSeconds(Number): 对应状态下活跃秒的平均 QPS。'."\n"
+ ."\n"
+ .' </details>', 'type' => 'any', 'example' => '{'."\n"
+ .' "code": "Success",'."\n"
+ .' "status_code": 200,'."\n"
+ .' "data": {'."\n"
+ .'"pipelineCommercialType": "standard", "storageMonitorData": Object{...},'."\n"
+ .' "qpsMonitorData": Object{...}'."\n"
+ .' },'."\n"
+ .' "success": true,'."\n"
+ .' "message": "success",'."\n"
+ .' "request_id": "65d34b79-b97e-478e-a0a3-xxx",'."\n"
+ .' "status": "SUCCESS"'."\n"
+ .'}'],
+ 'Message' => ['description' => '状态信息', 'type' => 'string', 'example' => 'success'],
+ 'Success' => ['description' => '请求是否成功', 'type' => 'boolean', 'example' => 'true'."\n"],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'integer', 'format' => 'int32', 'example' => 'SUCCESS'],
+ ],
],
],
- [
- 'name' => 'DenseSimilarityTopK',
- 'in' => 'query',
- 'schema' => [
- 'description' => '向量检索 Top K,通过生成输入文本的向量并在知识库中检索与其向量表示最相似的 K 个文本切片。K的取值范围[0-100]。'."\n"
- .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
- ."\n"
- .'默认值为100。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '100',
- 'minimum' => '0',
- 'example' => '100',
- 'default' => '100',
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '获取知识库监控数据',
+ 'description' => '<props="intl">本接口不支持国际站。</props>'."\n"
+ .'<props="china">- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)来调用本接口。'."\n"
+ .'调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ .'本接口具有幂等性。'."\n"
+ .'查询时间范围(EndTimestamp - StartTimestamp)最大支持30天。'."\n"
+ .'返回数据中的时间窗口粒度会根据您查询的时间范围动态调整。</props>',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetIndexMonitor',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Code\\": \\"200\\",\\n \\"Data\\": \\"{\\\\n \\\\\\"code\\\\\\": \\\\\\"Success\\\\\\",\\\\n \\\\\\"status_code\\\\\\": 200,\\\\n \\\\\\"data\\\\\\": {\\\\n\\\\\\"pipelineCommercialType\\\\\\": \\\\\\"standard\\\\\\", \\\\\\"storageMonitorData\\\\\\": Object{...},\\\\n \\\\\\"qpsMonitorData\\\\\\": Object{...}\\\\n },\\\\n \\\\\\"success\\\\\\": true,\\\\n \\\\\\"message\\\\\\": \\\\\\"success\\\\\\",\\\\n \\\\\\"request_id\\\\\\": \\\\\\"65d34b79-b97e-478e-a0a3-xxx\\\\\\",\\\\n \\\\\\"status\\\\\\": \\\\\\"SUCCESS\\\\\\"\\\\n}\\",\\n \\"Message\\": \\"success\\",\\n \\"Success\\": true,\\n \\"Status\\": 0\\n}","type":"json"}]',
+ ],
+ 'GetMemory' => [
+ 'summary' => '获取指定长期记忆体的描述信息。',
+ 'path' => '/{workspaceId}/memories/{memoryId}',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
+ 'security' => [
[
- 'name' => 'SparseSimilarityTopK',
- 'in' => 'query',
- 'schema' => [
- 'description' => '关键词检索TopK,即在知识库中查找与输入文本的关键词精确匹配的切片。它可以帮助您过滤掉无关的文本切片,提供更准确的结果。'."\n"
- .'取值范围[0-100]。'."\n"
- .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
- ."\n"
- .'默认值为:100。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '100',
- 'minimum' => '0',
- 'example' => '100',
- 'default' => '100',
- ],
+ 'AK' => [],
],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
- 'name' => 'PipelineCommercialType',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库的规格类型。取值范围:'."\n"
- ."\n"
- .'- standard:标准版'."\n"
- ."\n"
- .'- enterprise:旗舰版',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'standard',
- 'enum' => [
- 'standard',
- 'enterprise',
- ],
- ],
+ 'name' => 'workspaceId',
+ 'in' => 'path',
+ 'schema' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
- 'name' => 'PipelineCommercialCu',
- 'in' => 'query',
- 'schema' => [
- 'description' => '指定旗舰版知识库的 RCU 数量,即仅当 pipelineCommercialType 指定 enterprise 时才需要传入。'."\n"
- ."\n"
- .'取值范围:[1-200]。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '200',
- 'minimum' => '1',
- 'example' => '3',
- ],
+ 'name' => 'memoryId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体 ID,对应 [CreateMemory](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory) 接口返回的`memoryId`。', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbxxxx'."\n"],
],
],
'responses' => [
@@ -5351,125 +4028,78 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID',
- 'type' => 'string',
- 'example' => '17204B98-7734-4F9A-8464-xxx',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段',
- 'type' => 'object',
- 'properties' => [
- 'Id' => [
- 'description' => '知识库ID',
- 'type' => 'string',
- 'example' => '79c0alxxxx',
- ],
- ],
- ],
- 'Status' => [
- 'description' => '接口返回的状态码',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- ."\n"
- .'true:成功'."\n"
- ."\n"
- .'false:失败',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Message' => [
- 'description' => '错误信息',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Code' => [
- 'description' => '状态码',
- 'type' => 'string',
- 'example' => 'Success',
- ],
+ 'description' => ['description' => '长期记忆体的描述信息。', 'type' => 'string', 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体'],
+ 'memoryId' => ['description' => '长期记忆体 ID。', 'type' => 'string', 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'],
+ 'workspaceId' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。', 'type' => 'string', 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
],
],
],
- 'errorCodes' => [],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'errorCodes' => [
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-xxx\\",\\n \\"Data\\": {\\n \\"Id\\": \\"79c0alxxxx\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Code\\": \\"Success\\"\\n}","type":"json"}]',
- 'title' => '更新知识库',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
- .'- 本接口具有幂等性。',
- 'requestParamsDescription' => '参数Name,Description,RerankMinScore ,至少填写一项,不能同时为空。',
- ],
- 'DeleteIndexDocument' => [
- 'summary' => '永久删除指定知识库中的文件。',
- 'path' => '/{WorkspaceId}/index/delete_index_document',
- 'methods' => [
- 'post',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"description\\": \\"我的大模型应用$APP_ID关于A用户的长期记忆体\\",\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbdxxxx\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\",\\n \\"workspaceId\\": \\"llm-3z7uw7fwz0vexxxx\\"\\n}","type":"json"}]',
+ 'title' => '获取长期记忆体',
+ 'description' => '- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetMemory'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'GetMemoryNode' => [
+ 'summary' => '获取记忆片段。',
+ 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes/{memoryNodeId}',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'WorkspaceId',
+ 'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
[
- 'name' => 'IndexId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx',
- ],
+ 'name' => 'memoryId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体Id', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n"],
],
[
- 'name' => 'DocumentIds',
- 'in' => 'query',
- 'style' => 'json',
- 'schema' => [
- 'description' => '文件 ID 列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件</props>页签,单击文件名称旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx',
- ],
- 'required' => true,
- ],
+ 'name' => 'memoryNodeId',
+ 'in' => 'path',
+ 'schema' => ['title' => '长期记忆节点Id', 'description' => '记忆片段Id', 'type' => 'string', 'required' => true, 'example' => '68de06c95368463a8be4a84efc872cc5'."\n"],
],
],
'responses' => [
@@ -5479,143 +4109,75 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值为:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Data' => [
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'DeletedDocument' => [
- 'description' => '已成功删除的文件 ID 列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx',
- ],
- ],
- ],
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
+ 'content' => ['title' => '长期记忆节点内容', 'description' => '记忆片段内容', 'type' => 'string', 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n"],
+ 'memoryId' => ['title' => '长期记忆Id', 'description' => '长期记忆体Id', 'type' => 'string', 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n"],
+ 'memoryNodeId' => ['title' => '长期记忆节点Id', 'description' => '记忆片段Id', 'type' => 'string', 'example' => '68de06c95368463a8be4a84efc872cc5'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'."\n"],
+ 'workspaceId' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'Memory.MemoryNodeContentInvalid', 'errorMessage' => 'Memory node content is invalid.', 'description' => '长期记忆节点的内容无效'],
+ ],
+ 404 => [
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ['errorCode' => 'Memory.MemoryNodeNotFound', 'errorMessage' => 'MemoryNode not found.', 'description' => '长期记忆节点未找到'],
+ ],
+ 500 => [
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"DeletedDocument\\": [\\n \\"file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx\\"\\n ]\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
- 'title' => '删除知识库下的文件',
- 'description' => '- 本接口不支持删除数据查询/图片问答类知识库中的数据。请通过阿里云百炼控制台操作。'."\n"
- .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteIndexDocument权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
- .'- 仅能删除知识库中状态为导入失败(INSERT_ERROR)或导入成功(FINISH)的文件。如需查询指定知识库下的文件状态,可调用 **ListIndexDocuments** 接口。'."\n"
- .'- 删除操作不可逆,被删的文件内容将无法恢复,且 **Retrieve** 接口将无法再获取其相关信息,请谨慎操作。'."\n"
- .'- 调用本接口不会删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中已导入的文档。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'ListIndices' => [
- 'summary' => '获取指定业务空间下知识库列表。',
- 'path' => '/{WorkspaceId}/index/list_indices',
- 'methods' => [
- 'get',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"content\\": \\"用户喜欢吃西红柿炒鸡蛋\\\\n\\",\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbd5fc3\\\\n\\",\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efc872cc5\\",\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\\\n\\",\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdm5v\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '获取记忆片段',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetMemoryNode'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'GetParseSettings' => [
+ 'summary' => '查询指定类目的数据解析设置。',
+ 'path' => '/{WorkspaceId}/datacenter/parser/settings',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'abilityTreeNodes' => [
- 'FEATUREsfm4VA8MJ',
- ],
- ],
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true, 'tenantRelevance' => 'tenant'],
'parameters' => [
[
- 'name' => 'IndexName',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库的名称。支持通过名称查找知识库。长度为 1~20 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。'."\n"
- ."\n"
- .'默认值为空,即查询指定业务空间下的所有知识库。',
- 'type' => 'string',
- 'required' => false,
- 'enumValueTitles' => [],
- 'example' => 'idx_status_score',
- ],
- ],
- [
- 'name' => 'PageNumber',
- 'in' => 'query',
- 'schema' => [
- 'description' => '指定要查询的页码。起始值为 1。默认值为 1。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '1',
- ],
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => false, 'example' => 'llm-3shx2gu255oqxxxx'],
],
[
- 'name' => 'PageSize',
+ 'name' => 'CategoryId',
'in' => 'query',
- 'schema' => [
- 'description' => '指定分页查询时每页展示的知识库数量。最大值不限。'."\n"
- .'默认值为10。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '10',
- ],
- ],
- [
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oq6xxxx',
- ],
+ 'schema' => ['description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`,或者在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签</props><props="intl">[应用数据](https://bailian.console.alibabacloud.com/?tab=app#/data-center)-非结构化数据页签</props>,单击类目名称旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
],
],
'responses' => [
@@ -5625,280 +4187,232 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '本次请求requestId', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'],
'Data' => [
- 'description' => '返回数据。',
- 'type' => 'object',
- 'properties' => [
- 'PageNumber' => [
- 'description' => '返回指定的页码。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '1',
- ],
- 'PageSize' => [
- 'description' => '返回指定的每页条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
- ],
- 'TotalCount' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '48',
- ],
- 'Indices' => [
- 'description' => '知识库列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '知识库对象。',
+ 'description' => '请求成功返回的业务数据。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '返回具体内容',
+ 'type' => 'object',
+ 'properties' => [
+ 'FileType' => ['description' => '文件类型,扩展名,可能值为: pdf、docx、doc等,列举当前类目中支持的所有文件类型。', 'type' => 'string', 'example' => 'pdf'],
+ 'ParserDisplayName' => ['description' => '解析方式的显示名称。', 'type' => 'string', 'example' => '电子文档解析'],
+ 'ParserConfig' => [
+ 'description' => '解析器配置,仅在类型被设置为Qwen VL解析时才会返回。',
'type' => 'object',
'properties' => [
- 'Id' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'example' => 'lecxr5xxxx',
- ],
- 'Name' => [
- 'description' => '知识库名称。',
- 'type' => 'string',
- 'example' => 'XXXX产品清单',
- ],
- 'Description' => [
- 'description' => '知识库描述。',
- 'type' => 'string',
- 'example' => '清单中产品主要面向海外客户。',
- ],
- 'StructureType' => [
- 'description' => '知识库类型。可能值:'."\n"
- ."\n"
- .'- UNSTRUCTURED:文档搜索类。',
- 'type' => 'string',
- 'enumValueTitles' => [],
- 'example' => 'UNSTRUCTURED',
- ],
- 'ChunkSize' => [
- 'description' => '分段预估长度。可能值范围[1-2048]。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '5',
- ],
- 'OverlapSize' => [
- 'description' => '分段重叠长度。可能值范围[0-1024]。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
- ],
- 'Separator' => [
- 'description' => '分句标识符。如果有多个分句标识符,则用 | 分隔。可能值:'."\n"
- .'- \\\\n:换行'."\n"
- .'- ,:中文逗号'."\n"
- .'- ,:英文逗号'."\n"
- .'- 。:中文句号'."\n"
- .'- .:英文句号'."\n"
- .'- !:中文叹号'."\n"
- .'- !:英文叹号'."\n"
- .'- ;:中文分号'."\n"
- .'- ;:英文分号'."\n"
- .'- ?:中文问号'."\n"
- .'- ?:英文问号',
- 'type' => 'string',
- 'example' => '\\n',
- ],
- 'EmbeddingModelName' => [
- 'description' => 'Embedding模型名称。可能值:'."\n"
- ."\n"
- .'<props="china">'."\n"
- ."\n"
- .'- text-embedding-v4:text-embedding-v4模型。'."\n"
- .'- text-embedding-v3:text-embedding-v3模型。'."\n"
- .'- text-embedding-v2:text-embedding-v2模型。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'- text-embedding-v2:text-embedding-v2模型。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'example' => 'text-embedding-v2',
- ],
- 'RerankModelName' => [
- 'description' => 'Rank模型名称。可能值:'."\n"
- ."\n"
- .'<props="china">'."\n"
- ."\n"
- .'- qwen3-rerank-hybrid:qwen3-rerank(hybrid)排序。'."\n"
- .'- qwen3-rerank:qwen3-rerank排序。'."\n"
- .'- gte-rerank-hybrid:gte-rerank(hybrid)排序。'."\n"
- .'- gte-rerank:gte-rerank排序。'."\n"
- ."\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'- gte-rerank-hybrid:官方排序。'."\n"
- .'- gte-rerank:gte-rerank排序。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'example' => 'gte-rerank-hybrid',
- ],
- 'RerankMinScore' => [
- 'description' => '相似度阈值。范围[0.01-1.00]。',
- 'type' => 'string',
- 'example' => '0.01',
- ],
- 'SourceType' => [
- 'description' => '阿里云百炼<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>的数据类型。'."\n"
- ."\n\n"
- .'对于文档搜索<props="china">/音视频搜索</props>类知识库,可能值:'."\n"
- .'- DATA_CENTER_CATEGORY:类目类型。'."\n"
- .'- DATA_CENTER_FILE:文件类型。'."\n"
- ."\n"
- .'对于数据查询/图片问答类知识库,可能值:'."\n"
- .'- DATA_CENTER_STRUCTURED_TABLE:数据表类型。',
- 'type' => 'string',
- 'example' => 'DATA_CENTER_FILE',
- ],
- 'DocumentIds' => [
- 'description' => '文件 ID 列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文件 ID。',
- 'type' => 'string',
- 'example' => 'file_8c67b438043848199ffaa903d29addd4_xxxxxxxx',
- ],
- ],
- 'SinkType' => [
- 'description' => '知识库的向量存储类型。可能值:'."\n"
- .'- ES:内置的向量数据库。'."\n"
- .'- BUILT_IN:内置的向量数据库。'."\n"
- .'- ADB:AnalyticDB for PostgreSQL数据库。',
- 'type' => 'string',
- 'example' => 'BUILT_IN',
- ],
- 'SinkInstanceId' => [
- 'description' => '知识库的向量存储的实例 ID。',
- 'type' => 'string',
- 'example' => 'gp-bp1gq62t1788yxxxx',
- ],
- 'SinkRegion' => [
- 'description' => '知识库的向量存储的实例地域。',
- 'type' => 'string',
- 'example' => 'cn-hangzhou',
- ],
- 'ConfgModel' => [
- 'description' => '此知识库采用的配置模式。可能值:'."\n"
- .'- recommend:推荐配置。'."\n"
- .'- user-defined:自定义。',
+ 'ModelName' => [
+ 'description' => '模型名称。',
'type' => 'string',
- 'example' => 'recommend',
- ],
- 'EnableRewrite' => [
- 'description' => '此知识库是否开启了<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>。可能值:'."\n"
- .'- true:已开启。'."\n"
- .'- false:未开启。',
- 'type' => 'boolean',
- 'example' => 'false',
+ 'enumValueTitles' => ['qwen-vl-max' => 'qwen-vl-max', 'qwen-vl-plus' => 'qwen-vl-plus'],
+ 'example' => 'qwen-vl-max',
],
+ 'ModelPrompt' => ['description' => '调用Qwen VL解析时的Prompt。', 'type' => 'string', 'example' => '#角色'."\n"
+ .'你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。'."\n"
+ .'# 任务目标'."\n"
+ .'请结合输入图片,详细描述图片中的内容。'],
],
],
+ 'Parser' => ['description' => '解析该类目下当前类型文件使用的解析器。可能值为:'."\n"
+ .'- DOCMIND:智能文档解析'."\n"
+ .'- DOCMIND_DIGITAL:电子文档解析'."\n"
+ .'- DOCMIND_LLM_VERSION:大模型文档解析'."\n"
+ .'- DASH_QWEN_VL_PARSER:Qwen VL解析', 'type' => 'string', 'example' => 'DOCMIND'],
],
],
],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功 。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'True'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'workspace id is null or invalid.'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Data\\": {\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10,\\n \\"TotalCount\\": 48,\\n \\"Indices\\": [\\n {\\n \\"Id\\": \\"lecxr5xxxx\\",\\n \\"Name\\": \\"XXXX产品清单\\",\\n \\"Description\\": \\"清单中产品主要面向海外客户。\\",\\n \\"StructureType\\": \\"UNSTRUCTURED\\",\\n \\"ChunkSize\\": 5,\\n \\"OverlapSize\\": 10,\\n \\"Separator\\": \\"\\\\\\\\n\\",\\n \\"EmbeddingModelName\\": \\"text-embedding-v2\\",\\n \\"RerankModelName\\": \\"gte-rerank-hybrid\\",\\n \\"RerankMinScore\\": \\"0.01\\",\\n \\"SourceType\\": \\"DATA_CENTER_FILE\\",\\n \\"DocumentIds\\": [\\n \\"file_8c67b438043848199ffaa903d29addd4_xxxxxxxx\\"\\n ],\\n \\"SinkType\\": \\"BUILT_IN\\",\\n \\"SinkInstanceId\\": \\"gp-bp1gq62t1788yxxxx\\",\\n \\"SinkRegion\\": \\"cn-hangzhou\\",\\n \\"ConfgModel\\": \\"recommend\\",\\n \\"EnableRewrite\\": false\\n }\\n ]\\n },\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
- 'title' => '查询知识库列表',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndex权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '获取类目解析设置',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(`AliyunBailianDataFullAccess`或`AliyunBailianDataReadOnlyAccess`均可,已包括sfm:GetParseSettings权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ ."\n"
.'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'DeleteIndex' => [
- 'summary' => '永久性删除指定的知识库。',
- 'path' => '/{WorkspaceId}/index/delete',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetParseSettings',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Data\\": [\\n {\\n \\"FileType\\": \\"pdf\\",\\n \\"ParserDisplayName\\": \\"电子文档解析\\",\\n \\"ParserConfig\\": {\\n \\"ModelName\\": \\"qwen-vl-max\\",\\n \\"ModelPrompt\\": \\"#角色\\\\n你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。\\\\n# 任务目标\\\\n请结合输入图片,详细描述图片中的内容。\\"\\n },\\n \\"Parser\\": \\"DOCMIND\\"\\n }\\n ],\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"Code\\": \\"success\\"\\n}","type":"json"}]',
+ ],
+ 'GetPromptTemplate' => [
+ 'summary' => '基于模板Id获取Prompt模板。',
+ 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'IndexId',
- 'in' => 'query',
+ 'name' => 'workspaceId',
+ 'in' => 'path',
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdxxx'],
+ ],
+ [
+ 'name' => 'promptTemplateId',
+ 'in' => 'path',
+ 'schema' => ['title' => '模板Id', 'description' => '模板Id', 'type' => 'string', 'required' => true, 'example' => '6e49109bfeb94a39bb268f4e483ccxxx'],
+ ],
+ ],
+ 'responses' => [
+ 200 => [
'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'f89ie0xxxx',
+ 'title' => 'Schema of Response',
+ 'description' => 'Schema of Response',
+ 'type' => 'object',
+ 'properties' => [
+ 'content' => ['title' => '模板内容', 'description' => '模板内容', 'type' => 'string', 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}'],
+ 'name' => ['title' => '模板名称', 'description' => '模板名称', 'type' => 'string', 'example' => '小红书文案助手'],
+ 'promptTemplateId' => ['title' => '模板Id', 'description' => '模板Id', 'type' => 'string', 'example' => '6e49109bfeb94a39bb268f4e483ccxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'],
+ 'workspaceId' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'example' => 'llm-us9hjmt32nysdxxx'],
+ 'variables' => [
+ 'title' => '模板变量',
+ 'description' => '模板变量列表',
+ 'type' => 'array',
+ 'items' => ['description' => '模板变量', 'type' => 'string', 'example' => 'theme'],
+ 'example' => '["theme"]',
+ ],
+ ],
],
],
+ ],
+ 'errorCodes' => [
+ 404 => [
+ ['errorCode' => 'PromptTemplate.TemplateNotFound', 'errorMessage' => 'Prompt template not found.', 'description' => '未找到Prompt模板'],
+ ],
+ 500 => [
+ ['errorCode' => 'PromptTemplate.InternalError', 'errorMessage' => 'Prompt template service inner exception.', 'description' => 'prompt模板服务内部异常'],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"content\\": \\"请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}\\",\\n \\"name\\": \\"小红书文案助手\\",\\n \\"promptTemplateId\\": \\"6e49109bfeb94a39bb268f4e483ccxxx\\",\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\",\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdxxx\\",\\n \\"variables\\": [\\n \\"theme\\"\\n ]\\n}","type":"json"}]',
+ 'title' => '获取Prompt模板',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetPromptTemplate'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetPromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'ListCategory' => [
+ 'summary' => '获取指定业务空间下一个或多个类目的详细信息。',
+ 'path' => '/{WorkspaceId}/datacenter/categories',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
+ 'security' => [
+ [
+ 'AK' => [],
+ ],
+ ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
+ 'deprecated' => false,
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
+ 'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
+ 'schema' => ['description' => '业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
+ ],
+ [
+ 'name' => 'ConnectorId',
+ 'in' => 'formData',
+ 'schema' => ['title' => '连接器Id', 'description' => '连接器Id', 'type' => 'string', 'required' => false, 'example' => 'file_conn_xxxxx'],
+ ],
+ [
+ 'name' => 'CategoryType',
+ 'in' => 'formData',
'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
+ 'description' => '要查询的类目类型。取值范围:'."\n"
+ .'- UNSTRUCTURED:类目。'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'> 暂不支持通过API查询表格(数据表)。'."\n"
+ .'>'."\n"
+ ."\n"
+ .'</props>'."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 暂不支持通过API查询结构化数据表。'."\n"
+ .'>'."\n"
+ ."\n\n"
+ .'</props>',
'type' => 'string',
'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
+ 'example' => 'UNSTRUCTURED',
+ 'enum' => ['UNSTRUCTURED'],
],
],
+ [
+ 'name' => 'ParentCategoryId',
+ 'in' => 'formData',
+ 'schema' => ['description' => '要查询类目的父类目 ID。', 'type' => 'string', 'required' => false, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
+ ],
+ [
+ 'name' => 'NextToken',
+ 'in' => 'formData',
+ 'schema' => ['description' => '查询凭证(Token),取值为上一次 API 调用返回的NextToken参数值。', 'type' => 'string', 'required' => false, 'example' => 'AAAAAdH70eOCSCKtacdomNzak4U='],
+ ],
+ [
+ 'name' => 'MaxResults',
+ 'in' => 'formData',
+ 'schema' => ['description' => '分页查询时每页类目数量。最大值为 200。取值范围[1-200]'."\n"
+ ."\n"
+ .'默认值:'."\n"
+ .'当不设置值或设置的值小于 1 时,默认值为20。当设置的值大于 200 时,默认值为 200。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '500', 'minimum' => '0', 'example' => '20'],
+ ],
+ [
+ 'name' => 'CategoryName',
+ 'in' => 'formData',
+ 'schema' => ['description' => '即根据类目名称对接口返回的类目列表进行精确匹配/过滤。默认值为空,即不启用类目名称过滤。', 'type' => 'string', 'required' => false, 'example' => '产品清单'],
+ ],
],
'responses' => [
200 => [
@@ -5907,90 +4421,102 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- .'- true:成功'."\n"
- .'- false:失败',
- 'type' => 'boolean',
- 'example' => 'true',
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
+ 'Data' => [
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'CategoryList' => [
+ 'description' => '类目列表。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '类目对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'CategoryId' => ['description' => '类目 ID。', 'type' => 'string', 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
+ 'CategoryName' => ['description' => '类目名称。', 'type' => 'string', 'example' => '类目1'],
+ 'CategoryType' => ['description' => '类目类型,可能值为:'."\n"
+ .'- UNSTRUCTURED:类目。', 'type' => 'string', 'example' => 'UNSTRUCTURED'],
+ 'IsDefault' => ['description' => '是否为默认类目。可能值为:'."\n"
+ .'- true:是。'."\n"
+ .'- false:否。'."\n"
+ ."\n"
+ .'默认类目不允许删除。', 'type' => 'boolean', 'example' => 'true'],
+ 'ParentCategoryId' => ['description' => '父类目的类目 ID。', 'type' => 'string', 'example' => 'cate_addd11b1b79a74e8bbd675c356a91ee3xxxxxxxx'],
+ ],
+ ],
+ ],
+ 'HasNext' => ['description' => '符合查询条件的类目数据是否存在下一页,可能值为:'."\n"
+ ."\n"
+ .'- true:是。'."\n"
+ .'- false:否。', 'type' => 'boolean', 'example' => 'true'],
+ 'MaxResults' => ['description' => '分页查询时每页类目数量。', 'type' => 'integer', 'format' => 'int32', 'example' => '20'],
+ 'NextToken' => ['description' => '本次调用返回的查询凭证值。', 'type' => 'string', 'example' => 'AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ'],
+ 'TotalCount' => ['description' => '返回结果的总类目数量。', 'type' => 'integer', 'format' => 'int32', 'example' => '20'],
+ ],
],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'workspace id is null or invalid.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '删除知识库',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:DeleteIndex权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
- .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
- .'- 如果知识库正在被应用调用,需要先解除关联后才可删除。此操作当前只能通过控制台完成。具体操作请参见[知识库](~~2807740~~)。'."\n"
- .'- 删除操作不可逆,被删知识库将无法恢复,请谨慎操作。'."\n"
- .'- 调用本接口不会删除<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中已导入的文件。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"CategoryList\\": [\\n {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\",\\n \\"CategoryName\\": \\"类目1\\",\\n \\"CategoryType\\": \\"UNSTRUCTURED\\",\\n \\"IsDefault\\": true,\\n \\"ParentCategoryId\\": \\"cate_addd11b1b79a74e8bbd675c356a91ee3xxxxxxxx\\"\\n }\\n ],\\n \\"HasNext\\": true,\\n \\"MaxResults\\": 20,\\n \\"NextToken\\": \\"AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ\\",\\n \\"TotalCount\\": 20\\n },\\n \\"Message\\": \\"workspace id is null or invalid.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '类目列表',
+ 'description' => '- 暂不支持通过API查询数据表。'."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListCategory权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
.'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ .'注意本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2025-05-23T08:26:21.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListCategory'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'ListChunks' => [
'summary' => '查看文本切片列表及信息。',
'path' => '/{WorkspaceId}/index/list_chunks',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vxxxx',
- ],
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
'name' => 'body',
@@ -6005,69 +4531,36 @@
."\n"
.'默认值为空。',
'type' => 'array',
- 'items' => [
- 'description' => '字段名。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'name',
- ],
- 'required' => false,
- ],
- 'Filed' => [
- 'description' => '本字段为阿里云百炼旧版SDK中的文件ID字段。具体用法和默认值与`FileId`字段完全一致。如果您使用的阿里云百炼SDK是以下版本(或更新版本),推荐改用 `FileId` 字段指定文件 ID。如果您使用的是SWIFT语言的阿里云百炼SDK,请继续使用本字段。'."\n"
- ."\n"
- .'- Java(异步):1.0.18'."\n"
- .'- Java:1.10.2'."\n"
- .'- TypeScript:1.10.2'."\n"
- .'- Go:1.10.2'."\n"
- .'- PHP:1.10.2'."\n"
- .'- Python:1.10.2'."\n"
- .'- C#:1.10.2'."\n"
- .'- C++:1.10.17'."\n"
- ."\n"
- .'> **如何查看阿里云百炼SDK版本**:访问<props="china">[阿里云百炼SDK中心](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK中心](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>,单击左侧导航栏中的“**安装**”,API版本选择“**2023-12-29**”,然后选择您的开发语言,再单击“**历史版本**”即可查看。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx',
- ],
- 'FileId' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'文件 ID,即 **AddFile** 接口返回的`FileId`。数据查询/图片问答类知识库不用传入此字段;文档搜索/音视频搜索类知识库必须传入此字段。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击文件名称旁的 ID 图标获取。可以通过文件 ID 筛选返回的切片。默认值为空。'."\n"
- ."\n\n"
- .'</props>'."\n"
- ."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'文件 ID,即 **AddFile** 接口返回的`FileId`。数据查询/图片问答类知识库不用传入此字段;文档搜索类知识库必须传入此字段。您也可以在'."\n"
- .'[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击文件名称旁的 ID 图标获取。可以通过文件 ID 筛选返回的切片。默认值为空。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx',
- ],
- 'IndexId' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'otoru9xxxx',
- ],
- 'PageNum' => [
- 'description' => '指定要查询的页码。起始值为 1,默认值为 1。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '1',
- ],
- 'PageSize' => [
- 'title' => '',
- 'description' => '指定分页查询时每页展示的文本切片数量。最大为100。默认值为10。',
- 'type' => 'integer',
- 'format' => 'int32',
+ 'items' => ['description' => '字段名。', 'type' => 'string', 'required' => false, 'example' => 'name'],
'required' => false,
- 'example' => '10',
],
+ 'Filed' => ['description' => '本字段为阿里云百炼旧版SDK中的文件ID字段。具体用法和默认值与`FileId`字段完全一致。如果您使用的阿里云百炼SDK是以下版本(或更新版本),推荐改用 `FileId` 字段指定文件 ID。如果您使用的是SWIFT语言的阿里云百炼SDK,请继续使用本字段。'."\n"
+ ."\n"
+ .'- Java(异步):1.0.18'."\n"
+ .'- Java:1.10.2'."\n"
+ .'- TypeScript:1.10.2'."\n"
+ .'- Go:1.10.2'."\n"
+ .'- PHP:1.10.2'."\n"
+ .'- Python:1.10.2'."\n"
+ .'- C#:1.10.2'."\n"
+ .'- C++:1.10.17'."\n"
+ ."\n"
+ .'> **如何查看阿里云百炼SDK版本**:访问<props="china">[阿里云百炼SDK中心](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK中心](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>,单击左侧导航栏中的“**安装**”,API版本选择“**2023-12-29**”,然后选择您的开发语言,再单击“**历史版本**”即可查看。', 'type' => 'string', 'required' => false, 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx'],
+ 'FileId' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'文件 ID,即 **AddFile** 接口返回的`FileId`。数据查询/图片问答类知识库不用传入此字段;文档搜索/音视频搜索类知识库必须传入此字段。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击文件名称旁的 ID 图标获取。可以通过文件 ID 筛选返回的切片。默认值为空。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'文件 ID,即 **AddFile** 接口返回的`FileId`。数据查询/图片问答类知识库不用传入此字段;文档搜索类知识库必须传入此字段。您也可以在'."\n"
+ .'[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击文件名称旁的 ID 图标获取。可以通过文件 ID 筛选返回的切片。默认值为空。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => 'file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx'],
+ 'IndexId' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => 'otoru9xxxx'],
+ 'PageNum' => ['description' => '指定要查询的页码。起始值为 1,默认值为 1。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'],
+ 'PageSize' => ['title' => '', 'description' => '指定分页查询时每页展示的文本切片数量。最大为100。默认值为10。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
],
'required' => false,
],
@@ -6078,11 +4571,7 @@
'schema' => [
'type' => 'object',
'properties' => [
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'Index.InvalidParameter',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
'Data' => [
'description' => '接口返回的业务字段。',
'type' => 'object',
@@ -6094,101 +4583,65 @@
'description' => '文本切片对象。',
'type' => 'object',
'properties' => [
- 'Metadata' => [
- 'description' => '<props="china">'."\n"
- ."\n"
- .'文本切片的元数据Map。'."\n"
- ."\n"
- .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
- ."\n"
- .'> 检索文档搜索类识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'> 检索音视频搜索类知识库时,若切片包含音频,将通过元数据 Map 中` audio_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'> 检索音视频搜索类知识库时,若切片包含视频,将通过元数据 Map 中` video_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'</props>'."\n"
- .'<props="intl">'."\n"
- ."\n"
- .'文本切片的元数据Map。'."\n"
- ."\n"
- .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
- ."\n"
- .'> 检索文档搜索类知识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
- ."\n"
- .'</props>',
- 'type' => 'any',
- 'example' => '{'."\n"
- .' "file_path": "https://bailian-***",'."\n"
- .' "parent": "阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。",'."\n"
- .' "is_displayed_chunk_content": "true",'."\n"
- .' "image_url": [],'."\n"
- .' "nid": "83***",'."\n"
- .' "source": "0",'."\n"
- .' "_score": 0,'."\n"
- .' "title": "",'."\n"
- .' "doc_id": "file_24e***",'."\n"
- .' "content": "阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。",'."\n"
- .' "_rc_score": 0,'."\n"
- .' "workspace_id": "llm-zna***",'."\n"
- .' "hier_title": "",'."\n"
- .' "doc_name": "什么是阿里云百炼",'."\n"
- .' "pipeline_id": "j6b***",'."\n"
- .' "_id": "llm-zna5***"'."\n"
- .'}',
- ],
- 'Score' => [
- 'description' => '文本切片的相似度得分。',
- 'type' => 'number',
- 'format' => 'double',
- 'example' => '0',
- ],
- 'Text' => [
- 'description' => '文本切片内容。',
- 'type' => 'string',
- 'example' => '阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。',
- ],
+ 'Metadata' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'文本切片的元数据Map。'."\n"
+ ."\n"
+ .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
+ ."\n"
+ .'> 检索文档搜索类识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'> 检索音视频搜索类知识库时,若切片包含音频,将通过元数据 Map 中` audio_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'> 检索音视频搜索类知识库时,若切片包含视频,将通过元数据 Map 中` video_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'文本切片的元数据Map。'."\n"
+ ."\n"
+ .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
+ ."\n"
+ .'> 检索文档搜索类知识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'any', 'example' => '{'."\n"
+ .' "file_path": "https://bailian-***",'."\n"
+ .' "parent": "阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。",'."\n"
+ .' "is_displayed_chunk_content": "true",'."\n"
+ .' "image_url": [],'."\n"
+ .' "nid": "83***",'."\n"
+ .' "source": "0",'."\n"
+ .' "_score": 0,'."\n"
+ .' "title": "",'."\n"
+ .' "doc_id": "file_24e***",'."\n"
+ .' "content": "阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。",'."\n"
+ .' "_rc_score": 0,'."\n"
+ .' "workspace_id": "llm-zna***",'."\n"
+ .' "hier_title": "",'."\n"
+ .' "doc_name": "什么是阿里云百炼",'."\n"
+ .' "pipeline_id": "j6b***",'."\n"
+ .' "_id": "llm-zna5***"'."\n"
+ .'}'],
+ 'Score' => ['description' => '文本切片的相似度得分。', 'type' => 'number', 'format' => 'double', 'example' => '0'],
+ 'Text' => ['description' => '文本切片内容。', 'type' => 'string', 'example' => '阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。'],
],
],
],
- 'Total' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '1',
- ],
+ 'Total' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int64', 'example' => '1'],
],
],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.',
- ],
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
+ 'description' => '',
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"Nodes\\": [\\n {\\n \\"Metadata\\": \\"{\\\\n \\\\\\"file_path\\\\\\": \\\\\\"https://bailian-***\\\\\\",\\\\n \\\\\\"parent\\\\\\": \\\\\\"阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。\\\\\\",\\\\n \\\\\\"is_displayed_chunk_content\\\\\\": \\\\\\"true\\\\\\",\\\\n \\\\\\"image_url\\\\\\": [],\\\\n \\\\\\"nid\\\\\\": \\\\\\"83***\\\\\\",\\\\n \\\\\\"source\\\\\\": \\\\\\"0\\\\\\",\\\\n \\\\\\"_score\\\\\\": 0,\\\\n \\\\\\"title\\\\\\": \\\\\\"\\\\\\",\\\\n \\\\\\"doc_id\\\\\\": \\\\\\"file_24e***\\\\\\",\\\\n \\\\\\"content\\\\\\": \\\\\\"阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。\\\\\\",\\\\n \\\\\\"_rc_score\\\\\\": 0,\\\\n \\\\\\"workspace_id\\\\\\": \\\\\\"llm-zna***\\\\\\",\\\\n \\\\\\"hier_title\\\\\\": \\\\\\"\\\\\\",\\\\n \\\\\\"doc_name\\\\\\": \\\\\\"什么是阿里云百炼\\\\\\",\\\\n \\\\\\"pipeline_id\\\\\\": \\\\\\"j6b***\\\\\\",\\\\n \\\\\\"_id\\\\\\": \\\\\\"llm-zna5***\\\\\\"\\\\n}\\",\\n \\"Score\\": 0,\\n \\"Text\\": \\"阿里云百炼是一站式的大模型开发及应用构建平台。不论是开发者还是业务人员,都能深入参与大模型应用的设计和构建。您可以通过简单的界面操作,在 5分钟内开发出一款大模型应用,或在几小时内训练出一个专属模型,从而将更多精力专注于应用创新。\\"\\n }\\n ],\\n \\"Total\\": 1\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
'title' => '查询索引下的分片列表',
'description' => '- 对于文档搜索<props="china">或音视频搜索</props>类知识库,本接口可查询指定文件的所有切片内容;而对于数据查询或图片问答类知识库,则可获取全部文本切片的信息。'."\n"
@@ -6198,108 +4651,92 @@
."\n"
.'**限流说明:**'."\n"
.'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'UpdateChunk' => [
- 'summary' => '修改知识库中指定文本切片的内容(content)和标题(title),并设置是否参与知识库检索。',
- 'path' => '/{WorkspaceId}/chunk/update',
- 'methods' => [
- 'post',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListChunks'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ChunkList',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListFile' => [
+ 'summary' => '获取指定类目下一个或多个文档的详细信息。',
+ 'path' => '/{WorkspaceId}/datacenter/files',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'PipelineId',
- 'in' => 'query',
- 'schema' => [
- 'description' => '知识库 ID,即通过 **CreateIndex** 接口创建时返回的`Data.Id`,或在<props="china">[知识库](https://bailian.console.aliyun.com/?tab=app#/knowledge-base)</props><props="intl">[知识库](https://modelstudio.console.alibabacloud.com/?tab=app#/knowledge-base)</props>页面获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx'."\n",
- ],
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '类目所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
],
[
- 'name' => 'DataId',
+ 'name' => 'CategoryId',
'in' => 'query',
- 'schema' => [
- 'description' => '文件 ID,即 **AddFile** 接口返回的`FileId`,也可在阿里云百炼控制台的<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件</props>页签,单击对应文件旁的 ID 图标获取。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx'."\n",
- ],
+ 'schema' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => true, 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
],
[
- 'name' => 'ChunkId',
+ 'name' => 'NextToken',
'in' => 'query',
- 'schema' => [
- 'description' => '需要修改的文本切片ID,可通过 **ListChunks** 接口获取,其值位于返回结果中Node.Metadata._id字段。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0',
- ],
+ 'schema' => ['description' => '查询凭证(Token),取值为上一次 API 调用返回的NextToken参数值。', 'type' => 'string', 'required' => false, 'example' => 'AAAAAdH70eOCSCKtacdomNzak4U='],
],
[
- 'name' => 'IsDisplayedChunkContent',
+ 'name' => 'MaxResults',
'in' => 'query',
- 'schema' => [
- 'description' => '指定此文本切片是否参与知识库检索。可能值:'."\n"
- ."\n"
- .'- true:参与。'."\n"
- .'- false:不参与。'."\n"
- ."\n"
- .'默认值为true。',
- 'type' => 'boolean',
- 'required' => true,
- 'example' => 'true',
- ],
+ 'schema' => ['description' => '分页查询时每页行数。取值范围[1-200]。'."\n"
+ ."\n"
+ .'默认值:'."\n"
+ .'当不设置值或设置的值小于 1 时,默认值为20。当设置的值大于 200 时,默认值为 200。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '20'],
],
[
- 'name' => 'content',
+ 'name' => 'FileName',
'in' => 'query',
- 'schema' => [
- 'description' => '文本切片的新内容。内容长度必须在10到6000个字符之间,且不能超过创建知识库时设定的最大分段长度。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '在哲学中所获得的确定性类型不是科学的确定性(即对每个人的理智来说都一样的确定性),而是一种要在人类的整体本质中才能获得的亲证。哲学的每一形态都不同于科学,因为所有的哲学都没有得到一致的认可...',
- ],
+ 'schema' => ['description' => '文件名称(不含后缀),仅支持按照文件名精准查找,不支持模糊搜索。', 'type' => 'string', 'required' => false, 'example' => 'product-overview'],
],
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx'."\n",
- ],
- ],
- [
- 'name' => 'title',
+ 'name' => 'FileIds',
'in' => 'query',
+ 'style' => 'json',
'schema' => [
- 'description' => '文本切片的新标题。长度限制为0-50个字符,允许传入空字符串。如果传入空字符串,将清空已有标题;如果不传此参数,则保持原标题不变。',
- 'type' => 'string',
+ 'title' => '需要查询的文件id列表,单次查询最多支持20个文件',
+ 'description' => '需要查询的文件id列表,单次查询最多支持20个文件',
+ 'type' => 'array',
+ 'items' => ['title' => '文件id', 'description' => '文件id', 'type' => 'string', 'required' => false, 'example' => 'file_xxxx'],
'required' => false,
- 'example' => '什么是哲学',
+ 'maxItems' => 20,
+ 'minItems' => 0,
],
],
],
@@ -6310,121 +4747,166 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833',
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'success'],
'Data' => [
- 'description' => '请求成功返回的业务数据。',
- 'type' => 'boolean',
- 'example' => 'true',
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '"200"',
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'FileList' => [
+ 'description' => '类目下的文件列表。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '文件对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'CategoryId' => ['description' => '文件所属类目ID。', 'type' => 'string', 'example' => 'cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx'],
+ 'CreateTime' => ['description' => '文件实际添加到阿里云百炼中的时间戳,格式: yyyy-MM-dd HH:mm:ss,时区:UTC + 8。', 'type' => 'string', 'example' => '2024-09-09 11:03:35'],
+ 'FileId' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的图标获取。', 'type' => 'string', 'example' => 'file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx'],
+ 'FileName' => ['description' => '文件名称。', 'type' => 'string', 'example' => 'product-overview.pdf'],
+ 'FileType' => ['description' => '文件格式类型。可能值为:pdf、docx、doc、txt、md、pptx、ppt、xlsx、xls、html、png、jpg、jpeg、bmp、gif。', 'type' => 'string', 'example' => 'docx'],
+ 'Parser' => ['description' => '文档解析器。可能值为:'."\n"
+ .'- DASHSCOPE_DOCMIND:阿里云文档智能解析。', 'type' => 'string', 'example' => 'DASHSCOPE_DOCMIND'],
+ 'SizeInBytes' => ['description' => '文件大小,单位字节。', 'type' => 'integer', 'format' => 'int64', 'example' => '512'],
+ 'Status' => ['description' => '文件解析状态,可能值为:'."\n"
+ .'- INIT: 初始化状态,等待调度中。'."\n"
+ .'- PARSING: 解析中。'."\n"
+ .'- PARSE_SUCCESS:解析完成。'."\n"
+ .'- PARSE_FAILED:解析失败。', 'type' => 'string', 'example' => 'PARSE_SUCCESS'],
+ 'ParseErrorMessage' => ['title' => '解析失败原因', 'description' => '解析失败原因', 'type' => 'string', 'example' => 'Error Message'],
+ 'Tags' => [
+ 'description' => '文件关联的标签列表,一个文档支持关联多个标签。',
+ 'type' => 'array',
+ 'items' => ['description' => '文件的标签。', 'type' => 'string', 'example' => 'tag-A'],
+ ],
+ ],
+ ],
+ ],
+ 'HasNext' => ['description' => '符合查询条件的类目数据是否存在下一页,可能值为:'."\n"
+ .'- true:是。'."\n"
+ .'- false:否。', 'type' => 'boolean', 'example' => 'true'],
+ 'MaxResults' => ['description' => '分页查询时每页行数。', 'type' => 'integer', 'format' => 'int32', 'example' => '20'],
+ 'NextToken' => ['description' => '本次调用返回的查询凭证值。', 'type' => 'string', 'example' => '4jzbJk9J6lNeuXD9hP0viA=='],
+ 'TotalCount' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '48'],
+ ],
],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Requests throttling triggered.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。 '."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"\\",\\n \\"Message\\": \\"\\",\\n \\"Success\\": true,\\n \\"Data\\": true,\\n \\"Status\\": \\"\\\\\\"200\\\\\\"\\"\\n}","type":"json"}]',
- 'title' => '修改切片',
- 'description' => '- **关键限制**:本接口仅支持文档搜索类知识库,不支持数据查询和图片问答类知识库。'."\n"
- .'- **权限要求**:'."\n"
- .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:UpdateChunk权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
- .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
- .'- **调用方式**:推荐使用最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>调用,SDK已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
- .'- **生效延迟**:更新后通常立即生效,高峰期可能稍有延迟(秒级)。'."\n"
- .'- **幂等性**:本接口具有幂等性。对已成功更新的文本切片进行重复操作时,接口将返回成功响应。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"success\\",\\n \\"Data\\": {\\n \\"FileList\\": [\\n {\\n \\"CategoryId\\": \\"cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx\\",\\n \\"CreateTime\\": \\"2024-09-09 11:03:35\\",\\n \\"FileId\\": \\"file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx\\",\\n \\"FileName\\": \\"product-overview.pdf\\",\\n \\"FileType\\": \\"docx\\",\\n \\"Parser\\": \\"DASHSCOPE_DOCMIND\\",\\n \\"SizeInBytes\\": 512,\\n \\"Status\\": \\"PARSE_SUCCESS\\",\\n \\"ParseErrorMessage\\": \\"Error Message\\",\\n \\"Tags\\": [\\n \\"tag-A\\"\\n ]\\n }\\n ],\\n \\"HasNext\\": true,\\n \\"MaxResults\\": 20,\\n \\"NextToken\\": \\"4jzbJk9J6lNeuXD9hP0viA==\\",\\n \\"TotalCount\\": 48\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '文件列表',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListFile权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
+ ."\n"
+ .'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'DeleteChunk' => [
- 'summary' => '删除知识库中的指定文本切片,被删的文本切片将无法被检索和召回。',
- 'path' => '/{WorkspaceId}/chunk/delete',
- 'methods' => [
- 'post',
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2024-10-15T01:42:54.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-09-18T08:46:20.000Z', 'description' => '响应参数发生变更'],
],
- 'schemes' => [
- 'https',
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListFile'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListIndexDocuments' => [
+ 'summary' => '获取指定知识库中的文件,以及它们的概要信息。',
+ 'path' => '/{WorkspaceId}/index/list_index_documents',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'readAndWrite',
+ 'consumes' => ['application/x-www-form-urlencoded'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'PipelineId',
+ 'name' => 'IndexId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
+ ],
+ [
+ 'name' => 'DocumentStatus',
'in' => 'query',
'schema' => [
- 'description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。',
+ 'description' => '即通过文件导入状态对接口返回的文件列表进行过滤。取值范围:'."\n"
+ .'- INSERT_ERROR:导入索引失败。'."\n"
+ .'- RUNNING:索引构建中。'."\n"
+ .'- DELETED:已经删除。'."\n"
+ .'- FINISH:索引构建成功。'."\n"
+ .'- PARSE_FAILED:解析失败'."\n"
+ .'- DOC_PARSING:解析中'."\n"
+ ."\n"
+ .'默认值为空,即不使用文件导入状态对结果进行过滤。',
'type' => 'string',
- 'required' => true,
- 'example' => '79c0alxxxx',
+ 'required' => false,
+ 'enumValueTitles' => [],
+ 'example' => 'FINISH',
],
],
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
+ 'name' => 'DocumentName',
+ 'in' => 'query',
+ 'schema' => ['description' => '即通过文件名称(不含后缀)对接口返回的文件列表进行过滤。默认值为空,即不使用文件名称对结果进行过滤。', 'type' => 'string', 'required' => false, 'example' => 'product-overview'],
+ ],
+ [
+ 'name' => 'EnableNameLike',
+ 'in' => 'query',
'schema' => [
- 'description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
+ 'description' => '是否开启文件名称的模糊匹配,与`DocumentName`参数配合使用。取值范围:'."\n"
+ .'- true:根据文件名称对接口返回的文件列表进行模糊匹配。'."\n"
+ .'- false:默认根据文件名称进行精确匹配。'."\n"
+ ."\n"
+ .'默认值为false。',
'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
+ 'required' => false,
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
+ 'example' => 'false',
],
],
[
- 'name' => 'ChunkIds',
+ 'name' => 'PageNumber',
'in' => 'query',
- 'style' => 'json',
- 'schema' => [
- 'description' => '需要删除的文本切片列表(单次最多传入10个文本切片ID)。',
- 'type' => 'array',
- 'items' => [
- 'description' => '文本切片ID,即 **ListChunks** 接口返回的Node对象里`Metadata`中的`_id`字段。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0',
- ],
- 'required' => true,
- ],
+ 'schema' => ['description' => '指定要查询的页码。起始值为1。默认值为1。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'],
+ ],
+ [
+ 'name' => 'PageSize',
+ 'in' => 'query',
+ 'schema' => ['description' => '指定分页查询时每页展示的文件数量。最大值不限。'."\n"
+ .'默认值为10。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
],
'responses' => [
@@ -6434,132 +4916,176 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'."\n",
- ],
- 'Code' => [
- 'description' => '错误状态码。',
- 'type' => 'string',
- ],
- 'Message' => [
- 'description' => '错误信息。',
- 'type' => 'string',
- ],
- 'Success' => [
- 'description' => '接口调用是否成功,可能值:'."\n"
- ."\n"
- .'- true:成功。'."\n"
- .'- false:失败。',
- 'type' => 'boolean',
- 'example' => 'true'."\n",
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'InvalidParameter'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
'Data' => [
- 'description' => '请求成功返回的业务数据。',
- 'type' => 'boolean',
- 'example' => 'true'."\n",
- ],
- 'Status' => [
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200'."\n",
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Documents' => [
+ 'description' => '返回知识库中的文件列表,按文档导入时间倒序排序(与控制台一致)。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '文件对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'SourceId' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'对于文档搜索/音视频搜索类知识库,该参数指的是类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n\n"
+ .'对于数据查询/图片问答类知识库,该参数指的是数据表 ID。您可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-表格页签,单击数据表名称旁的 ID 图标获取。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'对于文档搜索类知识库,该参数指的是类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件页签,单击类目名称旁的 ID 图标获取。'."\n"
+ ."\n\n"
+ .'对于数据查询/图片问答类知识库,该参数指的是数据表 ID。您可以在[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-表格页签,单击数据表名称旁的 ID 图标获取。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx'],
+ 'Id' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx'],
+ 'Name' => ['description' => '文件名称。', 'type' => 'string', 'example' => 'product-overview'],
+ 'Size' => ['description' => '文件大小,单位字节Byte。', 'type' => 'integer', 'format' => 'int32', 'example' => '996765'],
+ 'DocumentType' => ['description' => '文件格式类型。可能值为: pdf、docx、doc、txt、md、pptx、ppt、png、jpg、jpeg、bmp、gif、EXCEL。', 'type' => 'string', 'example' => 'pdf'],
+ 'Status' => [
+ 'description' => '文件导入状态。可能值为:'."\n"
+ .'- INSERT_ERROR:文件导入失败。'."\n"
+ .'- RUNNING:文件导入中。'."\n"
+ .'- DELETED:文件已删除。'."\n"
+ .'- FINISH:文件导入成功。',
+ 'type' => 'string',
+ 'enumValueTitles' => ['INSERT_ERROR' => '文件导入失败', 'RUNNING' => '文件导入中', 'DELETED' => '文件已删除', 'FINISH' => '文件导入成功'],
+ 'example' => 'RUNNING',
+ ],
+ 'Code' => ['description' => '文件导入错误状态码。', 'type' => 'string', 'example' => '110002'],
+ 'Message' => ['description' => '文件导入错误信息。', 'type' => 'string', 'example' => 'check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid'],
+ 'GmtModified' => ['description' => '文件导入知识库的时间,采用Unix timestamp格式。', 'type' => 'integer', 'format' => 'int64', 'example' => '1744856423000'],
+ ],
+ ],
+ ],
+ 'IndexId' => ['description' => '知识库 ID。', 'type' => 'string', 'example' => 'pno97txxxx'],
+ 'TotalCount' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int64', 'example' => '2437'],
+ 'PageNumber' => ['description' => '返回指定的页码。', 'type' => 'integer', 'format' => 'int32', 'example' => '1'],
+ 'PageSize' => ['description' => '返回指定的每页条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ ],
],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\\\n\\",\\n \\"Code\\": \\"\\",\\n \\"Message\\": \\"\\",\\n \\"Success\\": true,\\n \\"Data\\": true,\\n \\"Status\\": \\"200\\\\n\\"\\n}","type":"json"}]',
- 'title' => '删除切片',
- 'description' => '<warning> 文本切片被删除后无法恢复(硬删除),请谨慎操作。'."\n"
- .'- **权限要求**:'."\n"
- .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:DeleteChunk权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
- .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
- .'- **调用方式**:推荐使用最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>调用,SDK已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
- .'- **生效延迟**:更新后通常立即生效,高峰期可能稍有延迟(秒级)。'."\n"
- .'- **幂等性**:本接口具有幂等性。对已成功删除的文本切片进行重复操作时,接口将返回成功响应。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"SourceId\\": \\"cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\\",\\n \\"Id\\": \\"doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\\",\\n \\"Name\\": \\"product-overview\\",\\n \\"Size\\": 996765,\\n \\"DocumentType\\": \\"pdf\\",\\n \\"Status\\": \\"RUNNING\\",\\n \\"Code\\": \\"110002\\",\\n \\"Message\\": \\"check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid\\",\\n \\"GmtModified\\": 1744856423000\\n }\\n ],\\n \\"IndexId\\": \\"pno97txxxx\\",\\n \\"TotalCount\\": 2437,\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
+ 'title' => '查询知识库下的文件列表',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndexFiles权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ .'- 本接口具有幂等性。'."\n"
."\n"
.'**限流说明:**'."\n"
- .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
- ],
- 'GetIndexMonitor' => [
- 'summary' => '调用GetIndexMonitor接口,查询指定知识库在特定时间范围内的监控数据。这些数据对于性能分析、容量规划和成本管理至关重要。'."\n"
- ."\n"
- .'监控数据主要包含两大维度:'."\n"
- ."\n"
- .'存储监控:获取知识库的索引存储限额和当前使用量。'."\n"
- .'检索(QPS)监控:获取查询时间段内总的及按时间窗口细分的检索性能指标,包括QPS峰值、总请求数、平均QPS,并细分为成功、失败和被限流的请求。',
- 'path' => '/{WorkspaceId}/rag/index/monitor',
- 'methods' => [
- 'get',
+ .'本接口频繁调用会被限流,频率请勿超过15次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2025-06-04T01:43:41.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-03-25T06:25:53.000Z', 'description' => '响应参数发生变更'],
],
- 'schemes' => [
- 'https',
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '15', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListIndexDocuments'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndexFiles',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListIndexFileDetails' => [
+ 'summary' => '获取指定知识库中的文件,以及它们的详细信息。',
+ 'path' => '/{WorkspaceId}/index/list_index_file_detail',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'description' => '知识库所在工作空间ID',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3shx2gu255oqxxxx',
- ],
+ 'name' => 'IndexId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => false, 'example' => '79c0alxxxx'],
],
[
- 'name' => 'IndexId',
+ 'name' => 'DocumentStatus',
'in' => 'query',
'schema' => [
- 'description' => '目标知识库的唯一ID',
+ 'description' => '即通过文件导入状态对接口返回的文件列表进行过滤。取值范围:'."\n"
+ ."\n"
+ .'- INSERT_ERROR:导入索引失败。'."\n"
+ .'- RUNNING:索引构建中。'."\n"
+ .'- DELETED:已经删除。'."\n"
+ .'- FINISH:索引构建成功。'."\n"
+ .'- PARSE_FAILED:解析失败'."\n"
+ .'- DOC_PARSING:解析中'."\n"
+ ."\n"
+ .'默认值为空,即不使用文件导入状态对结果进行过滤。',
'type' => 'string',
- 'required' => true,
+ 'required' => false,
'enumValueTitles' => [],
- 'example' => 'kb-123456xxxx'."\n",
+ 'example' => 'FINISH',
],
],
[
- 'name' => 'StartTimestamp',
+ 'name' => 'DocumentName',
'in' => 'query',
- 'schema' => [
- 'description' => '查询起始时间,秒级Unix时间戳',
- 'type' => 'integer',
- 'format' => 'int64',
- 'required' => true,
- 'example' => '1767604500',
- ],
+ 'schema' => ['description' => '即通过文件名称对接口返回的文件详情列表进行过滤。默认值为空,即不使用文件名称对结果进行过滤。', 'type' => 'string', 'required' => false, 'example' => '翻译平台运维文档'],
],
[
- 'name' => 'EndTimestamp',
+ 'name' => 'PageNumber',
+ 'in' => 'query',
+ 'schema' => ['description' => '指定要查询的页码。起始值为 1。默认值为 1。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'],
+ ],
+ [
+ 'name' => 'PageSize',
+ 'in' => 'query',
+ 'schema' => ['description' => '指定分页查询时每页展示的文件数量 ,最大值10。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
+ ],
+ [
+ 'name' => 'EnableNameLike',
'in' => 'query',
'schema' => [
- 'description' => '查询结束时间,最大支持起始时间+30d,秒级Unix时间戳',
- 'type' => 'integer',
- 'format' => 'int64',
- 'required' => true,
- 'example' => '1767604500',
+ 'description' => '是否开启文件名称的模糊匹配,与`DocumentName`参数配合使用。取值范围:'."\n"
+ ."\n"
+ .'- true:根据文件名称对接口返回的文件列表进行模糊匹配。'."\n"
+ .'- false:默认根据文件名称进行精确匹配。'."\n"
+ ."\n"
+ .'默认值为 false。',
+ 'type' => 'string',
+ 'required' => false,
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
+ 'example' => 'false',
],
],
],
@@ -6570,170 +5096,130 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求 ID',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
- 'Code' => [
- 'description' => '状态码',
- 'type' => 'string',
- 'example' => '200',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'InvalidParameter'."\n"],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
'Data' => [
- 'description' => '响应的核心数据对象。'."\n"
- ."\n"
- .'**storageMonitorData**(Object): 知识库的存储监控数据。'."\n"
- ."\n\n"
- .' - indexStorageLimit(Number): 知识库的索引存储限额,单位为 GB。'."\n"
- ."\n"
- .'- indexStorageUsage(Number): 知识库当前已占用的索引存储额度,单位为 GB。'."\n"
- ."\n"
- .'**qpsMonitorData** (Object): 知识库在整个查询时间段内的检索(QPS)聚合监控数据。'."\n"
- ."\n"
- .'- peakQps(Integer): 整个时间段内的最高 QPS 峰值。'."\n"
- ."\n"
- .'- totalRequests(Integer): 整个时间段内的总请求次数。'."\n"
- ."\n"
- .'- avgQpsOfActiveSeconds(Number): 整个时间段内,所有活跃秒(即有调用的秒)的平均 QPS。'."\n"
- ."\n"
- .'- monitorData(Array): 按时间窗口划分的详细监控数据数组。数组中的每个对象代表一个时间窗口的统计信息。'."\n"
- ."\n\n"
- .' <details>'."\n"
- .' <summary>子属性</summary>'."\n"
- .' '."\n"
- .' - successData(Object):该窗口内请求成功的统计数据。'."\n"
- ."\n"
- .' - limitData(Object): 该窗口内被限流的统计数据。'."\n"
- ."\n"
- .' - failData(Object): 该窗口内调用失败的统计数据。'."\n"
- ."\n"
- .' - peakQpsInWindowRange(Integer): 该窗口内的总 QPS 峰值(成功+限流+失败)。'."\n"
- ."\n"
- .' - totalRequests(Integer): 该窗口内的总请求数(成功+限流+失败)。'."\n"
- ."\n"
- .' - windowRange(Integer): 时间窗口的开始时间(秒级 Unix 时间戳)。'."\n"
- ."\n"
- .' - windowRangeEnd(Integer): 时间窗口的结束时间(秒级 Unix 时间戳)。'."\n"
- ."\n"
- .' - avgQpsOfActiveSeconds(Number): 该窗口内活跃秒的平均 QPS。'."\n"
- ."\n"
- .' **successData, limitData, failData 这三个对象的内部结构完全相同,具体如下:**'."\n"
- ."\n"
- .' - peakQpsInWindowRange(Integer): 对应状态下的 QPS 峰值。'."\n"
- ."\n"
- .' - totalRequests(Integer): 对应状态下的总请求数。'."\n"
- ."\n"
- .' - avgQpsOfActiveSeconds(Number): 对应状态下活跃秒的平均 QPS。'."\n"
- ."\n"
- .' </details>',
- 'type' => 'any',
- 'example' => '{'."\n"
- .' "code": "Success",'."\n"
- .' "status_code": 200,'."\n"
- .' "data": {'."\n"
- .' "storageMonitorData": Object{...},'."\n"
- .' "qpsMonitorData": Object{...}'."\n"
- .' },'."\n"
- .' "success": true,'."\n"
- .' "message": "success",'."\n"
- .' "request_id": "65d34b79-b97e-478e-a0a3-xxx",'."\n"
- .' "status": "SUCCESS"'."\n"
- .'}',
- ],
- 'Message' => [
- 'description' => '状态信息',
- 'type' => 'string',
- 'example' => 'success',
- ],
- 'Success' => [
- 'description' => '请求是否成功',
- 'type' => 'boolean',
- 'example' => 'true'."\n",
- ],
- 'Status' => [
- 'description' => '接口返回的状态码',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => 'SUCCESS',
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Documents' => [
+ 'description' => '返回知识库中的文件列表,按文件导入时间倒序排序(与控制台一致)。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '文件对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Status' => ['description' => '文件导入状态。可能值为:'."\n"
+ ."\n"
+ .'- INSERT_ERROR:文件导入失败。'."\n"
+ .'- RUNNING:文件导入中。'."\n"
+ .'- DELETED:文件已删除。'."\n"
+ .'- FINISH:文件导入成功。', 'type' => 'string', 'example' => 'RUNNING'],
+ 'EnableHeaders' => ['description' => 'Excel文件表头是否支持拼装。', 'type' => 'string', 'example' => 'true'],
+ 'OverlapSize' => ['description' => '分段重叠长度。', 'type' => 'string', 'example' => '100'],
+ 'Message' => ['description' => '文件导入错误信息。', 'type' => 'string', 'example' => 'check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid'],
+ 'Size' => ['description' => '文件大小,单位字节Byte。', 'type' => 'integer', 'format' => 'int32', 'example' => '996764'."\n"],
+ 'SourceId' => ['description' => '类目 ID。', 'type' => 'string', 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx'."\n"],
+ 'GmtModified' => ['description' => '文件导入知识库的时间,采用 Unix timestamp 格式。', 'type' => 'integer', 'format' => 'int64', 'example' => '1744856423000'."\n"],
+ 'DocumentType' => ['description' => '文件格式类型。可能值为: pdf、docx、doc、txt、md、pptx、ppt、png、jpg、jpeg、bmp、gif、EXCEL。', 'type' => 'string', 'example' => 'pdf'],
+ 'ChunkMode' => ['description' => '自定义切分。', 'type' => 'string', 'example' => 'DashSplitter'],
+ 'Code' => ['description' => '文件导入错误状态码。', 'type' => 'string', 'example' => '110002'],
+ 'separator' => ['description' => '分句标识符。', 'type' => 'string', 'example' => '" "'],
+ 'Name' => ['description' => '文件名称。', 'type' => 'string', 'example' => '翻译平台运维文档'."\n"],
+ 'ChunkSize' => ['description' => '分段长度,即文本切片的字符数。', 'type' => 'string', 'example' => '600'],
+ 'Id' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx'."\n"],
+ ],
+ ],
+ ],
+ 'IndexId' => ['description' => '知识库 ID。', 'type' => 'string', 'example' => '79c0alxxxx'],
+ 'TotalCount' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int64', 'example' => '2437'],
+ 'PageNumber' => ['description' => '返回指定的页码。', 'type' => 'integer', 'format' => 'int32', 'example' => '1'],
+ 'PageSize' => ['description' => '返回指定的每页条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ ],
],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Code\\": \\"200\\",\\n \\"Data\\": \\"{\\\\n \\\\\\"code\\\\\\": \\\\\\"Success\\\\\\",\\\\n \\\\\\"status_code\\\\\\": 200,\\\\n \\\\\\"data\\\\\\": {\\\\n \\\\\\"storageMonitorData\\\\\\": Object{...},\\\\n \\\\\\"qpsMonitorData\\\\\\": Object{...}\\\\n },\\\\n \\\\\\"success\\\\\\": true,\\\\n \\\\\\"message\\\\\\": \\\\\\"success\\\\\\",\\\\n \\\\\\"request_id\\\\\\": \\\\\\"65d34b79-b97e-478e-a0a3-xxx\\\\\\",\\\\n \\\\\\"status\\\\\\": \\\\\\"SUCCESS\\\\\\"\\\\n}\\",\\n \\"Message\\": \\"success\\",\\n \\"Success\\": true,\\n \\"Status\\": 0\\n}","type":"json"}]',
- 'title' => '获取知识库监控数据',
- 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"InvalidParameter\\\\n\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"Documents\\": [\\n {\\n \\"Status\\": \\"RUNNING\\",\\n \\"EnableHeaders\\": \\"true\\",\\n \\"OverlapSize\\": \\"100\\",\\n \\"Message\\": \\"check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid\\",\\n \\"Size\\": 996764,\\n \\"SourceId\\": \\"cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\\\\n\\",\\n \\"GmtModified\\": 1744856423000,\\n \\"DocumentType\\": \\"pdf\\",\\n \\"ChunkMode\\": \\"DashSplitter\\",\\n \\"Code\\": \\"110002\\",\\n \\"separator\\": \\"\\\\\\" \\\\\\"\\",\\n \\"Name\\": \\"翻译平台运维文档\\\\n\\",\\n \\"ChunkSize\\": \\"600\\",\\n \\"Id\\": \\"doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\\\\n\\"\\n }\\n ],\\n \\"IndexId\\": \\"79c0alxxxx\\",\\n \\"TotalCount\\": 2437,\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10\\n },\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
+ 'title' => '查询知识库下的文件详情',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndexFiles权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
.'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'> - 查询时间范围(EndTimestamp - StartTimestamp)最大支持30天。'."\n"
- .'返回数据中的时间窗口粒度会根据您查询的时间范围动态调整。',
- ],
- 'CreatePromptTemplate' => [
- 'summary' => '创建Prompt模板。',
- 'path' => '/{workspaceId}/promptTemplates',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
+ .'- 本接口具有幂等性。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndexFileDetails',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListIndices' => [
+ 'summary' => '获取指定业务空间下知识库列表。',
+ 'path' => '/{WorkspaceId}/index/list_indices',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
'systemTags' => [
- 'operationType' => 'create',
+ 'operationType' => 'list',
'riskType' => 'none',
'chargeType' => 'free',
+ 'abilityTreeNodes' => ['FEATUREsfm4VA8MJ'],
],
'parameters' => [
[
- 'name' => 'workspaceId',
- 'in' => 'path',
+ 'name' => 'IndexName',
+ 'in' => 'query',
'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
+ 'description' => '知识库的名称。支持通过名称查找知识库。长度为 1~20 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。'."\n"
+ ."\n"
+ .'默认值为空,即查询指定业务空间下的所有知识库。',
'type' => 'string',
- 'required' => true,
- 'example' => 'llm-czal8nvvwb8d4xxx'."\n",
+ 'required' => false,
+ 'enumValueTitles' => [],
+ 'example' => 'idx_status_score',
],
],
[
- 'name' => 'name',
+ 'name' => 'PageNumber',
'in' => 'query',
- 'schema' => [
- 'title' => '模板名称',
- 'description' => '模板名称',
- 'type' => 'string',
- 'required' => true,
- 'example' => '小红书文案助手',
- ],
+ 'schema' => ['description' => '指定要查询的页码。起始值为 1。默认值为 1。', 'type' => 'string', 'required' => false, 'example' => '1'],
],
[
- 'name' => 'content',
+ 'name' => 'PageSize',
'in' => 'query',
- 'schema' => [
- 'title' => 'prompt模板内容',
- 'description' => 'prompt模板内容',
- 'type' => 'string',
- 'required' => true,
- 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}',
- ],
+ 'schema' => ['description' => '指定分页查询时每页展示的知识库数量。最大值不限。'."\n"
+ .'默认值为10。', 'type' => 'string', 'required' => false, 'example' => '10'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oq6xxxx'],
],
],
'responses' => [
@@ -6743,96 +5229,179 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'promptTemplateId' => [
- 'title' => 'prompt模板Id',
- 'description' => 'prompt模板Id',
- 'type' => 'string',
- 'example' => '6e49109bfeb94a39bb268f4e483ccxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx'."\n",
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Data' => [
+ 'description' => '返回数据。',
+ 'type' => 'object',
+ 'properties' => [
+ 'PageNumber' => ['description' => '返回指定的页码。', 'type' => 'integer', 'format' => 'int32', 'example' => '1'],
+ 'PageSize' => ['description' => '返回指定的每页条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ 'TotalCount' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '48'],
+ 'Indices' => [
+ 'description' => '知识库列表。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '知识库对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Id' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'example' => 'lecxr5xxxx'],
+ 'Name' => ['description' => '知识库名称。', 'type' => 'string', 'example' => 'XXXX产品清单'],
+ 'Description' => ['description' => '知识库描述。', 'type' => 'string', 'example' => '清单中产品主要面向海外客户。'],
+ 'StructureType' => [
+ 'description' => '知识库类型。可能值:'."\n"
+ ."\n"
+ .'- UNSTRUCTURED:文档搜索类。',
+ 'type' => 'string',
+ 'enumValueTitles' => [],
+ 'example' => 'UNSTRUCTURED',
+ ],
+ 'ChunkSize' => ['description' => '分段预估长度。可能值范围[1-2048]。', 'type' => 'integer', 'format' => 'int32', 'example' => '5'],
+ 'OverlapSize' => ['description' => '分段重叠长度。可能值范围[0-1024]。', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ 'Separator' => ['description' => '分句标识符。如果有多个分句标识符,则用 | 分隔。可能值:'."\n"
+ .'- \\\\n:换行'."\n"
+ .'- ,:中文逗号'."\n"
+ .'- ,:英文逗号'."\n"
+ .'- 。:中文句号'."\n"
+ .'- .:英文句号'."\n"
+ .'- !:中文叹号'."\n"
+ .'- !:英文叹号'."\n"
+ .'- ;:中文分号'."\n"
+ .'- ;:英文分号'."\n"
+ .'- ?:中文问号'."\n"
+ .'- ?:英文问号', 'type' => 'string', 'example' => '\\n'],
+ 'EmbeddingModelName' => ['description' => 'Embedding模型名称。可能值:'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'- text-embedding-v4:text-embedding-v4模型。'."\n"
+ .'- text-embedding-v3:text-embedding-v3模型。'."\n"
+ .'- text-embedding-v2:text-embedding-v2模型。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'- text-embedding-v2:text-embedding-v2模型。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'example' => 'text-embedding-v2'],
+ 'RerankModelName' => ['description' => 'Rank模型名称。可能值:'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'- qwen3-rerank-hybrid:qwen3-rerank(hybrid)排序。'."\n"
+ .'- qwen3-rerank:qwen3-rerank排序。'."\n"
+ .'- gte-rerank-hybrid:gte-rerank(hybrid)排序。'."\n"
+ .'- gte-rerank:gte-rerank排序。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'- gte-rerank-hybrid:官方排序。'."\n"
+ .'- gte-rerank:gte-rerank排序。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'example' => 'gte-rerank-hybrid'],
+ 'RerankMinScore' => ['description' => '相似度阈值。范围[0.01-1.00]。', 'type' => 'string', 'example' => '0.01'],
+ 'SourceType' => ['description' => '阿里云百炼<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>的数据类型。'."\n"
+ ."\n\n"
+ .'对于文档搜索<props="china">/音视频搜索</props>类知识库,可能值:'."\n"
+ .'- DATA_CENTER_CATEGORY:类目类型。'."\n"
+ .'- DATA_CENTER_FILE:文件类型。'."\n"
+ ."\n"
+ .'对于数据查询/图片问答类知识库,可能值:'."\n"
+ .'- DATA_CENTER_STRUCTURED_TABLE:数据表类型。', 'type' => 'string', 'example' => 'DATA_CENTER_FILE'],
+ 'DocumentIds' => [
+ 'description' => '文件 ID 列表。',
+ 'type' => 'array',
+ 'items' => ['description' => '文件 ID。', 'type' => 'string', 'example' => 'file_8c67b438043848199ffaa903d29addd4_xxxxxxxx'],
+ ],
+ 'SinkType' => ['description' => '知识库的向量存储类型。可能值:'."\n"
+ .'- ES:内置的向量数据库。'."\n"
+ .'- BUILT_IN:内置的向量数据库。'."\n"
+ .'- ADB:AnalyticDB for PostgreSQL数据库。', 'type' => 'string', 'example' => 'BUILT_IN'],
+ 'SinkInstanceId' => ['description' => '知识库的向量存储的实例 ID。', 'type' => 'string', 'example' => 'gp-bp1gq62t1788yxxxx'],
+ 'SinkRegion' => ['description' => '知识库的向量存储的实例地域。', 'type' => 'string', 'example' => 'cn-hangzhou'],
+ 'ConfgModel' => ['description' => '此知识库采用的配置模式。可能值:'."\n"
+ .'- recommend:推荐配置。'."\n"
+ .'- user-defined:自定义。', 'type' => 'string', 'example' => 'recommend'],
+ 'EnableRewrite' => ['description' => '此知识库是否开启了<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>。可能值:'."\n"
+ .'- true:已开启。'."\n"
+ .'- false:未开启。', 'type' => 'boolean', 'example' => 'false'],
+ ],
+ ],
+ ],
+ ],
],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'PromptTemplate.ContentInvalid',
- 'errorMessage' => 'Input parameter Content is invalid.',
- ],
- [
- 'errorCode' => 'PromptTemplate.NameInvalid',
- 'errorMessage' => 'Input parameter Name is invalid.',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Data\\": {\\n \\"PageNumber\\": 1,\\n \\"PageSize\\": 10,\\n \\"TotalCount\\": 48,\\n \\"Indices\\": [\\n {\\n \\"Id\\": \\"lecxr5xxxx\\",\\n \\"Name\\": \\"XXXX产品清单\\",\\n \\"Description\\": \\"清单中产品主要面向海外客户。\\",\\n \\"StructureType\\": \\"UNSTRUCTURED\\",\\n \\"ChunkSize\\": 5,\\n \\"OverlapSize\\": 10,\\n \\"Separator\\": \\"\\\\\\\\n\\",\\n \\"EmbeddingModelName\\": \\"text-embedding-v2\\",\\n \\"RerankModelName\\": \\"gte-rerank-hybrid\\",\\n \\"RerankMinScore\\": \\"0.01\\",\\n \\"SourceType\\": \\"DATA_CENTER_FILE\\",\\n \\"DocumentIds\\": [\\n \\"file_8c67b438043848199ffaa903d29addd4_xxxxxxxx\\"\\n ],\\n \\"SinkType\\": \\"BUILT_IN\\",\\n \\"SinkInstanceId\\": \\"gp-bp1gq62t1788yxxxx\\",\\n \\"SinkRegion\\": \\"cn-hangzhou\\",\\n \\"ConfgModel\\": \\"recommend\\",\\n \\"EnableRewrite\\": false\\n }\\n ]\\n },\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Success\\": true,\\n \\"Status\\": \\"200\\"\\n}","type":"json"}]',
+ 'title' => '查询知识库列表',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:ListIndex权限点),然后才能调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListIndices'],
],
- 500 => [
- [
- 'errorCode' => 'PromptTemplate.InternalError',
- 'errorMessage' => 'Prompt template service inner exception.',
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"promptTemplateId\\": \\"6e49109bfeb94a39bb268f4e483ccxxx\\",\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\\\n\\"\\n}","type":"json"}]',
- 'title' => '创建Prompt模板',
- 'description' => '本接口暂不支持文生图Prompt模板的创建。',
],
- 'GetPromptTemplate' => [
- 'summary' => '基于模板Id获取Prompt模板。',
- 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'ListMemories' => [
+ 'summary' => '获取指定业务空间下一个或多个长期记忆体的详细信息。',
+ 'path' => '/{workspaceId}/memories',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'read',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdxxx',
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'."\n"],
],
[
- 'name' => 'promptTemplateId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '模板Id',
- 'description' => '模板Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6e49109bfeb94a39bb268f4e483ccxxx',
- ],
+ 'name' => 'maxResults',
+ 'in' => 'query',
+ 'schema' => ['title' => '最大返回数量', 'description' => '分页查询时每页行数。取值范围[1-50]。'."\n"
+ ."\n"
+ .'默认值: 当不设置值时,默认值为 10。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
+ ],
+ [
+ 'name' => 'nextToken',
+ 'in' => 'query',
+ 'schema' => ['title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页', 'description' => '查询凭证(Token),取值为上一次 API 调用返回的 NextToken 参数值。', 'type' => 'string', 'required' => false, 'example' => 'dc270401186b433f975d7e1faaa3xxxx'],
],
],
'responses' => [
@@ -6842,142 +5411,103 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'content' => [
- 'title' => '模板内容',
- 'description' => '模板内容',
- 'type' => 'string',
- 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}',
- ],
- 'name' => [
- 'title' => '模板名称',
- 'description' => '模板名称',
- 'type' => 'string',
- 'example' => '小红书文案助手',
- ],
- 'promptTemplateId' => [
- 'title' => '模板Id',
- 'description' => '模板Id',
- 'type' => 'string',
- 'example' => '6e49109bfeb94a39bb268f4e483ccxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5',
- ],
- 'workspaceId' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'example' => 'llm-us9hjmt32nysdxxx',
- ],
- 'variables' => [
- 'title' => '模板变量',
- 'description' => '模板变量列表',
+ 'maxResults' => ['description' => '分页查询时每页长期记忆体的数量。', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ 'memories' => [
+ 'description' => '长期记忆体列表。',
'type' => 'array',
'items' => [
- 'description' => '模板变量',
- 'type' => 'string',
- 'example' => 'theme',
+ 'description' => '长期记忆体对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'description' => ['description' => '长期记忆体的描述信息。', 'type' => 'string', 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体'],
+ 'memoryId' => ['description' => '长期记忆体 ID。', 'type' => 'string', 'example' => '3fc531f4519444beaafffa4538f6xxxx'],
+ ],
],
- 'example' => '["theme"]',
],
+ 'nextToken' => ['description' => '本次调用返回的查询凭证值。', 'type' => 'string', 'example' => 'dc270401186b433f975d7e1faaa3xxxx'],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n"],
+ 'totalCount' => ['description' => '返回结果的总条数。', 'type' => 'integer', 'format' => 'int32', 'example' => '105'],
+ 'workspaceId' => ['title' => '业务空间Id', 'description' => '长期记忆体列表所属的业务空间 ID。', 'type' => 'string', 'example' => 'llm-3z7uw7fwz0vexxxx'."\n"],
],
],
],
],
'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'Memory.MaxResultsInvalid', 'errorMessage' => 'Input parameter maxResults is invalid.', 'description' => '入参maxResults是无效的'],
+ ['errorCode' => 'Memory.NextTokenInvalid', 'errorMessage' => 'Input parameter nextToken is invalid.', 'description' => '入参nextToken是无效的。'],
+ ],
404 => [
- [
- 'errorCode' => 'PromptTemplate.TemplateNotFound',
- 'errorMessage' => 'Prompt template not found.',
- ],
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
],
500 => [
- [
- 'errorCode' => 'PromptTemplate.InternalError',
- 'errorMessage' => 'Prompt template service inner exception.',
- ],
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"content\\": \\"请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}\\",\\n \\"name\\": \\"小红书文案助手\\",\\n \\"promptTemplateId\\": \\"6e49109bfeb94a39bb268f4e483ccxxx\\",\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\",\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdxxx\\",\\n \\"variables\\": [\\n \\"theme\\"\\n ]\\n}","type":"json"}]',
- 'title' => '获取Prompt模板',
- ],
- 'UpdatePromptTemplate' => [
- 'summary' => '基于模板Id增量更新Prompt模板。',
- 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
- 'methods' => [
- 'patch',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 10,\\n \\"memories\\": [\\n {\\n \\"description\\": \\"我的大模型应用$APP_ID关于A用户的长期记忆体\\",\\n \\"memoryId\\": \\"3fc531f4519444beaafffa4538f6xxxx\\"\\n }\\n ],\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa3xxxx\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"totalCount\\": 105,\\n \\"workspaceId\\": \\"llm-3z7uw7fwz0vexxxx\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '获取长期记忆体列表',
+ 'description' => '- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
+ .'- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListMemories'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListMemories',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListMemoryNodes' => [
+ 'summary' => '获取记忆片段列表。',
+ 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdxxx',
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
[
- 'name' => 'promptTemplateId',
+ 'name' => 'memoryId',
'in' => 'path',
- 'schema' => [
- 'title' => 'prompt模板Id',
- 'description' => 'prompt模板Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6e49109bfeb94a39bb268f4e483ccxxx',
- ],
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体Id', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'],
],
[
- 'name' => 'name',
+ 'name' => 'maxResults',
'in' => 'query',
- 'schema' => [
- 'title' => '模板名称',
- 'description' => '模板名称',
- 'type' => 'string',
- 'required' => false,
- 'example' => '小红书文案助手',
- ],
+ 'allowEmptyValue' => true,
+ 'schema' => ['title' => '最大返回数量', 'description' => '最大返回数量', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '50', 'minimum' => '1', 'example' => '20', 'default' => '10'],
],
[
- 'name' => 'content',
+ 'name' => 'nextToken',
'in' => 'query',
- 'schema' => [
- 'title' => 'prompt模板内容',
- 'description' => 'prompt模板内容',
- 'type' => 'string',
- 'required' => false,
- 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}',
- ],
+ 'allowEmptyValue' => true,
+ 'schema' => ['title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页', 'description' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页', 'type' => 'string', 'required' => false, 'example' => 'dc270401186b433f975d7e1faaa34e0e'."\n"],
],
],
'responses' => [
@@ -6987,95 +5517,108 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx'."\n",
+ 'maxResults' => ['title' => '最大请求数量', 'description' => '最大请求数量', 'type' => 'integer', 'format' => 'int32', 'example' => '20'],
+ 'memoryNodes' => [
+ 'title' => '长期记忆节点数组',
+ 'description' => '记忆片段数组',
+ 'type' => 'array',
+ 'items' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'content' => ['title' => '长期记忆节点内容', 'description' => '记忆片段内容', 'type' => 'string', 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n"],
+ 'memoryNodeId' => ['title' => '长期记忆节点Id', 'description' => '记忆片段Id', 'type' => 'string', 'example' => '68de06c95368463a8be4a84efc872cc5'],
+ ],
+ 'description' => '',
+ ],
],
+ 'nextToken' => ['title' => '用于实现基于令牌的分页', 'description' => '用于实现基于令牌的分页', 'type' => 'string', 'example' => 'dc270401186b433f975d7e1faaa34e0e'."\n"],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-114029103cad'."\n"],
+ 'totalCount' => ['title' => '长期记忆节点总数', 'description' => '记忆片段总数', 'type' => 'integer', 'format' => 'int32', 'example' => '100'."\n"],
],
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'PromptTemplate.ContentInvalid',
- 'errorMessage' => 'Input parameter Content is invalid.',
- ],
- [
- 'errorCode' => 'PromptTemplate.NameInvalid',
- 'errorMessage' => 'Input parameter Name is invalid.',
- ],
+ ['errorCode' => 'Memory.MaxResultsInvalid', 'errorMessage' => 'Input parameter maxResults is invalid.', 'description' => '入参maxResults是无效的'],
+ ['errorCode' => 'Memory.MemoryNodeContentInvalid', 'errorMessage' => 'Memory node content is invalid.', 'description' => '长期记忆节点的内容无效'],
+ ['errorCode' => 'Memory.NextTokenInvalid', 'errorMessage' => 'Input parameter nextToken is invalid.', 'description' => '入参nextToken是无效的。'],
],
404 => [
- [
- 'errorCode' => 'PromptTemplate.TemplateNotFound',
- 'errorMessage' => 'Prompt template not found.',
- ],
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ['errorCode' => 'Memory.MemoryNodeNotFound', 'errorMessage' => 'MemoryNode not found.', 'description' => '长期记忆节点未找到'],
],
500 => [
- [
- 'errorCode' => 'PromptTemplate.InternalError',
- 'errorMessage' => 'Prompt template service inner exception.',
- ],
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\\\n\\"\\n}","type":"json"}]',
- 'title' => '更新Prompt模板',
- ],
- 'DeletePromptTemplate' => [
- 'summary' => '基于模板Id删除Prompt模板。',
- 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
- 'methods' => [
- 'delete',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 20,\\n \\"memoryNodes\\": [\\n {\\n \\"content\\": \\"用户喜欢吃西红柿炒鸡蛋\\\\n\\",\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efc872cc5\\"\\n }\\n ],\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa34e0e\\\\n\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-114029103cad\\\\n\\",\\n \\"totalCount\\": 100\\n}","type":"json"}]',
+ 'title' => '获取记忆片段列表',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListMemoryNodes'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListMemoryNodes',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'ListPromptTemplates' => [
+ 'summary' => '获取Prompt模板列表。',
+ 'path' => '/{workspaceId}/promptTemplates',
+ 'methods' => ['get'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'list', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdxxx',
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdxxx'],
],
[
- 'name' => 'promptTemplateId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '模板Id',
- 'description' => '模板Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6e49109bfeb94a39bb268f4e483ccxxx',
- ],
+ 'name' => 'name',
+ 'in' => 'query',
+ 'schema' => ['title' => '基于模板名称搜索', 'description' => '基于模板名称关键字搜索', 'type' => 'string', 'required' => false, 'example' => '小红书'],
+ ],
+ [
+ 'name' => 'type',
+ 'in' => 'query',
+ 'schema' => ['title' => '模板类型,可选值:'."\n"
+ .'· System:系统预置模板'."\n"
+ .'· Custom:用户自定义模板', 'description' => '模板类型,可选值:'."\n"
+ .'· System:系统预置模板'."\n"
+ .'· Custom:用户自定义模板', 'type' => 'string', 'required' => false, 'example' => 'System'],
+ ],
+ [
+ 'name' => 'maxResults',
+ 'in' => 'query',
+ 'schema' => ['title' => '最大返回数量', 'description' => '最大返回数量', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'],
+ ],
+ [
+ 'name' => 'nextToken',
+ 'in' => 'query',
+ 'schema' => ['title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页', 'description' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页', 'type' => 'string', 'required' => false, 'example' => 'dc270401186b433f975d7e1faaa34e0e'],
],
],
'responses' => [
@@ -7085,293 +5628,667 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx',
+ 'maxResults' => ['title' => '最大返回数量', 'description' => '最大返回数量', 'type' => 'integer', 'format' => 'int32', 'example' => '10'],
+ 'nextToken' => ['title' => '用于实现基于令牌的分页', 'description' => '用于实现基于令牌的分页', 'type' => 'string', 'example' => 'dc270401186b433f975d7e1faaa34e0e'],
+ 'promptTemplates' => [
+ 'title' => '模板列表',
+ 'description' => '模板列表',
+ 'type' => 'array',
+ 'items' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'content' => ['title' => '模板内容', 'description' => '模板内容', 'type' => 'string', 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}'],
+ 'name' => ['title' => '模板名称', 'description' => '模板名称', 'type' => 'string', 'example' => '小红书文案'."\n"],
+ 'promptTemplateId' => ['title' => '模板Id', 'description' => '模板Id', 'type' => 'string', 'example' => 'd6935b7efbe34d11b13df9307151cf8c'],
+ 'type' => ['title' => '模板类型', 'description' => '模板类型', 'type' => 'string', 'example' => '"System"'],
+ 'variables' => [
+ 'title' => '模板变量',
+ 'description' => '模板变量列表',
+ 'type' => 'array',
+ 'items' => ['description' => '模板变量', 'type' => 'string', 'example' => '"theme"'],
+ ],
+ ],
+ 'description' => '',
+ ],
],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5AB071'],
+ 'totalCount' => ['title' => '数据总数', 'description' => '数据总数', 'type' => 'integer', 'format' => 'int32', 'example' => '15'],
+ 'workspaceId' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'example' => 'llm-us9hjmt32nysdxxx'."\n"],
],
],
],
],
'errorCodes' => [
- 404 => [
- [
- 'errorCode' => 'PromptTemplate.TemplateNotFound',
- 'errorMessage' => 'Prompt template not found.',
- ],
+ 400 => [
+ ['errorCode' => 'PromptTemplate.MaxResultsInvalid', 'errorMessage' => 'Input parameter MaxResults is invalid.', 'description' => '输入参数maxResults格式无效。'],
+ ['errorCode' => 'PromptTemplate.NameInvalid', 'errorMessage' => 'Input parameter Name is invalid.', 'description' => '输入参数Name的格式无效。'],
+ ['errorCode' => 'PromptTemplate.NextTokenInvalid', 'errorMessage' => 'Input parameter NextToken is invalid.', 'description' => '入参nextToken是无效的。'],
+ ['errorCode' => 'PromptTemplate.TypeInvalid', 'errorMessage' => 'Input parameter type is invalid.', 'description' => '入参type格式无效。'],
],
500 => [
- [
- 'errorCode' => 'PromptTemplate.InternalError',
- 'errorMessage' => 'Prompt template service inner exception.',
- ],
+ ['errorCode' => 'PromptTemplate.InternalError', 'errorMessage' => 'Prompt template service inner exception.', 'description' => 'prompt模板服务内部异常'],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\"\\n}","type":"json"}]',
- 'title' => '删除Prompt模板',
- ],
- 'ListPromptTemplates' => [
- 'summary' => '获取Prompt模板列表。',
- 'path' => '/{workspaceId}/promptTemplates',
- 'methods' => [
- 'get',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 10,\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa34e0e\\",\\n \\"promptTemplates\\": [\\n {\\n \\"content\\": \\"请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}\\",\\n \\"name\\": \\"小红书文案\\\\n\\",\\n \\"promptTemplateId\\": \\"d6935b7efbe34d11b13df9307151cf8c\\",\\n \\"type\\": \\"\\\\\\"System\\\\\\"\\",\\n \\"variables\\": [\\n \\"\\\\\\"theme\\\\\\"\\"\\n ]\\n }\\n ],\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5AB071\\",\\n \\"totalCount\\": 15,\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdxxx\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '获取Prompt模板列表',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListPromptTemplates'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListPromptTemplates',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'Retrieve' => [
+ 'path' => '/{WorkspaceId}/index/retrieve',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'list',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'workspaceId',
- 'in' => 'path',
+ 'name' => 'Query',
+ 'in' => 'query',
+ 'schema' => ['description' => '输入文本(原始输入prompt)。Query的长度和字符没有限制。', 'type' => 'string', 'required' => false, 'example' => '阿里云百炼平台介绍'],
+ ],
+ [
+ 'name' => 'DenseSimilarityTopK',
+ 'in' => 'query',
+ 'schema' => ['description' => '向量检索 Top K,通过生成输入文本的向量并在知识库中检索与其向量表示最相似的 K 个文本切片。K的取值范围[0-100]。'."\n"
+ .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
+ ."\n"
+ .'默认值为100。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '100'],
+ ],
+ [
+ 'name' => 'EnableReranking',
+ 'in' => 'query',
'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdxxx',
+ 'description' => '是否开启重排序。更多信息,请参见[知识库](~~2807740~~)。取值范围:'."\n"
+ .'- true:开启。'."\n"
+ .'- false:不开启。'."\n"
+ ."\n"
+ .'默认值为 true。',
+ 'type' => 'boolean',
+ 'required' => false,
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
+ 'example' => 'true',
],
],
[
- 'name' => 'name',
+ 'name' => 'EnableRewrite',
'in' => 'query',
'schema' => [
- 'title' => '基于模板名称搜索',
- 'description' => '基于模板名称关键字搜索',
- 'type' => 'string',
+ 'description' => '是否开启<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>。'."\n"
+ .'取值范围:'."\n"
+ .'- true:开启。'."\n"
+ .'- false:不开启。'."\n"
+ ."\n"
+ .'默认值为 false。',
+ 'type' => 'boolean',
'required' => false,
- 'example' => '小红书',
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
+ 'example' => 'false',
],
],
[
- 'name' => 'type',
+ 'name' => 'Rerank',
'in' => 'query',
+ 'style' => 'json',
'schema' => [
- 'title' => '模板类型,可选值:'."\n"
- .'· System:系统预置模板'."\n"
- .'· Custom:用户自定义模板',
- 'description' => '模板类型,可选值:'."\n"
- .'· System:系统预置模板'."\n"
- .'· Custom:用户自定义模板',
- 'type' => 'string',
+ 'description' => '重排序配置。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '重排序配置对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'ModelName' => [
+ 'description' => '使用指定的排序模型。此处指定值将覆盖创建知识库时所选择的排序模型。取值范围:'."\n"
+ ."\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'- qwen3-rerank-hybrid:qwen3-rerank(hybrid)排序。'."\n"
+ .'- qwen3-rerank:qwen3-rerank排序。'."\n"
+ .'- gte-rerank-hybrid:gte-rerank(hybrid)排序。'."\n"
+ .'- gte-rerank:gte-rerank排序。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'- gte-rerank-hybrid:官方排序。'."\n"
+ .'- gte-rerank:gte-rerank排序。'."\n"
+ ."\n\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'默认值为空,使用创建知识库时选择的排序模型。'."\n"
+ ."\n\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'> 如仅需语义排序,可使用`qwen3-rerank`;若同时需要语义排序和文本匹配特征以确保相关性,建议使用`qwen3-rerank-hybrid`。'."\n"
+ .'>'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 如仅需语义排序,可使用`gte-rerank`;若同时需要语义排序和文本匹配特征以确保相关性,建议使用`gte-rerank-hybrid`。'."\n"
+ .'>'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n\n"
+ ."\n"
+ .'<props="china">'."\n"
+ ."\n"
+ .'> `gte-rerank-hybrid`与`gte-rerank`后续停止更新,不建议使用。'."\n"
+ .'>'."\n"
+ ."\n\n"
+ .'</props>',
+ 'type' => 'string',
+ 'required' => false,
+ 'enumValueTitles' => ['gte-rerank-hybrid' => 'gte-rerank(hybrid)排序', 'gte-rerank' => 'gte-rerank排序'],
+ 'example' => 'gte-rerank-hybrid',
+ ],
+ 'RerankMode' => [
+ 'description' => '<props="china">'."\n"
+ .'指定重排序模型的指令干预模式,以决定其评分偏好。'."\n"
+ ."\n"
+ .'**可选值:**'."\n"
+ ."\n"
+ .'- **qa**:(默认值) 问答模式。模型倾向于为能直接回答查询(Query)的候选项赋予更高分。建议在问答场景使用。'."\n"
+ ."\n"
+ .'- **similar**: 相似模式。模型倾向于为与查询内容一致性高的候选项赋予更高分。建议在匹配检索场景使用。'."\n"
+ ."\n"
+ .'- **custom**: 自定义模式。模型的排序行为由 rerank_instruct 参数中的指令决定。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">该参数暂不开放,请勿传入。</props>',
+ 'type' => 'string',
+ 'required' => false,
+ 'enumValueTitles' => ['similar: 相似模式。' => 'similar: 相似模式。', 'custom: 自定义模式。' => 'custom: 自定义模式。', 'qa:(默认值) 问答模式。' => 'qa:(默认值) 问答模式。'],
+ 'example' => 'qa',
+ ],
+ 'RerankInstruct' => ['description' => '<props="intl">该参数暂不开放,请勿传入。</props>'."\n"
+ ."\n"
+ .'<props="china">提供一个自然语言指令,用于精细化控制重排序模型的行为。'."\n"
+ .'<notice>此参数仅在 rerank_mode 设置为 "custom" 时生效。></notice></props>', 'type' => 'string', 'required' => false],
+ ],
+ 'required' => false,
+ ],
'required' => false,
- 'example' => 'System',
],
],
[
- 'name' => 'maxResults',
+ 'name' => 'RerankMinScore',
+ 'in' => 'query',
+ 'schema' => ['description' => '相似度阈值。该阈值表示允许召回的文本切片的最低相似度分数,用于筛选Rank模型返回的文本切片,即只有分数超过此数值的文本切片才会被召回。取值范围[0.01-1.00]。此参数的优先级大于知识库相似度阈值配置。'."\n"
+ ."\n"
+ .'当未指定具体值时,默认采用该知识库配置的相似度阈值。', 'type' => 'number', 'format' => 'float', 'required' => false, 'example' => '0.20'],
+ ],
+ [
+ 'name' => 'RerankTopN',
'in' => 'query',
+ 'schema' => ['description' => '重排序后的 Top N 返回数据。取值范围[1-20],默认值为5。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '5'],
+ ],
+ [
+ 'name' => 'Rewrite',
+ 'in' => 'query',
+ 'style' => 'json',
'schema' => [
- 'title' => '最大返回数量',
- 'description' => '最大返回数量',
- 'type' => 'integer',
- 'format' => 'int32',
+ 'description' => '多轮对话改写配置。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '多轮对话改写配置对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'ModelName' => [
+ 'description' => '多轮对话改写模型名称。它会基于会话上下文自动调整原始输入prompt(用户问题)以提升检索效果。取值范围:'."\n"
+ .'- conv-rewrite-qwen-1.8b:conv-rewrite-qwen-1.8b模型(目前只支持该模型)'."\n"
+ ."\n"
+ .'默认值为空,采用conv-rewrite-qwen-1.8b模型。',
+ 'type' => 'string',
+ 'required' => false,
+ 'enumValueTitles' => ['conv-rewrite-qwen-1.8b' => 'conv-rewrite-qwen-1.8b模型'],
+ 'example' => 'conv-rewrite-qwen-1.8b',
+ ],
+ ],
+ 'required' => false,
+ ],
'required' => false,
- 'example' => '10',
],
],
[
- 'name' => 'nextToken',
+ 'name' => 'SparseSimilarityTopK',
+ 'in' => 'query',
+ 'schema' => ['description' => '关键词检索TopK,即在知识库中查找与输入文本的关键词精确匹配的切片。它可以帮助您过滤掉无关的文本切片,提供更准确的结果。'."\n"
+ .'取值范围[0-100]。'."\n"
+ .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
+ ."\n"
+ .'默认值为:100。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '100'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
+ 'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
+ ],
+ [
+ 'name' => 'IndexId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。'."\n"
+ ."\n"
+ .'> - 请确保对应知识库已成功创建且未被删除。', 'type' => 'string', 'required' => true, 'example' => '5pwe0mxxxx'],
+ ],
+ [
+ 'name' => 'SaveRetrieverHistory',
+ 'in' => 'query',
+ 'schema' => ['description' => '是否保存历史文本切片召回测试数据。取值范围:'."\n"
+ .'- true:保存。'."\n"
+ .'- false:不保存。'."\n"
+ ."\n"
+ .'默认值为:false。', 'type' => 'boolean', 'required' => false, 'example' => 'false', 'default' => 'false'],
+ ],
+ [
+ 'name' => 'SearchFilters',
'in' => 'query',
+ 'style' => 'json',
'schema' => [
- 'title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页',
- 'description' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页',
- 'type' => 'string',
+ 'description' => '支持通过SearchFilter设置个性化的检索条件(比如标签),对语义检索结果进行过滤,以排除与查询Query无关的信息。'."\n"
+ .'设置is_displayed_chunk_content参数为true生效筛选逻辑,具体内容请参见[知识库SearchFilters](~~2869641~~)。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '检索条件对象。',
+ 'type' => 'object',
+ 'required' => false,
+ 'additionalProperties' => ['type' => 'string', 'description' => ''],
+ ],
+ 'required' => false,
+ ],
+ ],
+ [
+ 'name' => 'Images',
+ 'in' => 'query',
+ 'allowEmptyValue' => true,
+ 'style' => 'simple',
+ 'schema' => [
+ 'description' => '支持在提问时传入图片URL地址。',
+ 'type' => 'array',
+ 'items' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'检索图片问答类知识库时您可传入图片URL地址。当该知识库中存在图片索引时,系统会将输入图片转为向量并检索到相关记录;如果不存在图片索引,则输入的图片不会用于检索。'."\n"
+ .'> 本字段不支持文档搜索/数据查询/音视频搜索类知识库(即使传入也不生效)'."\n"
+ ."\n"
+ .'> 请确保链接公开可访问且指向一个有效的图片文件。格式示例:https://example.com/downloads/pic.jpg'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ ."\n\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'检索图片问答知识库时您可传入图片URL地址。当该知识库中存在图片索引时,系统会将输入图片转为向量并检索到相关记录;如果不存在图片索引,则输入的图片不会用于检索。'."\n"
+ .'> 本字段不支持文档搜索/数据查询知识库(即使传入也不生效)'."\n"
+ ."\n"
+ .'> 请确保链接公开可访问且指向一个有效的图片文件。格式示例:https://example.com/downloads/pic.jpg'."\n"
+ ."\n\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => 'https://example.com/downloads/pic.jpg'],
'required' => false,
- 'example' => 'dc270401186b433f975d7e1faaa34e0e',
+ ],
+ ],
+ [
+ 'name' => 'QueryHistory',
+ 'in' => 'query',
+ 'allowEmptyValue' => false,
+ 'style' => 'json',
+ 'schema' => [
+ 'description' => '<props="china">[多轮对话改写](https://help.aliyun.com/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props><props="intl">[多轮对话改写](https://www.alibabacloud.com/help/model-studio/use-cases/rag-optimization#b7031e2ad6cji)</props>支持您传入自己管理的对话历史。仅在EnableRewrite=**true** 时生效(否则即使传入也不生效)。',
+ 'type' => 'array',
+ 'items' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'role' => ['description' => '角色。'."\n"
+ ."\n"
+ .'取值范围:'."\n"
+ ."\n"
+ .'- user:传入此角色,此时content表示您输入给阿里云百炼应用的文本。'."\n"
+ .'- assistant:传入此角色,此时content表示阿里云百炼应用的回复。', 'type' => 'string', 'required' => false, 'example' => 'user'."\n"],
+ 'content' => ['description' => '对应角色的问题或者回答内容。', 'type' => 'string', 'required' => false, 'example' => '代表一段文本。'],
+ ],
+ 'required' => false,
+ 'description' => '',
+ ],
+ 'required' => false,
+ ],
+ ],
+ [
+ 'name' => 'Extra',
+ 'in' => 'query',
+ 'style' => 'json',
+ 'schema' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'uniqueId' => ['type' => 'string', 'maxLength' => 512],
+ ],
],
],
],
'responses' => [
200 => [
'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'maxResults' => [
- 'title' => '最大返回数量',
- 'description' => '最大返回数量',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
- ],
- 'nextToken' => [
- 'title' => '用于实现基于令牌的分页',
- 'description' => '用于实现基于令牌的分页',
- 'type' => 'string',
- 'example' => 'dc270401186b433f975d7e1faaa34e0e',
- ],
- 'promptTemplates' => [
- 'title' => '模板列表',
- 'description' => '模板列表',
- 'type' => 'array',
- 'items' => [
- 'type' => 'object',
- 'properties' => [
- 'content' => [
- 'title' => '模板内容',
- 'description' => '模板内容',
- 'type' => 'string',
- 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}',
- ],
- 'name' => [
- 'title' => '模板名称',
- 'description' => '模板名称',
- 'type' => 'string',
- 'example' => '小红书文案'."\n",
- ],
- 'promptTemplateId' => [
- 'title' => '模板Id',
- 'description' => '模板Id',
- 'type' => 'string',
- 'example' => 'd6935b7efbe34d11b13df9307151cf8c',
- ],
- 'type' => [
- 'title' => '模板类型',
- 'description' => '模板类型',
- 'type' => 'string',
- 'example' => '"System"',
- ],
- 'variables' => [
- 'title' => '模板变量',
- 'description' => '模板变量列表',
- 'type' => 'array',
- 'items' => [
- 'description' => '模板变量',
- 'type' => 'string',
- 'example' => '"theme"',
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Data' => [
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Nodes' => [
+ 'description' => '命中的文本切片列表。',
+ 'type' => 'array',
+ 'items' => [
+ 'description' => '文本切片对象。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Metadata' => ['description' => '<props="china">'."\n"
+ ."\n"
+ .'文本切片的元数据Map。'."\n"
+ ."\n"
+ .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
+ ."\n"
+ .'> 检索文档搜索类识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'> 检索音视频搜索类知识库时,若切片包含音频,将通过元数据 Map 中` audio_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'> 检索音视频搜索类知识库时,若切片包含视频,将通过元数据 Map 中` video_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'文本切片的元数据Map。'."\n"
+ ."\n"
+ .'> 文档搜索类知识库的元数据Map中`file_path`字段无意义,请勿在业务代码中使用。'."\n"
+ ."\n"
+ .'> 检索文档搜索类知识库时,若切片包含图片,将通过元数据 Map 中` image_url `字段透出,并附有过期时间。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'any', 'example' => '{'."\n"
+ .' "parent": "",'."\n"
+ .' "file_path": "https://***",'."\n"
+ .' "image_url": ['."\n"
+ .' "http://***"'."\n"
+ .' ],'."\n"
+ .' "nid": "***",'."\n"
+ .' "title": "阿里云百炼文档",'."\n"
+ .' "doc_id": "doc_***",'."\n"
+ .' "content": "阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建",'."\n"
+ .' "workspace_id": "ws_***",'."\n"
+ .' "hier_title": "阿里云百炼文档",'."\n"
+ .' "doc_name": "阿里云百炼文档介绍.pdpf",'."\n"
+ .' "pipeline_id": "rhd***",'."\n"
+ .' "_id": "ws_***"'."\n"
+ .'}'],
+ 'Score' => ['description' => '文本切片的相似度得分,可能值范围:[0-1]。', 'type' => 'number', 'format' => 'double', 'example' => '0.3'],
+ 'Text' => ['description' => '文本切片内容。', 'type' => 'string', 'example' => '阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建。'],
],
],
],
],
],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5AB071',
- ],
- 'totalCount' => [
- 'title' => '数据总数',
- 'description' => '数据总数',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '15',
- ],
- 'workspaceId' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'example' => 'llm-us9hjmt32nysdxxx'."\n",
- ],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-7734-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
+ 'description' => '',
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'PromptTemplate.MaxResultsInvalid',
- 'errorMessage' => 'Input parameter MaxResults is invalid.',
- ],
- [
- 'errorCode' => 'PromptTemplate.NameInvalid',
- 'errorMessage' => 'Input parameter Name is invalid.',
- ],
- [
- 'errorCode' => 'PromptTemplate.NextTokenInvalid',
- 'errorMessage' => 'Input parameter NextToken is invalid.',
- ],
- [
- 'errorCode' => 'PromptTemplate.TypeInvalid',
- 'errorMessage' => 'Input parameter type is invalid.',
- ],
- ],
- 500 => [
- [
- 'errorCode' => 'PromptTemplate.InternalError',
- 'errorMessage' => 'Prompt template service inner exception.',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '检索知识库',
+ 'summary' => '在指定的知识库中检索信息。',
+ 'description' => '<props="china">'."\n"
+ ."\n"
+ .'- **调用方式**:可通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)(配合阿里云访问密钥[AccessKey](~~116401~~))或[Spring AI Alibaba](~~2990886~~)(配合阿里云百炼[API-Key](~~2712195~~))检索知识库,两者均已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
+ .'- **权限要求**:'."\n"
+ .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:Retrieve权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
+ .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
+ .'- **响应延迟**:由于接口调用包含复杂的检索和匹配,响应时间可能较长,建议您合理设置请求的超时与重试策略。'."\n"
+ .'- **幂等性**:本接口具有幂等性。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'- **调用方式**:推荐使用最新版[阿里云百炼 SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)调用,SDK 已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
+ .'- **权限要求**:'."\n"
+ .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:Retrieve权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
+ .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
+ .'- **响应延迟**:由于接口调用包含复杂的检索和匹配,响应时间可能较长,建议您合理设置请求的超时与重试策略。'."\n"
+ .'- **幂等性**:本接口具有幂等性。'."\n"
+ .'</props>',
+ 'changeSet' => [
+ ['createdAt' => '2025-04-10T01:52:18.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-03-13T02:55:14.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-09-17T11:06:28.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2024-07-23T07:45:53.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '2000', 'countWindow' => 1, 'regionId' => '*', 'api' => 'Retrieve'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:Retrieve',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 10,\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa34e0e\\",\\n \\"promptTemplates\\": [\\n {\\n \\"content\\": \\"请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}\\",\\n \\"name\\": \\"小红书文案\\\\n\\",\\n \\"promptTemplateId\\": \\"d6935b7efbe34d11b13df9307151cf8c\\",\\n \\"type\\": \\"\\\\\\"System\\\\\\"\\",\\n \\"variables\\": [\\n \\"\\\\\\"theme\\\\\\"\\"\\n ]\\n }\\n ],\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5AB071\\",\\n \\"totalCount\\": 15,\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdxxx\\\\n\\"\\n}","type":"json"}]',
- 'title' => '获取Prompt模板列表',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"Nodes\\": [\\n {\\n \\"Metadata\\": \\"{\\\\n \\\\\\"parent\\\\\\": \\\\\\"\\\\\\",\\\\n \\\\\\"file_path\\\\\\": \\\\\\"https://***\\\\\\",\\\\n \\\\\\"image_url\\\\\\": [\\\\n \\\\\\"http://***\\\\\\"\\\\n ],\\\\n \\\\\\"nid\\\\\\": \\\\\\"***\\\\\\",\\\\n \\\\\\"title\\\\\\": \\\\\\"阿里云百炼文档\\\\\\",\\\\n \\\\\\"doc_id\\\\\\": \\\\\\"doc_***\\\\\\",\\\\n \\\\\\"content\\\\\\": \\\\\\"阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建\\\\\\",\\\\n \\\\\\"workspace_id\\\\\\": \\\\\\"ws_***\\\\\\",\\\\n \\\\\\"hier_title\\\\\\": \\\\\\"阿里云百炼文档\\\\\\",\\\\n \\\\\\"doc_name\\\\\\": \\\\\\"阿里云百炼文档介绍.pdpf\\\\\\",\\\\n \\\\\\"pipeline_id\\\\\\": \\\\\\"rhd***\\\\\\",\\\\n \\\\\\"_id\\\\\\": \\\\\\"ws_***\\\\\\"\\\\n}\\",\\n \\"Score\\": 0.3,\\n \\"Text\\": \\"阿里云百炼是基于通义大模型、行业大模型以及三方大模型的一站式大模型开发平台。面向企业客户和个人开发者,提供完整的模型服务工具和全链路应用开发套件,预置丰富的能力插件,提供API及SDK等便捷的集成方式,高效完成大模型应用构建。\\"\\n }\\n ]\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
],
- 'CreateMemory' => [
- 'summary' => '创建一个长期记忆体。',
- 'path' => '/{workspaceId}/memories',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'SubmitIndexAddDocumentsJob' => [
+ 'path' => '/{WorkspaceId}/index/add_documents_to_index',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'none',
'chargeType' => 'free',
+ 'abilityTreeNodes' => ['FEATUREsfm4VA8MJ'],
],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
+ ],
+ [
+ 'name' => 'IndexId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
+ ],
+ [
+ 'name' => 'SourceType',
+ 'in' => 'query',
'schema' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
+ 'description' => '数据来源类型。取值范围:'."\n"
+ .'- DATA_CENTER_CATEGORY:类目类型,即导入<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>中指定类目下的所有文档,支持导入多个类目。'."\n"
+ .'- DATA_CENTER_FILE:文档类型,即导入<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>下的指定文件,支持导入多个文件。'."\n"
+ ."\n"
+ .'> 如果本参数传入DATA_CENTER_CATEGORY,则必须指定`CategoryIds`参数;如果本参数传入DATA_CENTER_FILE,则必须指定`DocumentIds`参数。'."\n"
+ .'>',
'type' => 'string',
'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
+ 'enumValueTitles' => ['DATA_CENTER_CATEGORY' => '类目类型', 'DATA_CENTER_FILE' => '文档类型'],
+ 'example' => 'DATA_CENTER_FILE',
],
],
[
- 'name' => 'description',
+ 'name' => 'DocumentIds',
'in' => 'query',
- 'allowEmptyValue' => true,
+ 'style' => 'json',
'schema' => [
- 'title' => '长期记忆体的描述信息,默认为空',
- 'description' => '长期记忆体的描述信息。长度为 1~50 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。',
- 'type' => 'string',
+ 'description' => '文件 ID 列表。',
+ 'type' => 'array',
+ 'items' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'doc_ea4a504d9ce545508d8aa6d90371bf54xxxxxxxx'],
+ 'required' => false,
+ ],
+ ],
+ [
+ 'name' => 'CategoryIds',
+ 'in' => 'query',
+ 'style' => 'json',
+ 'schema' => [
+ 'description' => '类目 ID 列表。',
+ 'type' => 'array',
+ 'items' => ['description' => '类目 ID,即 **AddCategory** 接口返回的`CategoryId`。您也可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>-文件页签,单击类目旁的 ID 图标获取。', 'type' => 'string', 'required' => false, 'example' => 'cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx'."\n"],
+ 'required' => false,
+ ],
+ ],
+ [
+ 'name' => 'ChunkMode',
+ 'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'启用自定义切分(仅对您本次追加的文件生效)。更多信息,请参见[知识库](~~2807740~~)。可能取值(不支持同时传入多个值):'."\n"
+ ."\n"
+ .'- **length**:按长度切分。严格按照您指定的`ChunkSize`和`OverlapSize`切分。 若您未传入这两个参数,系统将采用默认值(`ChunkSize`为500,`OverlapSize`为100)。按长度切分不支持`Separator`(即使传入也不生效)。'."\n"
+ .'- **page**:按页切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值500)。按页切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
+ .'- **h1**:按照一级标题切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按照一级标题切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
+ .'- **h2**:按照二级标题切分。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按照二级标题切分不支持`OverlapSize`和`Separator`(即使传入也不生效)。'."\n"
+ .'- **regex**:按照正则切分,此时必须指定`Separator`参数。如果指定了`ChunkSize`,切分时将一并考虑(未传入时,将使用默认值 500)。按正则切分不支持`OverlapSize`(即使传入也不生效)。'."\n"
+ ."\n"
+ .'默认值为空,采用智能切分。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => 'length'],
+ ],
+ [
+ 'name' => 'Separator',
+ 'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'分句标识符,仅在`chunkMode`=**regex**时生效(否则即使传入也不生效)。可传入一个正则表达式(不支持多个),用于将文件分割为小段的文本切片。更多信息,请参见[知识库](~~2807740~~)。'."\n"
+ ."\n"
+ .'使用智能切分(未指定`chunkMode`)时,保持默认空值即可。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'string', 'required' => false, 'example' => '(?<=。)'],
+ ],
+ [
+ 'name' => 'ChunkSize',
+ 'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'分段长度,即您希望每个文本切片的字符数上限(仅对您本次追加的文件生效)。超过该长度时:'."\n"
+ ."\n"
+ .'- **智能切分**(未指定`chunkMode`):文本很可能会被截断。'."\n"
+ .'- **自定义切分**(指定了`chunkMode`):文本将被强制切割。'."\n"
+ ."\n"
+ .'取值范围[1-6000]。如果未传入本参数,将使用默认值 500。'."\n"
+ ."\n"
+ .'更多信息,请参见[知识库](~~2807740~~)。'."\n"
+ ."\n"
+ .'> 请注意,如果您指定了`ChunkSize`参数且小于100,则必须指定`OverlapSize`参数。您也可以不指定这2个参数(系统将采用默认值)。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '128'],
+ ],
+ [
+ 'name' => 'OverlapSize',
+ 'in' => 'query',
+ 'schema' => ['description' => '<props="china">'."\n"
+ .'分段重叠长度(仅对您本次追加的文件生效)。它表示当前文本切片与上一个文本切片的重叠字符数。更多信息,请参见[知识库](~~2807740~~)。取值范围[0-1024]。'."\n"
+ ."\n"
+ .'如果未传入本参数,将使用默认值 100。'."\n"
+ .'>请注意,`OverlapSize`的值必须小于`ChunkSize`的值,否则会导致切分异常。'."\n"
+ ."\n"
+ .'</props>'."\n"
+ ."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'> 该参数暂不开放,请勿传入。'."\n"
+ ."\n"
+ .'</props>', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '16'],
+ ],
+ [
+ 'name' => 'EnableHeaders',
+ 'in' => 'query',
+ 'schema' => [
+ 'description' => 'Excel文件表头是否支持拼装。开启后,知识库会将所有xlsx、xls格式文件的首行数据视为表头,并自动拼接到每个文本切片中(数据行),避免大模型误将表头视为普通数据行来处理。'."\n"
+ ."\n\n"
+ .'> 建议仅在导入文件均为xlsx、xls格式且含表头时开启,否则无需开启。'."\n"
+ .'>'."\n"
+ ."\n"
+ .'取值范围:'."\n"
+ .'- true:开启。'."\n"
+ .'- false:不开启。'."\n"
+ ."\n"
+ .'默认值为 false,即不开启。',
+ 'type' => 'boolean',
'required' => false,
- 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体',
+ 'enumValueTitles' => ['true' => '开启', 'false' => '不开启'],
+ 'example' => 'false',
+ ],
+ ],
+ [
+ 'name' => 'Extra',
+ 'in' => 'query',
+ 'style' => 'json',
+ 'schema' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'uniqueId' => ['type' => 'string'],
+ ],
],
],
],
@@ -7382,105 +6299,101 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'memoryId' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体 ID。'."\n"
- .'> 请妥善保管该值,它将用于后续所有与此长期记忆体相关的API操作。'."\n"
- .'>',
- 'type' => 'string',
- 'example' => '6bff4f317a14442fbc9f73d29dbxxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '17204B98-xxxx-4F9A--2446A84821CA',
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB'],
+ 'Data' => [
+ 'description' => '接口返回的业务字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Id' => ['description' => '任务 ID,又称`JobId`。', 'type' => 'string', 'example' => '42687eb254a34802bed398357f5498ae'],
+ ],
],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
],
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'Memory.DescriptionInvalid',
- 'errorMessage' => 'Input parameter description is invalid.',
- ],
+ ['errorCode' => 'IdempotentParameterMismatch', 'errorMessage' => 'The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.', 'description' => ''],
],
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '提交知识库追加任务',
+ 'summary' => '向指定知识库中追加导入已解析的文件。',
+ 'description' => '<props="china">'."\n"
+ ."\n"
+ .'- 本接口不支持数据查询/图片问答类知识库。关于如何更新数据查询/图片问答类知识库,请参见[知识库](~~2807740~~)一文中关于更新知识库的说明。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ .'<props="intl">'."\n"
+ ."\n"
+ .'- 本接口不支持数据查询/图片问答类知识库。关于如何更新数据查询/图片问答类知识库,请参见[知识库](~~2807740~~)一文中关于更新知识库的说明。'."\n"
+ ."\n\n"
+ .'</props>'."\n"
+ ."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:SubmitIndexAddDocumentsJob权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库ID`IndexId`有效)。'."\n"
+ .'- 调用该接口前,请先调用 **AddFile** 接口将您需要追加导入的文件上传至阿里云百炼。'."\n"
+ .'- 调用本接口后,任务需一定时间执行,高峰期可能耗时数小时。任务完成前请勿重复发起请求。如果需要查询任务的执行状态,可调用 **GetIndexJobStatus** 接口查询。此接口返回的文件列表`Documents`为您本次追加(由您提供的`job_id`唯一确定)全部文件,您可以查看每个文件是否导入(解析)成功。注意频繁调用 GetIndexJobStatus 接口会被限流,频率请勿高于20次/分钟。 '."\n"
+ .'- 本接口调用成功后,将执行一段时间,请求返回前请勿重复发起请求。本接口不具备幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2025-07-30T09:21:00.000Z', 'description' => '请求参数发生变更'],
+ ['createdAt' => '2025-04-27T08:48:18.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SubmitIndexAddDocumentsJob'],
],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:SubmitIndexAddDocumentsJob',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbxxxx\\",\\n \\"requestId\\": \\"17204B98-xxxx-4F9A--2446A84821CA\\"\\n}","type":"json"}]',
- 'title' => '创建长期记忆体',
- 'description' => '- 您可以将对话过程中的特定信息(即记忆片段,详见[长期记忆](https://help.aliyun.com/zh/model-studio/user-guide/long-term-memory))存储到长期记忆体(Memory)中,智能体应用将在后续对话中持续引用这些信息(非自动,您需要先调用[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口创建长期记忆体,获取`memoryId`。然后[通过API调用智能体应用](https://help.aliyun.com/zh/model-studio/user-guide/application-calling)时,传入该`memoryId`)。'."\n"
- .' > 长期记忆体尚不支持存储与管理用户画像,请您通过控制台进行相关操作,详见[长期记忆](https://help.aliyun.com/zh/model-studio/user-guide/long-term-memory#578ebae524m6l)。'."\n"
- .'- 若传入`memoryId`,系统会根据对话记录,在指定长期记忆体下自动创建记忆片段(MemoryNode)。您也可以调用[ CreateMemoryNode ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememorynode)接口手动创建记忆片段。'."\n"
- .'- 本接口不具备幂等性。'."\n"
- ."\n"
- .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Data\\": {\\n \\"Id\\": \\"42687eb254a34802bed398357f5498ae\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Code\\": \\"Index.InvalidParameter\\"\\n}","type":"json"}]',
],
- 'GetMemory' => [
- 'summary' => '获取指定长期记忆体的描述信息。',
- 'path' => '/{workspaceId}/memories/{memoryId}',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'SubmitIndexJob' => [
+ 'summary' => '提交指定的 CreateIndex 任务以完成知识库创建。',
+ 'path' => '/{WorkspaceId}/index/submit_index_job',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'."\n"],
],
[
- 'name' => 'memoryId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体 ID,对应 [CreateMemory](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory) 接口返回的`memoryId`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbxxxx'."\n",
- ],
+ 'name' => 'IndexId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即 **CreateIndex** 接口返回的`Data.Id`。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
],
],
'responses' => [
@@ -7490,115 +6403,117 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'description' => [
- 'description' => '长期记忆体的描述信息。',
- 'type' => 'string',
- 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体',
- ],
- 'memoryId' => [
- 'description' => '长期记忆体 ID。',
- 'type' => 'string',
- 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx',
- ],
- 'workspaceId' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。',
- 'type' => 'string',
- 'example' => 'llm-3z7uw7fwz0vexxxx',
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'Index.InvalidParameter'],
+ 'Data' => [
+ 'description' => '接口返回的业务字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'Id' => ['description' => '任务 ID,即调用 **GetIndexJobStatus** 接口时需要用到的任务`JobId`。', 'type' => 'string', 'example' => 'eFDr2fGRzP9gdDZWAdo3xxxx'],
+ 'IndexId' => ['description' => '知识库 ID。', 'type' => 'string', 'example' => '79c0alxxxx'],
+ ],
],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '17204B98-xxxx-4F9A-8464-2446A84821CA'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
'errorCodes' => [
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- ],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
+ 400 => [
+ ['errorCode' => 'RagIndex.IdempotentParameterMismatch', 'errorMessage' => 'The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.', 'description' => '该请求使用与先前但不相同的请求相同的客户端令牌。不要重复使用具有不同请求的客户端令牌,除非请求相同。'],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"description\\": \\"我的大模型应用$APP_ID关于A用户的长期记忆体\\",\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbdxxxx\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\",\\n \\"workspaceId\\": \\"llm-3z7uw7fwz0vexxxx\\"\\n}","type":"json"}]',
- 'title' => '获取长期记忆体',
- 'description' => '- 本接口具有幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.InvalidParameter\\",\\n \\"Data\\": {\\n \\"Id\\": \\"eFDr2fGRzP9gdDZWAdo3xxxx\\",\\n \\"IndexId\\": \\"79c0alxxxx\\"\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"17204B98-xxxx-4F9A-8464-2446A84821CA\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '提交知识库创建任务',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:SubmitIndexJob权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 调用本接口前,您必须预先调用 **CreateIndex** 接口,并且获取到对应的`IndexId`。'."\n"
+ .'- 调用本接口后,任务需一定时间执行,高峰期可能耗时数小时。任务完成前请勿重复发起请求。如果需要查询任务的执行状态,可调用 **GetIndexJobStatus** 接口查询。'."\n"
+ .'- 知识库创建完成后,接下来您便可以在<props="china">[应用管理](https://bailian.console.aliyun.com/?tab=app#/app-center)</props><props="intl">[应用管理](https://modelstudio.console.alibabacloud.com/?tab=app#/app-center)</props>中将创建好的知识库与您位于相同的业务空间里的智能体应用<props="china">或者工作流应用</props>'."\n"
+ .'关联(或者通过[应用调用](~~2846132~~)的`rag_options`传入`IndexID`),以便为您的阿里云百炼应用补充私有知识和提供最新信息。当然,您也可以选择不使用阿里云百炼应用,直接通过调用 **Retrieve** 接口来查询知识库。'."\n"
+ .'- 本接口不具备幂等性。'."\n"
."\n"
- .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
- ],
- 'UpdateMemory' => [
- 'summary' => '更新指定长期记忆体的描述信息。',
- 'path' => '/{workspaceId}/memories/{memoryId}',
- 'methods' => [
- 'put',
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SubmitIndexJob'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:SubmitIndexJob',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'UpdateChunk' => [
+ 'summary' => '修改知识库中指定文本切片的内容(content)和标题(title),并设置是否参与知识库检索。',
+ 'path' => '/{WorkspaceId}/chunk/update',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'workspaceId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'name' => 'PipelineId',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库 ID,即通过 **CreateIndex** 接口创建时返回的`Data.Id`,或在<props="china">[知识库](https://bailian.console.aliyun.com/?tab=app#/knowledge-base)</props><props="intl">[知识库](https://modelstudio.console.alibabacloud.com/?tab=app#/knowledge-base)</props>页面获取。', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'."\n"],
],
[
- 'name' => 'memoryId',
+ 'name' => 'DataId',
+ 'in' => 'query',
+ 'schema' => ['description' => '文件 ID,即 **AddFile** 接口返回的`FileId`,也可在阿里云百炼控制台的<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)-文件</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)-文件</props>页签,单击对应文件旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'doc_c134aa2073204a5d936d870bf960f56axxxxxxxx'."\n"],
+ ],
+ [
+ 'name' => 'ChunkId',
+ 'in' => 'query',
+ 'schema' => ['description' => '需要修改的文本切片ID,可通过 **ListChunks** 接口获取,其值位于返回结果中Node.Metadata._id字段。', 'type' => 'string', 'required' => true, 'example' => 'llm-5ip55o1zrzxx_09fe52x_xxxxx_033b551e10024029992e79767b151fxx_10024xx_0'],
+ ],
+ [
+ 'name' => 'IsDisplayedChunkContent',
+ 'in' => 'query',
+ 'schema' => ['description' => '指定此文本切片是否参与知识库检索。可能值:'."\n"
+ ."\n"
+ .'- true:参与。'."\n"
+ .'- false:不参与。'."\n"
+ ."\n"
+ .'默认值为true。', 'type' => 'boolean', 'required' => true, 'example' => 'true'],
+ ],
+ [
+ 'name' => 'content',
+ 'in' => 'query',
+ 'schema' => ['description' => '文本切片的新内容。内容长度必须在10到6000个字符之间,且不能超过创建知识库时设定的最大分段长度。', 'type' => 'string', 'required' => true, 'example' => '在哲学中所获得的确定性类型不是科学的确定性(即对每个人的理智来说都一样的确定性),而是一种要在人类的整体本质中才能获得的亲证。哲学的每一形态都不同于科学,因为所有的哲学都没有得到一致的认可...'],
+ ],
+ [
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体 ID,对应[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口返回的`memoryId`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx',
- ],
+ 'schema' => ['description' => '知识库所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'."\n"],
],
[
- 'name' => 'description',
+ 'name' => 'title',
'in' => 'query',
- 'schema' => [
- 'title' => '长期记忆描述信息',
- 'description' => '新的描述信息。长度为 1~50 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。',
- 'type' => 'string',
- 'required' => false,
- 'example' => '我的大模型应用$APP_ID关于B用户的长期记忆体'."\n",
- ],
+ 'schema' => ['description' => '文本切片的新标题。长度限制为0-50个字符,允许传入空字符串。如果传入空字符串,将清空已有标题;如果不传此参数,则保持原标题不变。', 'type' => 'string', 'required' => false, 'example' => '什么是哲学'],
],
],
'responses' => [
@@ -7608,94 +6523,85 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx',
- ],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string'],
+ 'Message' => ['description' => '错误信息。', 'type' => 'string'],
+ 'Success' => ['description' => '接口调用是否成功,可能值:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
+ 'Data' => ['description' => '请求成功返回的业务数据。', 'type' => 'boolean', 'example' => 'true'],
+ 'Status' => ['description' => '接口返回的状态码。', 'type' => 'string', 'example' => '"200"'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'Memory.DescriptionInvalid',
- 'errorMessage' => 'Input parameter description is invalid.',
- ],
- ],
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- ],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Code\\": \\"\\",\\n \\"Message\\": \\"\\",\\n \\"Success\\": true,\\n \\"Data\\": true,\\n \\"Status\\": \\"\\\\\\"200\\\\\\"\\"\\n}","type":"json"}]',
+ 'title' => '修改切片',
+ 'description' => '- **关键限制**:本接口仅支持文档搜索类知识库,不支持数据查询和图片问答类知识库。'."\n"
+ .'- **权限要求**:'."\n"
+ .' - **RAM用户(子账号)**:需先获取阿里云百炼的[API权限](~~2848578~~)(可使用`AliyunBailianDataFullAccess`策略,该策略已包含本接口所需的sfm:UpdateChunk权限点),并[加入一个业务空间](~~2851098~~)后,才能调用本接口。'."\n"
+ .' - **阿里云账号(主账号)**:默认拥有权限,可直接调用。'."\n"
+ .'- **调用方式**:推荐使用最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>调用,SDK已封装复杂的签名计算逻辑,可简化您的调用过程。'."\n"
+ .'- **生效延迟**:更新后通常立即生效,高峰期可能稍有延迟(秒级)。'."\n"
+ .'- **幂等性**:本接口具有幂等性。对已成功更新的文本切片进行重复操作时,接口将返回成功响应。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过10次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateChunk',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\"\\n}","type":"json"}]',
- 'title' => '更新长期记忆体',
- 'description' => '- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
],
- 'DeleteMemory' => [
- 'summary' => '永久性删除指定的长期记忆体。',
- 'path' => '/{workspaceId}/memories/{memoryId}',
- 'methods' => [
- 'delete',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'UpdateConnector' => [
+ 'summary' => '编辑连接器',
+ 'path' => '/{WorkspaceId}/datacenter/connector/{ConnectorId}',
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free', 'autoTest' => true],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx',
- ],
+ 'schema' => ['description' => '业务空间 ID', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
- 'name' => 'memoryId',
+ 'name' => 'ConnectorId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体 ID,对应[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口返回的`memoryId`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx'."\n",
- ],
+ 'schema' => ['description' => '所属数据连接(Connector)的实例id,请到百炼控制台获取。', 'type' => 'string', 'required' => true, 'example' => 'conn_xxxx'],
+ ],
+ [
+ 'name' => 'ConnectorName',
+ 'in' => 'formData',
+ 'schema' => ['title' => '连接器名称', 'description' => '连接器名称', 'type' => 'string', 'required' => true, 'example' => 'test-connector', 'maxLength' => 20, 'minLength' => 1],
+ ],
+ [
+ 'name' => 'Description',
+ 'in' => 'formData',
+ 'schema' => ['title' => '描述', 'description' => '描述', 'type' => 'string', 'required' => true, 'example' => 'never_delete_aeip_95_us-west-1', 'maxLength' => 200, 'minLength' => 1],
],
],
'responses' => [
@@ -7705,103 +6611,82 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n",
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'Index.Forbidden'],
+ 'Data' => [
+ 'description' => '接口业务数据字段'."\n"
+ ."\n",
+ 'type' => 'object',
+ 'properties' => [
+ 'ConnectorId' => ['title' => '连接器id', 'description' => '连接器id', 'type' => 'string', 'example' => 'conn_file_e0c9db4030b2465a9478028f7d76cd92_1234'],
+ ],
],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '778C0B3B-03C1-5FC1-A947-36EDD13606AB'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '是否成功', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'errorCodes' => [
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- ],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\"\\n}","type":"json"}]',
- 'title' => '删除长期记忆体',
- 'description' => '- 调用本接口前,请确保您的长期记忆体已经创建完成且未被删除(即`memoryId`有效)。'."\n"
- .'- 删除操作不可逆,被删的长期记忆体包括它的所有长期记忆体节点将无法恢复,且[ GetMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-getmemory)接口将无法再获取其相关信息,请谨慎操作。'."\n"
- .'- 本接口具有幂等性。'."\n"
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '编辑连接器',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:UpdateConnector权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口不具备幂等性。'."\n"
."\n"
- .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
- ],
- 'ListMemories' => [
- 'summary' => '获取指定业务空间下一个或多个长期记忆体的详细信息。',
- 'path' => '/{workspaceId}/memories',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
],
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Index.Forbidden\\",\\n \\"Data\\": {\\n \\"ConnectorId\\": \\"conn_file_e0c9db4030b2465a9478028f7d76cd92_1234\\"\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"778C0B3B-03C1-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ 'UpdateFileTag' => [
+ 'summary' => '更新指定文件标签。',
+ 'path' => '/{WorkspaceId}/datacenter/file/{FileId}',
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
- 'operationType' => 'list',
+ 'operationType' => 'update',
'riskType' => 'none',
'chargeType' => 'free',
+ 'abilityTreeNodes' => ['FEATUREsfm8JET0F'],
+ 'autoTest' => true,
+ 'tenantRelevance' => 'tenant',
],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-3z7uw7fwz0vexxxx'."\n",
- ],
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
- 'name' => 'maxResults',
- 'in' => 'query',
- 'schema' => [
- 'title' => '最大返回数量',
- 'description' => '分页查询时每页行数。取值范围[1-50]。'."\n"
- ."\n"
- .'默认值: 当不设置值时,默认值为 10。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'example' => '10',
- ],
+ 'name' => 'FileId',
+ 'in' => 'path',
+ 'schema' => ['description' => '数据中心的文件 ID,您可以在<props="china">[应用数据](https://bailian.console.aliyun.com/?tab=app#/data-center)</props><props="intl">[应用数据](https://modelstudio.console.alibabacloud.com/?tab=app#/data-center)</props>页面,单击文件名称旁的 ID 图标获取。', 'type' => 'string', 'required' => true, 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
],
[
- 'name' => 'nextToken',
- 'in' => 'query',
+ 'name' => 'Tags',
+ 'in' => 'formData',
+ 'style' => 'json',
'schema' => [
- 'title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页',
- 'description' => '查询凭证(Token),取值为上一次 API 调用返回的 NextToken 参数值。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'dc270401186b433f975d7e1faaa3xxxx',
+ 'title' => '文档标签,单个文档最多支持添加10个标签',
+ 'description' => '- 文件关联的标签列表。最多传入100个标签,所有标签字符长度总和不能超过700。',
+ 'type' => 'array',
+ 'items' => ['description' => '标签值,每个标签最多32个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等),下划线_,中划线-,标签中不能包含空格。', 'type' => 'string', 'required' => false, 'example' => '标签A'],
+ 'required' => true,
+ 'maxItems' => 100,
+ 'minItems' => 1,
],
],
],
@@ -7812,153 +6697,135 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'maxResults' => [
- 'description' => '分页查询时每页长期记忆体的数量。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '10',
- ],
- 'memories' => [
- 'description' => '长期记忆体列表。',
- 'type' => 'array',
- 'items' => [
- 'description' => '长期记忆体对象。',
- 'type' => 'object',
- 'properties' => [
- 'description' => [
- 'description' => '长期记忆体的描述信息。',
- 'type' => 'string',
- 'example' => '我的大模型应用$APP_ID关于A用户的长期记忆体',
- ],
- 'memoryId' => [
- 'description' => '长期记忆体 ID。',
- 'type' => 'string',
- 'example' => '3fc531f4519444beaafffa4538f6xxxx',
- ],
- ],
+ 'Code' => ['description' => '错误状态码', 'type' => 'string', 'example' => 'Success'],
+ 'Data' => [
+ 'description' => '返回内容',
+ 'type' => 'object',
+ 'properties' => [
+ 'FileId' => ['description' => '文件 ID', 'type' => 'string', 'example' => 'file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx'],
],
],
- 'nextToken' => [
- 'description' => '本次调用返回的查询凭证值。',
- 'type' => 'string',
- 'example' => 'dc270401186b433f975d7e1faaa3xxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n",
- ],
- 'totalCount' => [
- 'description' => '返回结果的总条数。',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '105',
- ],
- 'workspaceId' => [
- 'title' => '业务空间Id',
- 'description' => '长期记忆体列表所属的业务空间 ID。',
- 'type' => 'string',
- 'example' => 'llm-3z7uw7fwz0vexxxx'."\n",
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Requests throttling triggered.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID。', 'type' => 'string', 'example' => '35A267BF-xxxx-54DB-8394-AA3B0742D833'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ ."\n"
+ .'- true:成功。'."\n"
+ .'- false:失败。', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'Memory.MaxResultsInvalid',
- 'errorMessage' => 'Input parameter maxResults is invalid.',
- ],
- [
- 'errorCode' => 'Memory.NextTokenInvalid',
- 'errorMessage' => 'Input parameter nextToken is invalid.',
- ],
- ],
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"Success\\",\\n \\"Data\\": {\\n \\"FileId\\": \\"file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx\\"\\n },\\n \\"Message\\": \\"Requests throttling triggered.\\",\\n \\"RequestId\\": \\"35A267BF-xxxx-54DB-8394-AA3B0742D833\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ 'title' => '更新文件标签',
+ 'description' => '- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:UpdateFileTag权限点),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [
+ ['createdAt' => '2025-09-28T10:20:10.000Z', 'description' => '请求参数发生变更'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateFileTag'],
],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateFileTag',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 10,\\n \\"memories\\": [\\n {\\n \\"description\\": \\"我的大模型应用$APP_ID关于A用户的长期记忆体\\",\\n \\"memoryId\\": \\"3fc531f4519444beaafffa4538f6xxxx\\"\\n }\\n ],\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa3xxxx\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"totalCount\\": 105,\\n \\"workspaceId\\": \\"llm-3z7uw7fwz0vexxxx\\\\n\\"\\n}","type":"json"}]',
- 'title' => '获取长期记忆体列表',
- 'description' => '- 分页查询首页时,仅需设置`MaxResults`以限制返回信息的条目数,返回结果中的`NextToken`将作为查询后续页的凭证。查询后续页时,将`NextToken`参数设置为上一次返回结果中获取到的`NextToken`作为查询凭证(如果`NextToken`为空,表示结果已经完全返回,不需要再请求),并设置`MaxResults`限制返回条目数。'."\n"
- .'- 本接口具有幂等性。'."\n"
- ."\n"
- .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
],
- 'CreateMemoryNode' => [
- 'summary' => '创建记忆片段。',
- 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes',
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'UpdateIndex' => [
+ 'summary' => '更新指定知识库的部分配置。',
+ 'path' => '/{WorkspaceId}/index/update',
+ 'methods' => ['post'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'create',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'schema' => ['description' => '业务空间 ID', 'type' => 'string', 'required' => true, 'example' => 'llm-3shx2gu255oqxxxx'],
],
[
- 'name' => 'memoryId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体 ID。即 **CreateMemory** 接口返回的`memoryId`。',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n",
- ],
+ 'name' => 'Id',
+ 'in' => 'query',
+ 'allowEmptyValue' => false,
+ 'schema' => ['title' => '幂等参数', 'description' => '知识库 ID', 'type' => 'string', 'required' => true, 'example' => '79c0alxxxx'],
],
[
- 'name' => 'content',
+ 'name' => 'Name',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库名称', 'type' => 'string', 'required' => false, 'example' => '企业帮助文档库'],
+ ],
+ [
+ 'name' => 'Description',
+ 'in' => 'query',
+ 'schema' => ['description' => '知识库描述', 'type' => 'string', 'required' => false, 'example' => '企业知识库'],
+ ],
+ [
+ 'name' => 'RerankMinScore',
+ 'in' => 'query',
+ 'schema' => ['description' => '排序最低分数,取值范围[0-1]', 'type' => 'string', 'required' => false, 'example' => '0.01'],
+ ],
+ [
+ 'name' => 'DenseSimilarityTopK',
+ 'in' => 'query',
+ 'schema' => ['description' => '向量检索 Top K,通过生成输入文本的向量并在知识库中检索与其向量表示最相似的 K 个文本切片。K的取值范围[0-100]。'."\n"
+ .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
+ ."\n"
+ .'默认值为100。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '100', 'minimum' => '0', 'example' => '100', 'default' => '100'],
+ ],
+ [
+ 'name' => 'SparseSimilarityTopK',
+ 'in' => 'query',
+ 'schema' => ['description' => '关键词检索TopK,即在知识库中查找与输入文本的关键词精确匹配的切片。它可以帮助您过滤掉无关的文本切片,提供更准确的结果。'."\n"
+ .'取值范围[0-100]。'."\n"
+ .'`DenseSimilarityTopK`和`SparseSimilarityTopK`二者之和小于等于200。'."\n"
+ ."\n"
+ .'默认值为:100。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '100', 'minimum' => '0', 'example' => '100', 'default' => '100'],
+ ],
+ [
+ 'name' => 'PipelineCommercialType',
'in' => 'query',
'schema' => [
- 'title' => '长期记忆内容',
- 'description' => '记忆片段内容。长度为 1~200 个字符,支持中文、英文、数字、下划线(_)、短划线(-)、半角句号(.)和半角冒号(:)。',
+ 'description' => '知识库的规格类型。取值范围:'."\n"
+ ."\n"
+ .'- standard:标准版'."\n"
+ ."\n"
+ .'- enterprise:旗舰版',
'type' => 'string',
- 'required' => true,
- 'example' => '用户喜欢吃西红柿炒鸡蛋',
+ 'required' => false,
+ 'example' => 'standard',
+ 'enum' => ['standard', 'enterprise'],
],
],
+ [
+ 'name' => 'PipelineCommercialCu',
+ 'in' => 'query',
+ 'schema' => ['description' => '指定旗舰版知识库的 RCU 数量,即仅当 pipelineCommercialType 指定 enterprise 时才需要传入。'."\n"
+ ."\n"
+ .'取值范围:[1-200]。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'maximum' => '200', 'minimum' => '1', 'example' => '3'],
+ ],
],
'responses' => [
200 => [
@@ -7967,112 +6834,72 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'memoryNodeId' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段 ID。',
- 'type' => 'string',
- 'example' => '68de06c95368463a8be4a84efcxxxxxx',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5',
+ 'RequestId' => ['title' => 'Id of the request', 'description' => '请求 ID', 'type' => 'string', 'example' => '17204B98-7734-4F9A-8464-xxx'],
+ 'Data' => [
+ 'description' => '接口业务数据字段',
+ 'type' => 'object',
+ 'properties' => [
+ 'Id' => ['description' => '知识库ID', 'type' => 'string', 'example' => '79c0alxxxx'],
+ ],
],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '接口调用是否成功,可能值为:'."\n"
+ ."\n"
+ .'true:成功'."\n"
+ ."\n"
+ .'false:失败', 'type' => 'boolean', 'example' => 'true'],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'Code' => ['description' => '状态码', 'type' => 'string', 'example' => 'Success'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'Memory.MemoryNodeContentInvalid',
- 'errorMessage' => 'Memory node content is invalid.',
- ],
- ],
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- [
- 'errorCode' => 'Memory.MemoryNodeNotFound',
- 'errorMessage' => 'MemoryNode not found.',
- ],
- ],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
- ],
- ],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'errorCodes' => [],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '更新知识库',
+ 'description' => '<props="intl">本接口不支持国际站。</props>'."\n"
+ .'<props="china">'."\n"
+ .'RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`),并[加入一个业务空间](~~2851098~~)后,方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)来调用本接口。'."\n"
+ .'调用本接口前,请确保您的知识库已经创建完成且未被删除(即知识库 ID`IndexId`有效)。'."\n"
+ .'本接口具有幂等性。</props>',
+ 'requestParamsDescription' => '参数Name,Description,RerankMinScore ,至少填写一项,不能同时为空。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efcxxxxxx\\",\\n \\"requestId\\": \\"8C56C7AF-xxxx-19CE-B018-E05E1EDCF4C5\\"\\n}","type":"json"}]',
- 'title' => '创建记忆片段',
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"17204B98-7734-4F9A-8464-xxx\\",\\n \\"Data\\": {\\n \\"Id\\": \\"79c0alxxxx\\"\\n },\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true,\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"Code\\": \\"Success\\"\\n}","type":"json"}]',
],
- 'GetMemoryNode' => [
- 'summary' => '获取记忆片段。',
- 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes/{memoryNodeId}',
- 'methods' => [
- 'get',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'UpdateMemory' => [
+ 'summary' => '更新指定长期记忆体的描述信息。',
+ 'path' => '/{workspaceId}/memories/{memoryId}',
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'get',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '长期记忆体所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vexxxx'],
],
[
'name' => 'memoryId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n",
- ],
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体 ID,对应[ CreateMemory ](https://help.aliyun.com/zh/model-studio/developer-reference/api-bailian-2023-12-29-creatememory)接口返回的`memoryId`。', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbdxxxx'],
],
[
- 'name' => 'memoryNodeId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '68de06c95368463a8be4a84efc872cc5'."\n",
- ],
+ 'name' => 'description',
+ 'in' => 'query',
+ 'schema' => ['title' => '长期记忆描述信息', 'description' => '新的描述信息。长度为 1~50 个字符,支持 Unicode 中 letter 分类下的字符(其中包括英文、中文和数字等)。可以包含半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。', 'type' => 'string', 'required' => false, 'example' => '我的大模型应用$APP_ID关于B用户的长期记忆体'."\n"],
],
],
'responses' => [
@@ -8082,141 +6909,83 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'content' => [
- 'title' => '长期记忆节点内容',
- 'description' => '记忆片段内容',
- 'type' => 'string',
- 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n",
- ],
- 'memoryId' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体Id',
- 'type' => 'string',
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n",
- ],
- 'memoryNodeId' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段Id',
- 'type' => 'string',
- 'example' => '68de06c95368463a8be4a84efc872cc5',
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'."\n",
- ],
- 'workspaceId' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求 ID。', 'type' => 'string', 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'],
],
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'Memory.MemoryNodeContentInvalid',
- 'errorMessage' => 'Memory node content is invalid.',
- ],
+ ['errorCode' => 'Memory.DescriptionInvalid', 'errorMessage' => 'Input parameter description is invalid.', 'description' => '长期记忆的描述信息无效'],
],
404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- [
- 'errorCode' => 'Memory.MemoryNodeNotFound',
- 'errorMessage' => 'MemoryNode not found.',
- ],
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
],
500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
+ ],
+ ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\"\\n}","type":"json"}]',
+ 'title' => '更新长期记忆体',
+ 'description' => '- 本接口具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:** 请确保两次请求间隔至少 1 秒,否则可能触发系统限流。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateMemory'],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"content\\": \\"用户喜欢吃西红柿炒鸡蛋\\\\n\\",\\n \\"memoryId\\": \\"6bff4f317a14442fbc9f73d29dbd5fc3\\\\n\\",\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efc872cc5\\",\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\\\n\\",\\n \\"workspaceId\\": \\"llm-us9hjmt32nysdm5v\\\\n\\"\\n}","type":"json"}]',
- 'title' => '获取记忆片段',
],
'UpdateMemoryNode' => [
'summary' => '更新记忆片段。',
'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes/{memoryNodeId}',
- 'methods' => [
- 'put',
- ],
- 'schemes' => [
- 'https',
- ],
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdm5v'."\n"],
],
[
'name' => 'memoryId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n",
- ],
+ 'schema' => ['title' => '长期记忆Id', 'description' => '长期记忆体Id', 'type' => 'string', 'required' => true, 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n"],
],
[
'name' => 'memoryNodeId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '68de06c95368463a8be4a84efc872cc5',
- ],
+ 'schema' => ['title' => '长期记忆节点Id', 'description' => '记忆片段Id', 'type' => 'string', 'required' => true, 'example' => '68de06c95368463a8be4a84efc872cc5'],
],
[
'name' => 'content',
'in' => 'query',
- 'schema' => [
- 'title' => '长期记忆内容',
- 'description' => '记忆片段内容',
- 'type' => 'string',
- 'required' => true,
- 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n",
- ],
+ 'schema' => ['title' => '长期记忆内容', 'description' => '记忆片段内容', 'type' => 'string', 'required' => true, 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n"],
],
],
'responses' => [
@@ -8226,106 +6995,81 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'."\n",
- ],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5'."\n"],
],
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'Memory.MemoryNodeContentInvalid',
- 'errorMessage' => 'Memory node content is invalid.',
- ],
+ ['errorCode' => 'Memory.MemoryNodeContentInvalid', 'errorMessage' => 'Memory node content is invalid.', 'description' => '长期记忆节点的内容无效'],
],
404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- [
- 'errorCode' => 'Memory.MemoryNodeNotFound',
- 'errorMessage' => 'MemoryNode not found.',
- ],
+ ['errorCode' => 'Memory.MemoryIdNotFound', 'errorMessage' => 'Memory Id not exist or is not authorized.', 'description' => 'memoryId 未找到'],
+ ['errorCode' => 'Memory.MemoryNodeNotFound', 'errorMessage' => 'MemoryNode not found.', 'description' => '长期记忆节点未找到'],
],
500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
+ ['errorCode' => 'Memory.InternalError', 'errorMessage' => 'Memory service inner exception.', 'description' => '长期记忆服务内部异常。'."\n"],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
+ 'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\\\n\\"\\n}","type":"json"}]',
'title' => '更新记忆片段',
- ],
- 'DeleteMemoryNode' => [
- 'summary' => '删除记忆片段。',
- 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes/{memoryNodeId}',
- 'methods' => [
- 'delete',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateMemoryNode'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'UpdatePromptTemplate' => [
+ 'summary' => '基于模板Id增量更新Prompt模板。',
+ 'path' => '/{workspaceId}/promptTemplates/{promptTemplateId}',
+ 'methods' => ['patch'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'delete',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- ],
+ 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'free'],
'parameters' => [
[
'name' => 'workspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'schema' => ['title' => '业务空间Id', 'description' => '业务空间Id', 'type' => 'string', 'required' => true, 'example' => 'llm-us9hjmt32nysdxxx'],
],
[
- 'name' => 'memoryId',
+ 'name' => 'promptTemplateId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3'."\n",
- ],
+ 'schema' => ['title' => 'prompt模板Id', 'description' => 'prompt模板Id', 'type' => 'string', 'required' => true, 'example' => '6e49109bfeb94a39bb268f4e483ccxxx'],
],
[
- 'name' => 'memoryNodeId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '68de06c95368463a8be4a84efc872cc5',
- ],
+ 'name' => 'name',
+ 'in' => 'query',
+ 'schema' => ['title' => '模板名称', 'description' => '模板名称', 'type' => 'string', 'required' => false, 'example' => '小红书文案助手'],
+ ],
+ [
+ 'name' => 'content',
+ 'in' => 'query',
+ 'schema' => ['title' => 'prompt模板内容', 'description' => 'prompt模板内容', 'type' => 'string', 'required' => false, 'example' => '请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}'],
],
],
'responses' => [
@@ -8335,122 +7079,104 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => '8C56C7AF-6573-19CE-B018-E05E1EDCF4C5',
- ],
+ 'requestId' => ['title' => '请求Id', 'description' => '请求Id', 'type' => 'string', 'example' => 'FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx'."\n"],
],
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'Memory.MemoryNodeContentInvalid',
- 'errorMessage' => 'Memory node content is invalid.',
- ],
+ ['errorCode' => 'PromptTemplate.ContentInvalid', 'errorMessage' => 'Input parameter Content is invalid.', 'description' => '入参Content的格式无效。'],
+ ['errorCode' => 'PromptTemplate.NameInvalid', 'errorMessage' => 'Input parameter Name is invalid.', 'description' => '输入参数Name的格式无效。'],
],
404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
- ],
- [
- 'errorCode' => 'Memory.MemoryNodeNotFound',
- 'errorMessage' => 'MemoryNode not found.',
- ],
+ ['errorCode' => 'PromptTemplate.TemplateNotFound', 'errorMessage' => 'Prompt template not found.', 'description' => '未找到Prompt模板'],
],
500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
- ],
+ ['errorCode' => 'PromptTemplate.InternalError', 'errorMessage' => 'Prompt template service inner exception.', 'description' => 'prompt模板服务内部异常'],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
- ],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"8C56C7AF-6573-19CE-B018-E05E1EDCF4C5\\"\\n}","type":"json"}]',
- 'title' => '删除记忆片段',
- ],
- 'ListMemoryNodes' => [
- 'summary' => '获取记忆片段列表。',
- 'path' => '/{workspaceId}/memories/{memoryId}/memoryNodes',
- 'methods' => [
- 'get',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\\\\n\\"\\n}","type":"json"}]',
+ 'title' => '更新Prompt模板',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdatePromptTemplate'],
+ ],
],
- 'schemes' => [
- 'https',
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdatePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'UpdateTableFromAuthorizedOss' => [
+ 'summary' => '使用已授权OSS Bucket中的文件更新阿里云百炼数据连接中表格连接器中的表格。',
+ 'path' => '/{WorkspaceId}/datacenter/table/fromoss/{TableId}',
+ 'methods' => ['put'],
+ 'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
- 'consumes' => [
- 'application/json',
- ],
- 'produces' => [
- 'application/json',
- ],
- 'operationType' => 'write',
+ 'consumes' => ['application/json'],
+ 'produces' => ['application/json'],
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
- 'operationType' => 'list',
+ 'operationType' => 'update',
'riskType' => 'none',
'chargeType' => 'free',
+ 'abilityTreeNodes' => ['FEATUREsfm8JET0F'],
+ 'autoTest' => true,
+ 'tenantRelevance' => 'tenant',
],
'parameters' => [
[
- 'name' => 'workspaceId',
+ 'name' => 'WorkspaceId',
'in' => 'path',
- 'schema' => [
- 'title' => '业务空间Id',
- 'description' => '业务空间Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-us9hjmt32nysdm5v'."\n",
- ],
+ 'schema' => ['description' => '文件所属的业务空间 ID。获取方式请参见[如何使用业务空间](~~2587495~~)。', 'type' => 'string', 'required' => true, 'example' => 'llm-3z7uw7fwz0vxxxx'],
],
[
- 'name' => 'memoryId',
+ 'name' => 'TableId',
'in' => 'path',
- 'schema' => [
- 'title' => '长期记忆Id',
- 'description' => '长期记忆体Id',
- 'type' => 'string',
- 'required' => true,
- 'example' => '6bff4f317a14442fbc9f73d29dbd5fc3',
- ],
+ 'schema' => ['title' => '表格ID', 'description' => '更新的表格ID', 'type' => 'string', 'required' => true, 'example' => 'table_100b51399c404966b7d49f71e388a3fd_12738336'],
],
[
- 'name' => 'maxResults',
- 'in' => 'query',
- 'allowEmptyValue' => true,
- 'schema' => [
- 'title' => '最大返回数量',
- 'description' => '最大返回数量',
- 'type' => 'integer',
- 'format' => 'int32',
- 'required' => false,
- 'maximum' => '50',
- 'minimum' => '1',
- 'example' => '20',
- 'default' => '10',
- ],
+ 'name' => 'OssBucket',
+ 'in' => 'formData',
+ 'schema' => ['title' => '表格类型,当前仅支持“LOCAL”', 'description' => 'OSS Bucket名称,详见[存储空间](~~177682~~)。', 'type' => 'string', 'required' => true, 'example' => 'yinghuo-ai'],
],
[
- 'name' => 'nextToken',
- 'in' => 'query',
- 'allowEmptyValue' => true,
+ 'name' => 'OssRegionId',
+ 'in' => 'formData',
+ 'schema' => ['title' => '要上传的Excel文件URL,必须为公网可访问URL,建议可以先上传到自己OSS,然后生成一个临时授权访问链接。', 'description' => 'OSS Bucket的地域ID。获取方式请参见[OSS地域和访问域名](~~31837~~)。', 'type' => 'string', 'required' => true, 'example' => 'cn-beijing'],
+ ],
+ [
+ 'name' => 'OssKey',
+ 'in' => 'formData',
+ 'schema' => ['title' => '上传文件的类型,也就是文件后缀,仅支持xls和xlsx', 'description' => '导入文件在OSS Bucket中的键名(Key),详见[对象命名](~~273129~~)。', 'type' => 'string', 'required' => true, 'example' => 'a0deedbce4a8162b8d66c63ace28330c'],
+ ],
+ [
+ 'name' => 'UpdateMode',
+ 'in' => 'formData',
'schema' => [
- 'title' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页',
- 'description' => '由前一次的请求返回,传入时本次查询结果将基于前一次请求结果进行分页',
+ 'title' => '更新模式,仅支持APPEND(追加)和OVERWRITE(覆盖)',
+ 'description' => '更新模式,仅支持APPEND(追加)和OVERWRITE(覆盖)',
'type' => 'string',
- 'required' => false,
- 'example' => 'dc270401186b433f975d7e1faaa34e0e'."\n",
+ 'required' => true,
+ 'example' => 'OVERWRITE',
+ 'enum' => ['APPEND', 'OVERWRITE'],
],
],
],
@@ -8461,508 +7187,840 @@
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
- 'maxResults' => [
- 'title' => '最大请求数量',
- 'description' => '最大请求数量',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '20',
- ],
- 'memoryNodes' => [
- 'title' => '长期记忆节点数组',
- 'description' => '记忆片段数组',
- 'type' => 'array',
- 'items' => [
- 'type' => 'object',
- 'properties' => [
- 'content' => [
- 'title' => '长期记忆节点内容',
- 'description' => '记忆片段内容',
- 'type' => 'string',
- 'example' => '用户喜欢吃西红柿炒鸡蛋'."\n",
- ],
- 'memoryNodeId' => [
- 'title' => '长期记忆节点Id',
- 'description' => '记忆片段Id',
- 'type' => 'string',
- 'example' => '68de06c95368463a8be4a84efc872cc5',
- ],
- ],
+ 'Code' => ['description' => '错误状态码。', 'type' => 'string', 'example' => 'DataCenter.FileTooLarge'],
+ 'Data' => [
+ 'description' => '接口业务数据字段。',
+ 'type' => 'object',
+ 'properties' => [
+ 'TableId' => ['title' => '和入参TableId一致', 'description' => '和入参TableId一致', 'type' => 'string', 'example' => 'table_df96ebd5da8640e5a0991b3d15f39d4d_12792097'],
+ 'Status' => ['title' => '当前表格状态,一般上传之后会变成“TO_IMPORT”,表示系统已经接收上传的文件,等待调度写入到数据表中', 'description' => '当前表格状态,一般上传之后会变成“TO_IMPORT”,表示系统已经接收上传的文件,等待调度写入到数据表中', 'type' => 'string', 'example' => 'TO_IMPORT'],
],
],
- 'nextToken' => [
- 'title' => '用于实现基于令牌的分页',
- 'description' => '用于实现基于令牌的分页',
- 'type' => 'string',
- 'example' => 'dc270401186b433f975d7e1faaa34e0e'."\n",
- ],
- 'requestId' => [
- 'title' => '请求Id',
- 'description' => '请求Id',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-114029103cad'."\n",
- ],
- 'totalCount' => [
- 'title' => '长期记忆节点总数',
- 'description' => '记忆片段总数',
- 'type' => 'integer',
- 'format' => 'int32',
- 'example' => '100'."\n",
- ],
+ 'Message' => ['description' => '错误信息', 'type' => 'string', 'example' => 'Required parameter(%s) missing or invalid, please check the request parameters.'],
+ 'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '7BA8ADD9-53D6-53F0-918F-A1E776AD230E'],
+ 'Status' => ['description' => '接口返回的状态码', 'type' => 'string', 'example' => '200'],
+ 'Success' => ['description' => '是否成功', 'type' => 'boolean', 'example' => 'true'],
],
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'Memory.MaxResultsInvalid',
- 'errorMessage' => 'Input parameter maxResults is invalid.',
+ 'staticInfo' => ['returnType' => 'synchronous'],
+ 'title' => '从已授权OSS Bucket中选择文件更新表格',
+ 'description' => '- 请确保该OSS Bucket与阿里云百炼同属一个阿里云账号(主账号),并已按[从OSS导入数据配置说明](~~2782155~~)完成授权。'."\n"
+ .' '."\n"
+ .' - 支持的Bucket存储类型不包括归档、冷归档或深度冷归档。支持内容加密的Bucket。支持公共读写/公共读/私有的Bucket。'."\n"
+ .' - 如需使用开启[Referer防盗链](~~2636937~~)的Bucket,须参考[仅允许受信任的网站访问](~~2636937~~)将域名`*.console.aliyun.com`添加到白名单Referer中。'."\n"
+ ."\n"
+ .'- RAM用户(子账号)需要首先获取阿里云百炼的[API权限](~~2848578~~)(需要`AliyunBailianDataFullAccess`,已包括sfm:UpdateTableFromAuthorizedOss权限点)并[加入一个业务空间](~~2851098~~)方可调用本接口。阿里云账号(主账号)可直接调用无须授权。建议您通过最新版<props="china">[阿里云百炼SDK](https://api.aliyun.com/api-tools/sdk/bailian?version=2023-12-29)</props><props="intl">[阿里云百炼SDK](https://api.alibabacloud.com/api-tools/sdk/bailian?version=2023-12-29)</props>来调用本接口。'."\n"
+ .'- 本接口不具有幂等性。'."\n"
+ ."\n"
+ .'**限流说明:**'."\n"
+ .'本接口频繁调用会被限流,频率请勿超过5次/秒。如遇限流,请稍后重试。',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [],
+ ],
+ 'ramActions' => [],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"TableId\\": \\"table_df96ebd5da8640e5a0991b3d15f39d4d_12792097\\",\\n \\"Status\\": \\"TO_IMPORT\\"\\n },\\n \\"Message\\": \\"Required parameter(%s) missing or invalid, please check the request parameters.\\",\\n \\"RequestId\\": \\"7BA8ADD9-53D6-53F0-918F-A1E776AD230E\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
+ ],
+ ],
+ 'endpoints' => [
+ ['regionId' => 'cn-beijing', 'regionName' => '华北2(北京)', 'areaId' => 'asiaPacific', 'areaName' => '亚太', 'public' => 'bailian.cn-beijing.aliyuncs.com', 'endpoint' => 'bailian.cn-beijing.aliyuncs.com', 'vpc' => 'bailian-vpc.cn-beijing.aliyuncs.com'],
+ ['regionId' => 'ap-southeast-1', 'regionName' => '新加坡', 'areaId' => 'asiaPacific', 'areaName' => '亚太', 'public' => 'bailian.ap-southeast-1.aliyuncs.com', 'endpoint' => 'bailian.ap-southeast-1.aliyuncs.com', 'vpc' => 'bailian-vpc.ap-southeast-1.aliyuncs.com'],
+ ],
+ 'errorCodes' => [
+ ['code' => 'DataCenter.AccessFileFailed', 'message' => 'Failed to read the uploaded file. Check whether the file has been uploaded successfully.', 'http_code' => 400, 'description' => '读取上传的文件失败,请检查是否成功上传了需要解析的文件。'],
+ ['code' => 'DataCenter.ExceedLimit', 'message' => 'You have reached the maximum number of upload files limit.', 'http_code' => 400, 'description' => '已经达到允许的最大上传文件数量。'],
+ ['code' => 'DataCenter.FileTooLarge', 'message' => 'The file size is too large.', 'http_code' => 400, 'description' => '文档大小超过限制,最大文档限制请参考百炼官方文档库。'],
+ ['code' => 'DataCenter.InternalError', 'message' => 'System inner exception.', 'http_code' => 500, 'description' => '系统内部调用异常。'],
+ ['code' => 'DataCenter.Throttling', 'message' => 'Calls are too frequent, triggering system throttling.', 'http_code' => 429, 'description' => '调用过于频繁,触发系统限流。请保证2次请求之间不低于15秒。'],
+ ['code' => 'EnterpriseData.UserDataIsEmpty', 'message' => 'Enterprise data user data is empty.', 'http_code' => 400, 'description' => '企业数据用户数据为空。'],
+ ['code' => 'LLMService.ApiKey.TokenCreateFailed', 'message' => 'Large language model ApiKey Token creation failed.', 'http_code' => 400, 'description' => '大语言模型ApiKey Token创建失败。'],
+ ['code' => 'LLMService.WorkspaceId.NotExists.', 'message' => 'you are not authorized to this workspace, or workspace not exists.', 'http_code' => 403, 'description' => '业务空间不存在或者无权限。'],
+ ['code' => 'Memory.DescriptionInvalid', 'message' => 'Input parameter description is invalid.', 'http_code' => 400, 'description' => '长期记忆的描述信息无效'],
+ ['code' => 'Memory.InternalError', 'message' => 'Memory service inner exception.', 'http_code' => 500, 'description' => '长期记忆服务内部异常。'."\n"],
+ ['code' => 'Memory.MaxResultsInvalid', 'message' => 'Input parameter maxResults is invalid.', 'http_code' => 400, 'description' => '入参maxResults是无效的'],
+ ['code' => 'Memory.MemoryIdNotFound', 'message' => 'Memory Id not exist or is not authorized.', 'http_code' => 404, 'description' => 'memoryId 未找到'],
+ ['code' => 'Memory.MemoryNodeContentInvalid', 'message' => 'Memory node content is invalid.', 'http_code' => 400, 'description' => '长期记忆节点的内容无效'],
+ ['code' => 'Memory.MemoryNodeNotFound', 'message' => 'MemoryNode not found.', 'http_code' => 404, 'description' => '长期记忆节点未找到'],
+ ['code' => 'Memory.NextTokenInvalid', 'message' => 'Input parameter nextToken is invalid.', 'http_code' => 400, 'description' => '入参nextToken是无效的。'],
+ ['code' => 'PromptTemplate.ContentInvalid', 'message' => 'Input parameter Content is invalid.', 'http_code' => 400, 'description' => '入参Content的格式无效。'],
+ ['code' => 'PromptTemplate.InternalError', 'message' => 'Prompt template service inner exception.', 'http_code' => 500, 'description' => 'prompt模板服务内部异常'],
+ ['code' => 'PromptTemplate.MaxResultsInvalid', 'message' => 'Input parameter MaxResults is invalid.', 'http_code' => 400, 'description' => '输入参数maxResults格式无效。'],
+ ['code' => 'PromptTemplate.NameInvalid', 'message' => 'Input parameter Name is invalid.', 'http_code' => 400, 'description' => '输入参数Name的格式无效。'],
+ ['code' => 'PromptTemplate.NextTokenInvalid', 'message' => 'Input parameter NextToken is invalid.', 'http_code' => 400, 'description' => '入参nextToken是无效的。'],
+ ['code' => 'PromptTemplate.TemplateNotFound', 'message' => 'Prompt template not found.', 'http_code' => 404, 'description' => '未找到Prompt模板'],
+ ['code' => 'PromptTemplate.TypeInvalid', 'message' => 'Input parameter type is invalid.', 'http_code' => 400, 'description' => '入参type格式无效。'],
+ ['code' => 'RagIndex.IdempotentParameterMismatch', 'message' => 'The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.', 'http_code' => 400, 'description' => '该请求使用与先前但不相同的请求相同的客户端令牌。不要重复使用具有不同请求的客户端令牌,除非请求相同。'],
+ ['code' => 'Train.Unsupport.Release', 'message' => 'Before releasing the resource group, take the model managed by the resource group offline.', 'http_code' => 403, 'description' => '请先将资源组管理的模型下线,再释放资源组.'],
+ ],
+ 'changeSet' => [
+ [
+ 'apis' => [
+ ['description' => '请求参数发生变更', 'api' => 'CreateIndex'],
+ ],
+ 'createdAt' => '2025-12-03T12:11:04.000Z',
+ 'description' => '',
+ ],
+ [
+ 'apis' => [
+ ['description' => '请求参数发生变更', 'api' => 'Retrieve'],
+ ],
+ 'createdAt' => '2024-07-23T08:07:57.000Z',
+ 'description' => '',
+ ],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteCategory'],
+ ['threshold' => '2000', 'countWindow' => 1, 'regionId' => '*', 'api' => 'Retrieve'],
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddCategory'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteMemory'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetPromptTemplate'],
+ ['threshold' => '-1', 'countWindow' => 1, 'regionId' => '*'],
+ ['threshold' => '15', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListIndexDocuments'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListIndices'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListMemories'],
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListFile'],
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddFilesFromAuthorizedOss'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateIndex'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteIndex'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetMemoryNode'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdatePromptTemplate'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListPromptTemplates'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListChunks'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetMemory'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteFile'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeletePromptTemplate'],
+ ['threshold' => '20', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetIndexJobStatus'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddFile'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteMemoryNode'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateMemory'],
+ ['threshold' => '1', 'countWindow' => 10, 'regionId' => '*', 'api' => 'ApplyTempStorageLease'],
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateFileTag'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreatePromptTemplate'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListMemoryNodes'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DescribeFile'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ApplyFileUploadLease'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SubmitIndexAddDocumentsJob'],
+ ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ListCategory'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateMemoryNode'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'UpdateMemoryNode'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'DeleteIndexDocument'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateMemory'],
+ ['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SubmitIndexJob'],
+ ],
+ ],
+ 'ram' => [
+ 'productCode' => 'SFM',
+ 'productName' => '大模型服务平台百炼',
+ 'ramCodes' => ['sfm'],
+ 'ramLevel' => '操作级',
+ 'ramConditions' => [],
+ 'ramActions' => [
+ [
+ 'apiName' => 'AddConnector',
+ 'description' => '新增连接器',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- [
- 'errorCode' => 'Memory.MemoryNodeContentInvalid',
- 'errorMessage' => 'Memory node content is invalid.',
+ ],
+ ],
+ [
+ 'apiName' => 'ChangeParseSetting',
+ 'description' => '修改类目解析设置',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:ChangeParseSetting',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- [
- 'errorCode' => 'Memory.NextTokenInvalid',
- 'errorMessage' => 'Input parameter nextToken is invalid.',
+ ],
+ ],
+ [
+ 'apiName' => 'UpdateConnector',
+ 'description' => '编辑连接器',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- 404 => [
- [
- 'errorCode' => 'Memory.MemoryIdNotFound',
- 'errorMessage' => 'Memory Id not exist or is not authorized.',
+ ],
+ [
+ 'apiName' => 'UpdateFileTag',
+ 'description' => '更新文件标签',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateFileTag',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
- [
- 'errorCode' => 'Memory.MemoryNodeNotFound',
- 'errorMessage' => 'MemoryNode not found.',
+ ],
+ ],
+ [
+ 'apiName' => 'AddCategory',
+ 'description' => '新增类目',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- 500 => [
- [
- 'errorCode' => 'Memory.InternalError',
- 'errorMessage' => 'Memory service inner exception.',
+ ],
+ [
+ 'apiName' => 'DeleteCategory',
+ 'description' => '删除类目',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ [
+ 'apiName' => 'UpdatePromptTemplate',
+ 'description' => '更新Prompt模板',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdatePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"maxResults\\": 20,\\n \\"memoryNodes\\": [\\n {\\n \\"content\\": \\"用户喜欢吃西红柿炒鸡蛋\\\\n\\",\\n \\"memoryNodeId\\": \\"68de06c95368463a8be4a84efc872cc5\\"\\n }\\n ],\\n \\"nextToken\\": \\"dc270401186b433f975d7e1faaa34e0e\\\\n\\",\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-114029103cad\\\\n\\",\\n \\"totalCount\\": 100\\n}","type":"json"}]',
- 'title' => '获取记忆片段列表',
- ],
- 'GetAlipayTransferStatus' => [
- 'summary' => '查询应用中绑定的支付宝钱包的打赏状态。',
- 'path' => '/openapi/alipay/transfer/status',
- 'methods' => [
- 'get',
- 'post',
+ [
+ 'apiName' => 'DeleteChunk',
+ 'description' => '删除切片',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteChunk',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'schemes' => [
- 'https',
+ [
+ 'apiName' => 'GetAlipayTransferStatus',
+ 'description' => '查询支付宝打赏状态',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAlipayTransferStatus',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'security' => [
- [
- 'AK' => [],
+ [
+ 'apiName' => 'ListCategory',
+ 'description' => '类目列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListCategory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
- 'consumes' => [
- 'application/json',
+ [
+ 'apiName' => 'CreateMemoryNode',
+ 'description' => '创建记忆片段',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'produces' => [
- 'application/json',
+ [
+ 'apiName' => 'ListIndices',
+ 'description' => '查询知识库列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'operationType' => 'read',
- 'deprecated' => false,
- 'systemTags' => [
+ [
+ 'apiName' => 'UpdateMemory',
+ 'description' => '更新长期记忆体',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ListChunks',
+ 'description' => '查询索引下的分片列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ChunkList',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SubmitIndexAddDocumentsJob',
+ 'description' => '提交知识库追加任务',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:SubmitIndexAddDocumentsJob',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ListIndexFileDetails',
+ 'description' => '查询知识库下的文件详情',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndexFileDetails',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'UpdateTableFromAuthorizedOss',
+ 'description' => '从已授权OSS Bucket中选择文件更新表格',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateTableFromAuthorizedOss',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ListFile',
+ 'description' => '文件列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'Retrieve',
+ 'description' => '检索知识库',
'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
+ 'ramAction' => [
+ 'action' => 'sfm:Retrieve',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'parameters' => [
- [
- 'name' => 'workspace_id',
- 'in' => 'query',
- 'schema' => [
- 'description' => '百炼工作空间ID',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'llm-cxxxxxxb8d47ks',
+ [
+ 'apiName' => 'AddFile',
+ 'description' => '添加文件',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- [
- 'name' => 'code',
- 'in' => 'query',
- 'schema' => [
- 'description' => '支付宝打赏链接请求返回的打赏code',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'xxx-xxxx',
+ ],
+ [
+ 'apiName' => 'ListMemories',
+ 'description' => '获取长期记忆体列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListMemories',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'requestId' => [
- 'title' => 'Id of the request',
- 'description' => '请求的唯一ID',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n",
- ],
- 'data' => [
- 'description' => '打赏的结果数据',
- 'type' => 'object',
- 'properties' => [
- 'code' => [
- 'description' => '打赏对应的code',
- 'type' => 'string',
- 'example' => '0',
- ],
- 'walletItemCode' => [
- 'description' => '支付宝商品钱包code',
- 'type' => 'string',
- 'example' => 'xsdfsdf',
- ],
- 'mainAccountId' => [
- 'description' => '主账号id(API忽略)',
- 'type' => 'string',
- 'example' => '1007576424487905',
- ],
- 'accountId' => [
- 'description' => '子账号id(API忽略)',
- 'type' => 'string',
- 'example' => '1348393307144609',
- ],
- 'alipayOrderId' => [
- 'description' => '支付宝的订单id',
- 'type' => 'string',
- 'example' => '1234234',
- ],
- 'status' => [
- 'description' => '打赏状态'."\n"
- .'- 1 (成功)'."\n"
- .'- 0 (删除)'."\n"
- .'- 2 (待打赏)'."\n"
- .'- 3 (取消)'."\n"
- .'- 4 (退款)'."\n"
- .'- 5(关闭)'."\n"
- .'- 6(失败)'."\n"
- .'- 7(纠纷、异常)',
- 'type' => 'integer',
- 'format' => 'int64',
- 'example' => '1',
- ],
- 'creator' => [
- 'description' => '创建者(API忽略)',
- 'type' => 'string',
- 'example' => '234234',
- ],
- 'modifier' => [
- 'description' => '修改者(API忽略)',
- 'type' => 'string',
- 'example' => '234234',
- ],
- 'alipayOrderDetail' => [
- 'description' => '支付细节(API忽略)',
- 'type' => 'string',
- 'example' => '{}',
- ],
- 'title' => [
- 'description' => '转账标题',
- 'type' => 'string',
- 'example' => 'test',
- ],
- 'qrURL' => [
- 'description' => '打赏链接(API忽略)',
- 'type' => 'string',
- 'example' => 'https://xxx.aliyun.com',
- ],
- 'transAmount' => [
- 'description' => '订单总金额,单位为:元。',
- 'type' => 'string',
- 'example' => '0.22',
- ],
- 'scope' => [
- 'description' => '打赏应用的所属状态',
- 'type' => 'string',
- 'example' => 'publish',
- ],
- ],
- ],
- ],
+ [
+ 'apiName' => 'SubmitIndexJob',
+ 'description' => '提交知识库创建任务',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:SubmitIndexJob',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ [
+ 'apiName' => 'DeleteFile',
+ 'description' => '删除文件',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"data\\": {\\n \\"code\\": \\"0\\",\\n \\"walletItemCode\\": \\"xsdfsdf\\",\\n \\"mainAccountId\\": \\"1007576424487905\\",\\n \\"accountId\\": \\"1348393307144609\\",\\n \\"alipayOrderId\\": \\"1234234\\",\\n \\"status\\": 1,\\n \\"creator\\": \\"234234\\",\\n \\"modifier\\": \\"234234\\",\\n \\"alipayOrderDetail\\": \\"{}\\",\\n \\"title\\": \\"test\\",\\n \\"qrURL\\": \\"https://xxx.aliyun.com\\",\\n \\"transAmount\\": \\"0.22\\",\\n \\"scope\\": \\"publish\\"\\n }\\n}","type":"json"}]',
- 'title' => '查询支付宝打赏状态',
- ],
- 'GetAlipayUrl' => [
- 'summary' => '获取应用上支付宝的打赏链接。',
- 'path' => '/openapi/alipay/transfer/url',
- 'methods' => [
- 'get',
+ [
+ 'apiName' => 'AddTable',
+ 'description' => '添加表格',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddTable',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'schemes' => [
- 'https',
+ [
+ 'apiName' => 'BatchUpdateFileTag',
+ 'description' => '批量更新文档标签',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:BatchUpdateFileTag',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'security' => [
- [
- 'AK' => [],
+ [
+ 'apiName' => 'GetParseSettings',
+ 'description' => '获取类目解析设置',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetParseSettings',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
- 'consumes' => [
- 'application/json',
+ [
+ 'apiName' => 'DeleteMemory',
+ 'description' => '删除长期记忆体',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'produces' => [
- 'application/json',
+ [
+ 'apiName' => 'DeletePromptTemplate',
+ 'description' => '删除Prompt模板',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeletePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'operationType' => 'read',
- 'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
- 'autoTest' => true,
- 'tenantRelevance' => 'tenant',
+ [
+ 'apiName' => 'ListMemoryNodes',
+ 'description' => '获取记忆片段列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListMemoryNodes',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'parameters' => [
- [
- 'name' => 'workspace_id',
- 'in' => 'query',
- 'schema' => [
- 'description' => '百炼工作空间的id',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'xxxllm-czb8d47ks',
+ [
+ 'apiName' => 'CreateIndex',
+ 'description' => '创建知识库',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- [
- 'name' => 'app_id',
- 'in' => 'query',
- 'schema' => [
- 'description' => '百炼应用的id',
- 'type' => 'string',
- 'required' => false,
- 'example' => 'asfasdfxxasdf',
+ ],
+ [
+ 'apiName' => 'DeleteConnector',
+ 'description' => '删除连接器',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'requestId' => [
- 'description' => '请求的唯一id',
- 'type' => 'string',
- 'example' => '6a71f2d9-f1c9-913b-818b-11402910xxxx'."\n",
- ],
- 'data' => [
- 'description' => '返回数据',
- 'type' => 'object',
- 'properties' => [
- 'qrUrl' => [
- 'description' => '生成的打赏链接',
- 'type' => 'string',
- 'example' => 'https://xxxxxx.aliyun-inc.com',
- ],
- 'code' => [
- 'description' => '对应的打赏的code,用于回查打赏状态',
- 'type' => 'string',
- 'example' => 'xxsdfasfw',
- ],
- ],
- ],
- ],
+ [
+ 'apiName' => 'UpdateIndex',
+ 'description' => '更新知识库',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ [
+ 'apiName' => 'UpdateMemoryNode',
+ 'description' => '更新记忆片段',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"6a71f2d9-f1c9-913b-818b-11402910xxxx\\\\n\\",\\n \\"data\\": {\\n \\"qrUrl\\": \\"https://xxxxxx.aliyun-inc.com\\",\\n \\"code\\": \\"xxsdfasfw\\"\\n }\\n}","type":"json"}]',
- 'title' => '获取支付宝打赏URL',
- ],
- 'ApplyTempStorageLease' => [
- 'summary' => '该接口用于高代码部署,其他场景暂不支持。用于申请临时文件上传许可,之后需要自己完成文件上传动作。',
- 'path' => '/{WorkspaceId}/datacenter',
- 'methods' => [
- 'post',
+ [
+ 'apiName' => 'GetAvailableParserTypes',
+ 'description' => '获取文件支持的解析器类型',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAvailableParserTypes',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'schemes' => [
- 'https',
+ [
+ 'apiName' => 'ApplyTempStorageLease',
+ 'description' => '申请临时文件上传许可',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:ApplyTempStorageLease',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'security' => [
- [
- 'AK' => [],
+ [
+ 'apiName' => 'ListIndexDocuments',
+ 'description' => '查询知识库下的文件列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListIndexFiles',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'GetConnector',
+ 'description' => '获取连接器信息',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetConnector',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'DescribeFile',
+ 'description' => '查询文件状态',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:DescribeFile',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
],
],
- 'consumes' => [
- 'application/json',
+ [
+ 'apiName' => 'DeleteMemoryNode',
+ 'description' => '删除记忆片段',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'produces' => [
- 'application/json',
+ [
+ 'apiName' => 'GetMemory',
+ 'description' => '获取长期记忆体',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'operationType' => 'readAndWrite',
- 'deprecated' => false,
- 'systemTags' => [
+ [
+ 'apiName' => 'CreateMemory',
+ 'description' => '创建长期记忆体',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreateMemory',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'DeleteIndex',
+ 'description' => '删除知识库',
'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'free',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteIndex',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'parameters' => [
- [
- 'name' => 'FileName',
- 'in' => 'formData',
- 'schema' => [
- 'title' => '文件名称,需要包含文件后缀',
- 'description' => '文件名称,需要包含文件后缀',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'example.txt',
+ [
+ 'apiName' => 'DeleteIndexDocument',
+ 'description' => '删除知识库下的文件',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteIndexDocument',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- [
- 'name' => 'SizeInBytes',
- 'in' => 'formData',
- 'schema' => [
- 'title' => '文件大小(单位字节)',
- 'description' => '文件大小(单位字节)',
- 'type' => 'integer',
- 'format' => 'int64',
- 'required' => true,
- 'minimum' => '0',
- 'example' => '1024',
+ ],
+ [
+ 'apiName' => 'GetIndexJobStatus',
+ 'description' => '查询知识库创建任务状态',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetIndexJobStatus',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
- [
- 'name' => 'WorkspaceId',
- 'in' => 'path',
- 'schema' => [
- 'title' => '百炼业务空间id',
- 'description' => '百炼业务空间id',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'llm-mbhn96xxxx',
+ ],
+ [
+ 'apiName' => 'AddFilesFromAuthorizedOss',
+ 'description' => '从已授权OSS Bucket中导入文件',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:AddFilesFromAuthorizedOss',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'title' => 'Schema of Response',
- 'description' => 'Schema of Response',
- 'type' => 'object',
- 'properties' => [
- 'Code' => [
- 'title' => '错误状态码。',
- 'description' => '错误状态码。',
- 'type' => 'string',
- 'example' => 'DataCenter.FileTooLarge',
- ],
- 'Data' => [
- 'title' => '接口业务数据字段。',
- 'description' => '接口业务数据字段。',
- 'type' => 'object',
- 'properties' => [
- 'TempStorageLeaseId' => [
- 'title' => '租约唯一 ID,后续应用内获取上传的文件时,需要使用该参数。',
- 'description' => '租约唯一 ID,后续应用内获取上传的文件时,需要使用该参数。',
- 'type' => 'string',
- 'example' => '1e6a159107384782be5e45ac4759b247.1719325231035',
- ],
- 'Param' => [
- 'title' => '用于上传文件的 HTTP 参数。',
- 'description' => '用于上传文件的 HTTP 参数。',
- 'type' => 'object',
- 'properties' => [
- 'Headers' => [
- 'title' => '需要放到Header中的K-V字段,K和V均为字符串。',
- 'description' => '需要放到Header中的K-V字段,K和V均为字符串。',
- 'type' => 'any',
- 'example' => 'Content-Type: application/json',
- ],
- 'Method' => [
- 'title' => 'HTTP 调用方法,可能值为:'."\n"
- .'PUT'."\n"
- .'POST',
- 'description' => 'HTTP 调用方法,可能值为:'."\n"
- .'PUT'."\n"
- .'POST',
- 'type' => 'string',
- 'example' => 'PUT',
- ],
- 'Url' => [
- 'title' => '文件上传的授权 URL 地址。',
- 'description' => '文件上传的授权 URL 地址。',
- 'type' => 'string',
- 'example' => 'https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D',
- ],
- ],
- ],
- ],
- ],
- 'Message' => [
- 'title' => '错误信息。',
- 'description' => '错误信息。',
- 'type' => 'string',
- 'example' => 'User not authorized to operate on the specified resource',
- ],
- 'RequestId' => [
- 'title' => '请求 ID。',
- 'description' => '请求 ID。',
- 'type' => 'string',
- 'example' => '778C0B3B-xxxx-5FC1-A947-36EDD13606AB',
- ],
- 'Status' => [
- 'title' => '接口返回的状态码。',
- 'description' => '接口返回的状态码。',
- 'type' => 'string',
- 'example' => '200',
- ],
- 'Success' => [
- 'title' => '接口调用是否成功',
- 'description' => '接口调用是否成功',
- 'type' => 'boolean',
- 'default' => 'true',
- ],
- ],
+ [
+ 'apiName' => 'GetPromptTemplate',
+ 'description' => '获取Prompt模板',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetPromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
],
],
],
- 'staticInfo' => [
- 'returnType' => 'synchronous',
+ [
+ 'apiName' => 'GetIndexMonitor',
+ 'description' => '获取知识库监控数据',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetIndexMonitor',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'UpdateChunk',
+ 'description' => '修改切片',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'sfm:UpdateChunk',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'CreatePromptTemplate',
+ 'description' => '创建Prompt模板',
+ 'operationType' => 'create',
+ 'ramAction' => [
+ 'action' => 'sfm:CreatePromptTemplate',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ListPromptTemplates',
+ 'description' => '获取Prompt模板列表',
+ 'operationType' => 'list',
+ 'ramAction' => [
+ 'action' => 'sfm:ListPromptTemplates',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'GetMemoryNode',
+ 'description' => '获取记忆片段',
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'sfm:GetMemoryNode',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'DeleteFiles',
+ 'description' => '批量删除文件',
+ 'operationType' => 'delete',
+ 'ramAction' => [
+ 'action' => 'sfm:DeleteFiles',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'GetAlipayUrl',
+ 'description' => '获取支付宝打赏URL',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:GetAlipayUrl',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ApplyFileUploadLease',
+ 'description' => '申请文件上传租约',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'sfm:ApplyFileUploadLease',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'SFM', 'resourceType' => '全部资源', 'arn' => '*'],
+ ],
+ ],
],
- 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Code\\": \\"DataCenter.FileTooLarge\\",\\n \\"Data\\": {\\n \\"TempStorageLeaseId\\": \\"1e6a159107384782be5e45ac4759b247.1719325231035\\",\\n \\"Param\\": {\\n \\"Headers\\": \\"Content-Type: application/json\\",\\n \\"Method\\": \\"PUT\\",\\n \\"Url\\": \\"https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/1005426495169178/10024405/68abd1dea7b6404d8f7d7b9f7fbd332d.1716698936847.pdf?Expires=1716699536&OSSAccessKeyId=TestID&Signature=HfwPUZo4pR6DatSDym0zFKVh9Wg%3D\\"\\n }\\n },\\n \\"Message\\": \\"User not authorized to operate on the specified resource\\",\\n \\"RequestId\\": \\"778C0B3B-xxxx-5FC1-A947-36EDD13606AB\\",\\n \\"Status\\": \\"200\\",\\n \\"Success\\": true\\n}","type":"json"}]',
- 'title' => '申请临时文件上传许可',
- 'description' => '1、该接口用于高代码部署,其他场景暂不支持。'."\n"
- .'2、通过此接口获取到临时文件上传许可之后,需要自己完成文件上传动作。',
- ],
- ],
- 'endpoints' => [
- [
- 'regionId' => 'cn-beijing',
- 'endpoint' => 'bailian.cn-beijing.aliyuncs.com',
- ],
- [
- 'regionId' => 'cn-shanghai-finance-1',
- 'endpoint' => 'bailian.cn-shanghai-finance-1.aliyuncs.com',
- ],
- [
- 'regionId' => 'ap-southeast-1',
- 'endpoint' => 'bailian.ap-southeast-1.aliyuncs.com',
],
+ 'resourceTypes' => [],
],
];