メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt

Use this file to discover all available pages before exploring further.

概要

このエンドポイントを使用して、キャッシュされた応答が誤っている、古い、無関係、または再利用に適さない場合を報告します。 エントリに十分な負のフィードバックが蓄積されると、TokenLab はそれを自動的に無効化できます。

注意

  • 認証には標準の inference API key が必要です。
  • cache_entry_id は、この API キーの組織が所有するキャッシュヒット済み request/cache entry の識別子である必要があります。任意の ID は 404、別組織の ID は 403 になります。
  • feedback_typewrong_answeroutdatedirrelevantother を受け付けます。
  • request_id は任意です。指定する場合は cache_entry_id と一致している必要があります。
  • description は運用や監査のための任意の自由形式コンテキストです。

リクエスト / レスポンス

正確な schema とレスポンス項目は、上のインタラクティブな OpenAPI パネルを使用してください。

curl -X POST "https://api.tokenlab.sh/v1/cache/feedback" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "cache_entry_id": "req_1234567890",
    "feedback_type": "wrong_answer",
    "request_id": "req_1234567890",
    "description": "The cached answer referenced an outdated pricing table."
  }'
{
  "object": "cache.feedback",
  "recorded": true,
  "invalidated": false,
  "stats": {
    "negative_feedback_count": 1,
    "total_hit_count": 18,
    "negative_feedback_rate": 0.0556
  }
}