Skip to content

Glossary: Building with LLMs Basics

Dataclass

Also written: @dataclass

A Python decorator, `@dataclass`, that writes `__init__` and the field handling for a class. It suits a small record such as a `Usage` class that totals tokens and cost.

Where the book teaches it

Related terms

Usage