Index Ai Academy
Glossary · Phase 1 · Building with LLMs

Decorator

Also written: decorators

A line starting with @ just above a function that adds extra behavior to it, such as @app.post("/api/answer").

Try it now

A fake model replays a script so you can see the shape. Each tool turn adds two messages. The loop ends when the reply isn't a tool request, and it prints 3 calls, 6 messages.

Learn it properly

The agent loop · Model → tool → result → model, until the task is done. About 30 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write