Enum Class NaruTokenKind

java.lang.Object
java.lang.Enum<NaruTokenKind>
net.thevpc.naru.api.model.NaruTokenKind
All Implemented Interfaces:
Serializable, Comparable<NaruTokenKind>, Constable

public enum NaruTokenKind extends Enum<NaruTokenKind>
Which part of a model call a token belongs to.

Split out because reasoning is billed and metered differently from visible output, and the difference is invisible if both are folded into one "completion" number: a long think followed by a one-line answer looks identical to a long answer, even though they cost very different amounts and mean very different things when read back from a session.

  • Enum Constant Details

    • INPUT

      public static final NaruTokenKind INPUT
      Tokens the provider read: the system prompt, history, and tool results.
    • OUTPUT

      public static final NaruTokenKind OUTPUT
      Tokens the model produced that the user sees as the answer.
    • THINKING

      public static final NaruTokenKind THINKING
      Tokens the model spent reasoning before or instead of answering.

      Counted against consumption and limits, but kept separate from OUTPUT so a transcript can show what the model actually thought rather than only what it said.

  • Method Details

    • values

      public static NaruTokenKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NaruTokenKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • consumesContext

      public boolean consumesContext()
      Whether tokens of this kind occupy the model's context window.

      All three do. Reasoning is not free: it is generated text, and it has to be carried back in on the following request, so a context budget that ignores it under-counts by however much the model thought.

    • isBilled

      public boolean isBilled()
      Whether tokens of this kind are charged as model output.

      True for OUTPUT and THINKING, since providers bill reasoning tokens at output rates.

    • wireName

      public String wireName()
      The wire/display name, matching the token-kind names providers use in their usage payloads.