Ana içeriğe atla
POST
/
user
/
tools
Arama içi araç oluştur
curl --request POST \
  --url https://app.whattalk.ai/api/user/tools \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "endpoint": "<string>",
  "method": "<string>",
  "timeout": 123,
  "headers": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "schema": [
    {
      "name": "<string>",
      "type": "<string>",
      "description": "<string>"
    }
  ]
}
'
{
  "message": "Tool created successfully",
  "data": {
    "id": 1,
    "name": "check_order_status",
    "description": "Use this tool to check the status of a customer's order.",
    "endpoint": "https://api.yourstore.com/orders/status",
    "method": "GET",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer sk_..."
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID"
      },
      {
        "name": "order_number",
        "type": "number",
        "description": "The numeric order number"
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order"
      }
    ],
    "created_at": "2025-10-10T12:00:00.000000Z",
    "updated_at": "2025-10-10T12:00:00.000000Z"
  }
}
Bu endpoint, yapay zeka asistanlarınızın aramalar sırasında harici API’lerle etkileşim kurması için kullanılabilecek yeni bir arama içi araç oluşturmanızı sağlar.

Gövde Parametreleri

name
string
gerekli
Araç adı - yalnızca küçük harfler ve alt çizgi içermeli ve bir harfle başlamalıdır (ör. get_weather, book_appointment)
description
string
gerekli
Yapay zekanın bu aracı ne zaman ve nasıl kullanması gerektiğinin ayrıntılı açıklaması (maksimum 255 karakter)
endpoint
string
gerekli
Çağrılacak API endpoint’inin geçerli URL’si
method
string
gerekli
HTTP yöntemi: GET, POST, PUT, PATCH veya DELETE
timeout
integer
Saniye cinsinden istek zaman aşımı (1-30, varsayılan: 10)
headers
array
İstekle birlikte gönderilecek HTTP başlıkları
schema
array
Yapay zekanın konuşmadan çıkaracağı ve endpoint’e göndereceği parametreler

Yanıt alanları

message
string
Başarı mesajı
data
object
Oluşturulan araç nesnesi
{
  "message": "Tool created successfully",
  "data": {
    "id": 1,
    "name": "check_order_status",
    "description": "Use this tool to check the status of a customer's order.",
    "endpoint": "https://api.yourstore.com/orders/status",
    "method": "GET",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer sk_..."
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID"
      },
      {
        "name": "order_number",
        "type": "number",
        "description": "The numeric order number"
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order"
      }
    ],
    "created_at": "2025-10-10T12:00:00.000000Z",
    "updated_at": "2025-10-10T12:00:00.000000Z"
  }
}

Araçları Asistanlara Ekleme

Bir araç oluşturduktan sonra, aramalar sırasında kullanmak için onu bir asistana eklemeniz gerekir. Araçlar Asistan API’si aracılığıyla yönetilir:
  • Asistan Oluştur - Bir asistan oluştururken araçları eklemek için tool_ids parametresini kullanın
  • Asistan Güncelle - Mevcut bir asistanda araçları eklemek, kaldırmak veya değiştirmek için tool_ids parametresini kullanın