Rememberizer Docs
登入报名联系我们
简体中文
简体中文
  • 为什么选择 Rememberizer?
  • 背景
    • 什么是向量嵌入和向量数据库?
    • 术语表
    • 标准化术语
  • 个人使用
    • 开始使用
      • 搜索你的知识
      • 纪念品过滤访问
      • 常见知识
      • 管理你的嵌入知识
  • 集成
    • Rememberizer 应用
    • Rememberizer Slack 集成
    • Rememberizer Google Drive 集成
    • Rememberizer Dropbox 集成
    • Rememberizer Gmail 集成
    • Rememberizer Memory 集成
    • Rememberizer MCP 服务器
    • 管理第三方应用
  • 开发者资源
    • 开发者概述
  • 集成选项
    • 注册和使用 API 密钥
    • 注册 Rememberizer 应用
    • 授权 Rememberizer 应用
    • 创建一个 Rememberizer GPT
    • LangChain 集成
    • 向 Slack 发送消息的示例 Web 应用
  • 企业集成
    • 企业集成模式
  • API 参考
    • API 文档首页
    • 认证
  • 核心 API
    • 按语义相似性搜索文档
    • 检索文档
    • 检索文档内容
    • 检索 Slack 内容
    • 将内容记忆到 Rememberizer
  • 账户与配置
    • 检索当前用户账户详情
    • 列出可用的数据源集成
    • 备忘录
    • 获取所有添加的公共知识
  • 向量存储 API
    • 向量存储文档
    • 获取向量存储信息
    • 获取向量存储中的文档列表
    • 获取文档信息
    • 向向量存储添加新文本文档
    • 向向量存储上传文件
    • 更新向量存储中的文件内容
    • 在向量存储中移除文档
    • 通过语义相似性搜索向量存储文档
  • 其他资源
    • 通知
      • 使用条款
      • 隐私政策
      • B2B
        • 关于 Reddit Agent
  • 发布
    • 发布说明首页
  • 2025 发布
    • 2025年4月25日
    • 2025年4月18日
    • 2025年4月11日
    • 2025年4月4日
    • 2025年3月28日
    • 2025年3月21日
    • 2025年3月14日
    • 2025年1月17日
  • 2024 发布
    • 2024年12月27日
    • 2024年12月20日
    • 2024年12月13日
    • 2024年12月6日
  • 2024年11月29日
  • 2024年11月22日
  • 2024年11月15日
  • 2024年11月8日
  • 2024年11月1日
  • 2024年10月25日
  • 2024年10月18日
  • 2024年10月11日
  • 2024年10月4日
  • 2024年9月27日
  • 2024年9月20日
  • 2024年9月13日
  • 2024年8月16日
  • 2024年8月9日
  • 2024年8月2日
  • 2024年7月26日
  • 2024年7月12日
  • 2024年6月28日
  • 2024年6月14日
  • 2024年5月31日
  • 2024年5月17日
  • 2024年5月10日
  • 2024年4月26日
  • 2024年4月19日
  • 2024年4月12日
  • 2024年4月5日
  • 2024年3月25日
  • 2024年3月18日
  • 2024年3月11日
  • 2024年3月4日
  • 2024年2月26日
  • 2024年2月19日
  • 2024年2月12日
  • 2024年2月5日
  • 2024年1月29日
  • 2024年1月22日
  • 2024年1月15日
  • LLM 文档
    • Rememberizer LLM 准备文档
Powered by GitBook
On this page
  1. 核心 API

检索文档内容

Previous检索文档Next检索 Slack 内容

Last updated 23 days ago

示例请求

curl -X GET \
  "https://api.rememberizer.ai/api/v1/documents/12345/contents/?start_chunk=0&end_chunk=20" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌,将 12345 替换为实际的文档 ID。

const getDocumentContents = async (documentId, startChunk = 0, endChunk = 20) => {
  const url = new URL(`https://api.rememberizer.ai/api/v1/documents/${documentId}/contents/`);
  url.searchParams.append('start_chunk', startChunk);
  url.searchParams.append('end_chunk', endChunk);
  
  const response = await fetch(url.toString(), {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
  
  // 如果还有更多块,您可以获取它们
  if (data.end_chunk < totalChunks) {
    // 获取下一组块
    await getDocumentContents(documentId, data.end_chunk, data.end_chunk + 20);
  }
};

getDocumentContents(12345);

将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌,将 12345 替换为实际的文档 ID。

import requests

def get_document_contents(document_id, start_chunk=0, end_chunk=20):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    params = {
        "start_chunk": start_chunk,
        "end_chunk": end_chunk
    }
    
    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/documents/{document_id}/contents/",
        headers=headers,
        params=params
    )
    
    data = response.json()
    print(data)
    
    # 如果还有更多块,您可以获取它们
    # 这是一个简单的示例 - 您可能想要实现一个适当的递归检查
    if 'end_chunk' in data and data['end_chunk'] < total_chunks:
        get_document_contents(document_id, data['end_chunk'], data['end_chunk'] + 20)

get_document_contents(12345)

将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌,将 12345 替换为实际的文档 ID。

路径参数

参数
类型
描述

document_id

整数

必填。 要检索内容的文档ID。

查询参数

参数
类型
描述

start_chunk

整数

起始块索引。默认值为 0。

end_chunk

整数

结束块索引。默认值为 start_chunk + 20。

响应格式

{
  "content": "文档块的完整文本内容...",
  "end_chunk": 20
}

错误响应

状态码
描述

404

文档未找到

500

服务器内部错误

大型文档的分页

对于大型文档,内容被分成多个块。您可以通过多次请求来检索完整文档:

  1. 先发起一个请求,使用 start_chunk=0

  2. 将返回的 end_chunk 值作为下一个请求的 start_chunk

  3. 继续直到您检索到所有块

此端点返回文档的原始文本内容,使您能够访问完整信息以进行详细处理或分析。

Retrieve contents of a document by its ID.

get

Returns the content of the document with the specified ID, along with the index of the latest retrieved chunk. Each call fetches up to 20 chunks. To get more, use the end_chunk value from the response as the start_chunk for the next call.

Path parameters
document_idintegerRequired

The ID of the document to retrieve contents for.

Query parameters
start_chunkintegerOptional

Indicate the starting chunk that you want to retrieve. If not specified, the default value is 0.

end_chunkintegerOptional

Indicate the ending chunk that you want to retrieve. If not specified, the default value is start_chunk + 20.

Responses
200
Content of the document and index of the latest retrieved chunk.
application/json
404
Document not found.
500
Internal server error.
get
GET /api/v1/documents/{document_id}/contents/ HTTP/1.1
Host: api.rememberizer.ai
Accept: */*
{
  "content": "text",
  "end_chunk": 20
}
  • GETRetrieve contents of a document by its ID.
  • 示例请求
  • 路径参数
  • 查询参数
  • 响应格式
  • 错误响应
  • 大型文档的分页