跳转至

获取文档信息

GET /vector-stores/{vector-store-id}/documents/{document-id}

Retrieve the information of a document in a Vector Store.

Parameter In Type Required Description
vector-store-id path string yes The ID of the vector store.
document-id path integer yes The ID of the document.
x-api-key header string yes The API key for authentication.

Responses

  • 200 — Document details retrieved successfully.

示例请求

curl -X GET   
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234   
  -H "x-api-key: YOUR_API_KEY"

Info

YOUR_API_KEY 替换为您的实际向量存储 API 密钥,将 vs_abc123 替换为您的向量存储 ID,将 1234 替换为文档 ID。

const getDocumentInfo = async (vectorStoreId, documentId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/${documentId}`, {
    method: 'GET',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data);
};

getDocumentInfo('vs_abc123', 1234);

Info

YOUR_API_KEY 替换为您的实际向量存储 API 密钥,将 vs_abc123 替换为您的向量存储 ID,将 1234 替换为文档 ID。

import requests

def get_document_info(vector_store_id, document_id):
    headers = {
        "x-api-key": "YOUR_API_KEY"
    }

    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/{document_id}",
        headers=headers
    )

    data = response.json()
    print(data)

get_document_info('vs_abc123', 1234)

Info

YOUR_API_KEY 替换为您的实际向量存储 API 密钥,将 vs_abc123 替换为您的向量存储 ID,将 1234 替换为文档 ID。

路径参数

参数 类型 描述
vector-store-id 字符串 必填。 包含文档的向量存储的ID。
document-id 整数 必填。 要检索的文档的ID。

响应格式

{
  "id": 1234,
  "name": "产品手册.pdf",
  "type": "application/pdf",
  "vector_store": "vs_abc123",
  "size": 250000,
  "status": "已索引",
  "processing_status": "已完成",
  "indexed_on": "2023-06-15T10:30:00Z",
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:30:00Z"
}

认证

此端点需要使用 x-api-key 头中的 API 密钥进行认证。

错误响应

状态码 描述
401 未授权 - 无效或缺失的 API 密钥
404 未找到 - 向量存储或文档未找到
500 服务器内部错误

此端点检索有关向量存储中特定文档的详细信息。它对于检查单个文档的处理状态以及检索元数据(如文件类型、大小和时间戳)非常有用。当排查文档处理问题或需要验证文档是否正确索引时,这尤其有帮助。