コンテンツにスキップ

ベクターストア内のファイルの内容を更新する

PATCH /vector-stores/{vector-store-id}/documents/{document-id}/

Update a specific document in a vector store.

Parameter In Type Required Description
vector-store-id path string yes The ID of the vector store.
document-id path integer yes The ID of the document.
x-api-key header string yes The API key for authentication.

Request body

Field Type Required Description
name string The new name for the document.

Responses

  • 200 — Document updated successfully.

例リクエスト

curl -X PATCH   
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234/   
  -H "x-api-key: YOUR_API_KEY"   
  -H "Content-Type: application/json"   
  -d '{
    "name": "更新された製品概要"
  }'

Info

YOUR_API_KEY を実際のベクターストアAPIキーに、vs_abc123 をベクターストアIDに、1234 をドキュメントIDに置き換えてください。

const updateDocument = async (vectorStoreId, documentId, newName) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/${documentId}/`, {
    method: 'PATCH',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: newName
    })
  });

  const data = await response.json();
  console.log(data);
};

updateDocument('vs_abc123', 1234, '更新された製品概要');

Info

YOUR_API_KEY を実際のベクターストアAPIキーに、vs_abc123 をベクターストアIDに、1234 をドキュメントIDに置き換えてください。

import requests
import json

def update_document(vector_store_id, document_id, new_name):
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }

    payload = {
        "name": new_name
    }

    response = requests.patch(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/{document_id}/",
        headers=headers,
        data=json.dumps(payload)
    )

    data = response.json()
    print(data)

update_document('vs_abc123', 1234, '更新された製品概要')

Info

YOUR_API_KEY を実際のベクターストアAPIキーに、vs_abc123 をベクターストアIDに、1234 をドキュメントIDに置き換えてください。

パスパラメータ

パラメータ タイプ 説明
vector-store-id 文字列 必須。 ドキュメントを含むベクターストアのID。
document-id 整数 必須。 更新するドキュメントのID。

リクエストボディ

{
  "name": "更新された製品概要"
}
パラメータ タイプ 説明
name 文字列 ドキュメントの新しい名前。

レスポンスフォーマット

{
  "id": 1234,
  "name": "更新された製品概要",
  "type": "text/plain",
  "vector_store": "vs_abc123",
  "size": 173,
  "status": "indexed",
  "processing_status": "completed",
  "indexed_on": "2023-06-15T10:30:00Z",
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T11:45:00Z"
}

認証

このエンドポイントは、x-api-key ヘッダーを使用して API キーによる認証を必要とします。

エラー応答

ステータスコード 説明
400 不正なリクエスト - 無効なリクエスト形式
401 認証エラー - 無効または欠落しているAPIキー
404 未発見 - ベクターストアまたはドキュメントが見つかりません
500 内部サーバーエラー

このエンドポイントを使用すると、ベクターストア内のドキュメントのメタデータを更新できます。現在、ドキュメントの名前のみを更新できます。これは、ドキュメントを再アップロードすることなく、ドキュメントの整理と発見性を向上させるのに役立ちます。

Info

注意: このエンドポイントはドキュメントのメタデータのみを更新し、その内容は更新しません。内容を更新するには、既存のドキュメントを削除し、新しいものをアップロードする必要があります。