Function Calling for Knowledge Retrieval
Build an agent with two functions on the Responses API: arXiv paper search with embeddings and PDF summarization. The agent decides which function to call; covers strict mode, multiple calls per turn and the built-in file_search and web_search tools.
ENМатеріали курсів поки англійською. Інтерфейс, ШІ-наставник і перевірка завдань — українською.
Agent Architecture
In this example the agent has access to two functions:
- get_articles — searches arXiv for papers, downloads PDFs, computes embeddings
- read_article_and_summarize — reads a PDF from the local library and summarizes it
The example comes from an OpenAI Cookbook recipe that is now marked as archived: it uses older models and Chat Completions. Below is the same agent on the Responses API, which OpenAI recommends for new projects. gpt-6-luna is inexpensive and fits this kind of loop. The recipe's gpt-4o-mini is deprecated and shuts down on January 14, 2027, and OpenAI names gpt-6-luna as its replacement.
Далі урок відкривається після безкоштовної реєстрації
Реєстрація через email або Google відкриває перші два уроки кожного курсу назавжди і 7 днів повного доступу до всього каталогу. Картка не потрібна.


