İçeriğe geç
Tüm roadmap'e dön
topicfoundation

Tool Temelleri

Tool = name + description + JSON schema + executor function. Bu 4'lü olmadan agent yok.

3 saat2 kaynak1 önkoşul

Bir LLM tool'unun anatomisi:

  1. nameget_weather. Snake_case, kısa.
  2. description — "Belirtilen şehrin güncel hava durumunu döner. Sadece şehir adı bilinen lokasyonlar için." Model bu metinden tool'un ne zaman çağrılacağını anlar. Kalite kritik.
  3. input_schema — JSON Schema. Parametrelerin tipi, açıklaması, required/optional.
  4. execute(args) — gerçek fonksiyon. API çağrısı, DB sorgusu, hesaplama.

Anthropic format:

{
  "name": "get_weather",
  "description": "Get current weather for a city.",
  "input_schema": {
    "type": "object",
    "properties": {
      "city": {"type": "string", "description": "City name"}
    },
    "required": ["city"]
  }
}

LLM bu schema'yı görür, {"name":"get_weather","input":{"city":"Istanbul"}} döner, sen execute edersin, sonucu tool_result olarak geri verirsin.

Ne kazanırsın?

Bir tool'u sıfırdan tanımlayabilir, modelin doğru zamanda çağırması için description'ını optimize edebilirsin.

Önce bunları bil

Kaynaklar(2)