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:
- name —
get_weather. Snake_case, kısa. - 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.
- input_schema — JSON Schema. Parametrelerin tipi, açıklaması, required/optional.
- 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.