记忆内容到 Rememberizer¶
POST /documents/memorize/¶
Save a new document
Saves a document with a name and content
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | |
content |
string | yes |
Responses
200— Document saved successfully400— Bad request (invalid parameters)500— Internal server error
示例请求¶
curl -X POST
https://api.rememberizer.ai/api/v1/documents/memorize/
-H "Authorization: Bearer YOUR_JWT_TOKEN"
-H "Content-Type: application/json"
-d '{
"name": "重要信息",
"content": "这是我希望 Rememberizer 记住的重要内容。"
}'
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
const memorizeContent = async () => {
const response = await fetch('https://api.rememberizer.ai/api/v1/documents/memorize/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '重要信息',
content: '这是我希望 Rememberizer 记住的重要内容。'
})
});
if (response.status === 201) {
console.log("内容成功存储");
} else {
console.error("存储内容失败");
const errorData = await response.json();
console.error(errorData);
}
};
memorizeContent();
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
import requests
import json
def memorize_content():
headers = {
"Authorization": "Bearer YOUR_JWT_TOKEN",
"Content-Type": "application/json"
}
payload = {
"name": "重要信息",
"content": "这是我希望 Rememberizer 记住的重要内容。"
}
response = requests.post(
"https://api.rememberizer.ai/api/v1/documents/memorize/",
headers=headers,
data=json.dumps(payload)
)
if response.status_code == 201:
print("内容成功存储")
else:
print(f"存储内容失败: {response.text}")
memorize_content()
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
请求参数¶
| 参数 | 类型 | 描述 |
|---|---|---|
| name | 字符串 | 必填。 存储内容的名称。 |
| content | 字符串 | 必填。 要存储在 Rememberizer 中的文本内容。 |
响应¶
成功的请求返回一个 201 Created 状态码,且没有响应体。
错误响应¶
| 状态码 | 描述 |
|---|---|
| 400 | 错误请求 - 缺少必填字段或无效参数 |
| 401 | 未授权 - 无效或缺失的身份验证 |
| 500 | 服务器内部错误 |
用例¶
此端点特别适用于:
- 存储您希望稍后访问的重要笔记或信息
- 添加通过集成数据源无法获得的内容
- 手动添加需要可搜索的信息
- 为访问您的知识库的 LLM 添加上下文信息
存储的内容可以通过搜索端点进行搜索,并可以包含在纪念品中。