PyAI Learn Türkçe

Module 17

The real language model API

anthropic SDK: messages, JSON, tools

When you finish this module you can say:

I can write programs that talk to a real language model while keeping my key safe, parse JSON from it, and let it call tools.

By the end of this module you’ll be able to write an assistant that calls a calculator tool on its own, remembers history, and reports tool errors back to the model.

Start

Lessons

7 lessons · ≈ 71 min

  1. First real call and key safety10 min
  2. The message list and roles9 min
  3. System prompt and parameters10 min
  4. Multi-turn chat and the context limit10 min
  5. Structured output and JSON parsing10 min
  6. Tool use10 min
  7. Project: The tool-calling assistant12 min · project

Practice exercises

Short writing exercises, independent of the lessons: Go to the exercises

  1. Does the system prompt shorten the answer?
  2. A chat that carries its history
  3. Run the tool by its name