Rememberizer Docs
登入報名聯絡我們
繁體中文
繁體中文
  • 為什麼選擇 Rememberizer?
  • 背景
    • 什麼是向量嵌入和向量數據庫?
    • 術語表
    • 標準化術語
  • 個人使用
    • 開始使用
      • 搜尋你的知識
      • 紀念品過濾訪問
      • 常見知識
      • 管理你的嵌入知識
  • 整合
    • Rememberizer 應用程式
    • Rememberizer Slack 整合
    • Rememberizer Google Drive 整合
    • Rememberizer Dropbox 整合
    • Rememberizer Gmail 整合
    • Rememberizer Memory 整合
    • Rememberizer MCP 伺服器
    • 管理第三方應用程式
  • 開發者資源
    • 開發者概覽
  • 整合選項
    • 註冊和使用 API 金鑰
    • 註冊 Rememberizer 應用程式
    • 授權 Rememberizer 應用程式
    • 創建 Rememberizer GPT
    • LangChain 整合
    • 向 Slack 談話的範例網頁應用程式
  • 企業整合
    • 企業整合模式
  • API 參考
    • API 文件首頁
    • 身份驗證
  • 核心 API
    • 依語意相似性搜尋文件
    • 檢索文件
    • 檢索文件內容
    • 檢索 Slack 內容
    • 將內容記憶到 Rememberizer
  • 帳戶與配置
    • 檢索當前用戶帳戶詳細信息
    • 列出可用的數據源集成
    • 備忘錄
    • 獲取所有已添加的公共知識
  • 向量存儲 API
    • 向量存儲文檔
    • 獲取向量存儲信息
    • 獲取向量存儲中的文檔列表
    • 獲取文檔信息
    • 向向量存儲添加新文本文檔
    • 將文件上傳到向量存儲
    • 更新向量存儲中的文件內容
    • 在向量存儲中移除文檔
    • 按語義相似性搜索向量存儲文檔
  • 其他資源
    • 通知
      • 使用條款
      • 隱私政策
      • B2B
        • 關於 Reddit 代理
  • 發布
    • 發布說明首頁
  • 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 13 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.
  • 範例請求
  • 路徑參數
  • 查詢參數
  • 回應格式
  • 錯誤回應
  • 大型文件的分頁