向向量存储添加新文本文档

post

Create a new text document in a vector store.

Path parameters
vector-store-idstringRequired

The ID of the vector store.

Header parameters
x-api-keystringRequired

The API key for authentication.

Body
namestringOptional

The name of the document.

textstringOptional

The text content of the document.

Responses
201
Document created successfully.
application/json
post
POST /api/v1/vector-stores/{vector-store-id}/documents/create HTTP/1.1
Host: api.rememberizer.ai
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "name": "text",
  "text": "text"
}
201

Document created successfully.

{
  "id": 1,
  "name": "text",
  "type": "text",
  "vector_store": "text",
  "size": 1,
  "status": "text",
  "processing_status": "text",
  "indexed_on": "2025-06-20T19:04:36.712Z",
  "status_error_message": "text",
  "created": "2025-06-20T19:04:36.712Z",
  "modified": "2025-06-20T19:04:36.712Z"
}

示例请求

curl -X POST \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "产品概述",
    "text": "我们的产品是一个创新的解决方案,用于管理向量嵌入。它与您现有的系统无缝集成,并提供强大的语义搜索功能。"
  }'

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

路径参数

参数
类型
描述

vector-store-id

字符串

必需。 要添加文档的向量存储的 ID。

请求体

{
  "name": "产品概述",
  "text": "我们的产品是一个用于管理向量嵌入的创新解决方案。它与您现有的系统无缝集成,并提供强大的语义搜索功能。"
}
参数
类型
描述

name

string

必填。 文档的名称。

text

string

必填。 文档的文本内容。

响应格式

{
  "id": 1234,
  "name": "产品概述",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "处理中",
  "processing_status": "排队中",
  "indexed_on": null,
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:15:00Z"
}

认证

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

错误响应

状态码
描述

400

错误请求 - 缺少必需字段或格式无效

401

未授权 - API 密钥无效或缺失

404

未找到 - 找不到向量存储

500

内部服务器错误

此端点允许您直接将文本内容添加到您的向量存储中。它特别适用于存储可能不存在于文件格式中的信息,例如产品描述、知识库文章或自定义内容。文本将自动处理为向量嵌入,使其可以通过语义相似性进行搜索。

Last updated