跳轉到主要內容

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 Key 所屬組織擁有的快取命中 request/cache entry 識別碼;任意 ID 會回傳 404,其他組織的 ID 會回傳 403
  • feedback_type 支援 wrong_answeroutdatedirrelevantother
  • request_id 為選填;若提供,必須與 cache_entry_id 相同。
  • description 為選填的自由格式內容,方便營運與稽核。

請求 / 回應

請使用上方的互動式 OpenAPI 面板查看準確的 schema 與回應欄位。

範例

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
  }
}