Langsung ke konten utama

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.

Gambaran Umum

Gunakan endpoint ini untuk melaporkan respons cache yang salah, sudah usang, tidak relevan, atau tidak aman untuk digunakan kembali. Saat sebuah entri mengumpulkan cukup banyak umpan balik negatif, TokenLab dapat membatalkannya secara otomatis.

Catatan

  • Autentikasi memerlukan API key inference standar.
  • cache_entry_id harus berupa identifier request/cache entry yang mengalami cache hit dan dimiliki oleh organisasi API Key ini. ID sembarang mengembalikan 404, sedangkan ID milik organisasi lain mengembalikan 403.
  • feedback_type menerima wrong_answer, outdated, irrelevant, atau other.
  • request_id bersifat opsional; jika dikirim, nilainya harus sama dengan cache_entry_id.
  • description bersifat opsional dan menyediakan konteks bebas untuk operator dan audit.

Permintaan / Respons

Gunakan panel OpenAPI interaktif di atas untuk schema dan field respons yang tepat.

Contoh

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": "Jawaban cache merujuk ke tabel harga yang sudah usang."
  }'
{
  "object": "cache.feedback",
  "recorded": true,
  "invalidated": false,
  "stats": {
    "negative_feedback_count": 1,
    "total_hit_count": 18,
    "negative_feedback_rate": 0.0556
  }
}