Перевірити рівеньКурсиПрограмиДля командТарифи
RUУвійтиРеєстрація
Перевірити рівеньКурсиПрограмиДля командТарифиТест із ClaudeПромптиБлогПитання та відповідіПошукРеєстраціяRU
AcademlКурсиGemini Cookbook: Based on Google MaterialsFunction Calling in the Gemini API
Таблиця чисел, у якій код позначив прості числаТермінал Claude Code: команда claude -p з дозволеними Read та EditПовторні запити після помилки 429: пауза щоразу вдвічі довша, потім успіх
Курс

Gemini Cookbook: Based on Google Materials

Модуль 1 · Getting Started with Google GenAI SDK
01First Steps with the Gemini API
Модуль 2 · Function Calling
02Function Calling in the Gemini API
Модуль 3 · Working with Audio
03Audio in the Gemini API
Модуль 4 · File API
04File API: Uploading and Using Files
Модуль 5 · Context Caching
05Context Caching: Cache Large Documents
Модуль 6 · Code Execution
06Code Execution: Python Inside Gemini
Модуль 7 · Embeddings
07Embeddings: Vector Representations in Gemini
Модуль 8 · Live API
08Live API: Real-Time Multimodal Sessions
Gemini Cookbook: Based on Google Materials · Урок 2

Function Calling in the Gemini API

Pass functions as tools: the manual function_call → function_result loop with call_id in the Interactions API, automatic calling in SDK chats, history inspection, tool_choice modes and parallel calls.

ENМатеріали курсів поки англійською. Інтерфейс, ШІ-наставник і перевірка завдань — українською.

25 хв читанняОновлено 02.12.20263 питання у квізіГотовий промпт включено

What Is Function Calling

Function calling lets you describe functions and hand them to the model: it decides when and with what arguments to call them. The model doesn't run the function itself. It returns the name and arguments, and your code makes the call.

The Gemini API offers this in two interfaces:

  • Interactions API (client.interactions.create) — the primary API, which Google recommends for new projects. Functions are described with a JSON schema, and a call and its result are linked by call_id. You run the call loop.
  • Chats on generateContent (client.chats.create) — now legacy but still supported. Only here can the Python SDK call your functions for you (automatic function calling) and build the schema from the name, docstring and type annotations.

You need the google-genai SDK (pip install -U google-genai). The examples use gemini-4-hydrogen: it launched on 2026-11-12, is available on the free tier, and Google recommends it as the upgrade from Gemini 3.8 Flash and the 2.5 models. gemini-2.5-flash is deprecated; since 2026-12-01 requests to it are routed to gemini-3.5-flash-lite.

Далі урок відкривається після безкоштовної реєстрації

Реєстрація через email або Google відкриває перші два уроки кожного курсу назавжди і 7 днів повного доступу до всього каталогу. Картка не потрібна.

Зареєструватися безкоштовноАбо пробний урок без реєстрації →
У цьому уроці
What Is Function CallingDefining Tool FunctionsChat with Automatic Function CallingMath Tools ExampleInspecting Chat HistoryManual Loop on the Interactions APIModes and Parallel CallsAuto Schema GenerationHow Many Functions to PassПрактикаГотовий промптКвіз
КурсиКурси з LLMДля командТарифиПитання та відповідіБлогПро насКонфіденційність
© 2026 AcademlРозробка та просування сайтів —MMIX — Marketing Mix
Почати безкоштовно