GenUiCatalogWeight class

How much of every prompt one component takes up.

A catalog is sent to the model on every request. Nobody measures it, because nothing makes it visible: the schema is generated, the prompt is assembled somewhere else, and the bill arrives monthly. This puts a number on each component, in the characters its schema occupies, so the three components that take half the prompt can be found and argued about.

Characters rather than tokens on purpose. Tokens depend on the model doing the counting, and a number that pretends to be exact about someone else's tokenizer is worse than a proportional one that is honest.

Constructors

GenUiCatalogWeight({required int total, required Map<String, int> byComponent, required int shared})
Creates a GenUiCatalogWeight.
const

Properties

byComponent → Map<String, int>
The size of each component's own schema, largest first.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shared → int
What is left: the shared definitions, the functions, the envelope.
final
total → int
The size of the whole document.
final

Methods

describe() → String
A table, largest first, for a test that prints it or a CI job that keeps it in the log.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shareOf(String component) → double
The share of the document one component takes, from 0 to 1.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited