將新文本文件添加到向量儲存
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
/vector-stores/{vector-store-id}/documents/createPOST /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-11-07T17:52:09.300Z",
"status_error_message": "text",
"created": "2025-11-07T17:52:09.300Z",
"modified": "2025-11-07T17:52:09.300Z"
}示例請求
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": "我們的產品是一個創新的解決方案,用於管理向量嵌入。它提供與您現有系統的無縫集成,並提供強大的語義搜索功能。"
}'const addTextDocument = async (vectorStoreId, name, text) => {
const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/create`, {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: name,
text: text
})
});
const data = await response.json();
console.log(data);
};
addTextDocument(
'vs_abc123',
'產品概述',
'我們的產品是一個創新的解決方案,用於管理向量嵌入。它提供與您現有系統的無縫集成,並提供強大的語義搜索功能。'
);import requests
import json
def add_text_document(vector_store_id, name, text):
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"name": name,
"text": text
}
response = requests.post(
f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/create",
headers=headers,
data=json.dumps(payload)
)
data = response.json()
print(data)
add_text_document(
'vs_abc123',
'產品概述',
'我們的產品是一個創新的解決方案,用於管理向量嵌入。它提供與您現有系統的無縫集成,並提供強大的語義搜索功能。'
)路徑參數
參數
類型
描述
vector-store-id
字串
必填。 要將文件添加到的向量存儲的 ID。
請求主體
{
"name": "產品概述",
"text": "我們的產品是一個創新的解決方案,用於管理向量嵌入。它提供與您現有系統的無縫集成,並提供強大的語義搜索功能。"
}參數
類型
描述
name
字串
必填。 文件的名稱。
text
字串
必填。 文件的文本內容。
回應格式
{
"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