GET
/
api
/
datasets
/
{datasetId}
/
chunks
curl --request GET \
  --url https://app.pathors.com/api/datasets/{datasetId}/chunks \
  --header 'x-api-key: <x-api-key>'
{
  "id": "<string>",
  "content": "<string>",
  "contentLength": 123
}

预览文本片段

获取从特定数据集生成的所有文本片段。

接口

GET /api/datasets/{datasetId}/chunks

路径参数

datasetId
string
required

要获取文本片段的数据集 ID

请求头

x-api-key
string
required

用于认证的项目 API 密钥

响应

返回从数据集生成的文本片段数组。

id
string

文本片段的唯一标识符

content
string

文本片段的内容

contentLength
number

文本片段的字符长度

响应示例:

[
  {
    "id": "chunk_abc123",
    "content": "这是第一个文本片段的内容...",
    "contentLength": 256
  },
  {
    "id": "chunk_def456",
    "content": "这是第二个文本片段的内容...",
    "contentLength": 312
  }
]

错误响应

状态码描述
401无效的 API 密钥
404未找到数据集
500内部服务器错误

使用说明

  • 此接口展示了数据集是如何被分割成文本片段的
  • 文本片段在数据集上传时自动创建
  • 每个文本片段都经过语义搜索优化
  • 显示的文本片段是实际用于查询的片段

相关接口