Sử dụng
Sử dụngGỡ lỗi các yêu cầu API

Gỡ lỗi các yêu cầu API

Để gỡ lỗi các yêu cầu được gửi đến nhà cung cấp dịch thuật (như ChatGPT, Claude hoặc Google Translate) và phản hồi của họ, bạn có thể bật mức độ nghiêm trọng 🔵 Info trong cài đặt tại Logs & Notifications.

Bật mức độ nghiêm trọng Info trong cài đặt Logs & Notifications
Bật mức độ nghiêm trọng Info trong cài đặt Logs & Notifications

Truy cập nhật ký yêu cầu API

Các nhật ký sẽ được lưu trữ trong các mục api-requests.

Các yêu cầu AI trong Logs
Các yêu cầu AI trong Logs

Những gì được ghi lại

Đối với các nhà cung cấp AI, mục api-requests chứa thông tin chi tiết về:

  • Prompt được gửi đến nhà cung cấp AI
  • Phản hồi đầy đủ nhận được
  • Bất kỳ lỗi hoặc vấn đề nào trong quá trình giao tiếp
  • Mô hình được sử dụng
  • Số lượng token được sử dụng
Chi tiết của một yêu cầu AI trong Logs
Chi tiết của một yêu cầu AI trong Logs

Ví dụ, JSON "Additional context" sau đây hiển thị chi tiết của một yêu cầu được gửi đến Claude và phản hồi của nó:

{
  "request": {
    "model": "claude-3-7-sonnet-latest",
    "max_tokens": 128000,
    "messages": [
      {
        "role": "user",
        "content": "You are a language translator.\r\n\r\nI'm working on internationalizing my application.\r\n\r\nI've created a JSON with sentences in English. Please translate the sentences to Spanish from Argentina.\r\n\r\nIf a sentence contains HTML, do not translate inside the HTML tags.\n\nReturn ONLY a JSON object with a single key \"translations\" containing an array of translated strings.\nDo not include any explanations, markdown formatting, or code blocks.\nThe response must be a valid JSON object starting with { and ending with }.\n\nThis is the JSON:\n\n[\"HTTP caching improves performance\",\"Categories Block\",\"Latest Posts Block\",\"Democratizing publishing\"]"
      }
    ]
  },
  "response": {
    "id": "msg_01EC2Qp2fMw6VQY8tGESFrh2",
    "type": "message",
    "role": "assistant",
    "model": "claude-3-7-sonnet-20250219",
    "content": [
      {
        "type": "text",
        "text": "{\n  \"translations\": [\n  \"El caché HTTP mejora el rendimiento\",\n  \"Bloque de categorías\",\n  \"Bloque de entradas recientes\",\n  \"Democratizando la publicación\"\n  ]\n}"
      }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
      "input_tokens": 138,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 0,
      "output_tokens": 61,
      "service_tier": "standard"
    }
  }
}