Record Class ModelMetadata

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.ai.ModelMetadata
Record Components:
name - the provider-recognized identifier for this model, e.g. "sonnet-4.6" or "opus-4.7" — the value passed through to the provider API when invoking the model.
maxContextTokens - the size of this model's context window in tokens — the combined budget for the system prompt, conversation history, tool specifications, the user's request, and the model's response.
maxOutputTokens - the model's maximum number of output (completion) tokens, or 0 when the provider does not report one. A caller that must send an explicit output cap uses its own default when this is 0.
capabilities - the optional model capabilities advertised to callers, e.g. strict JSON Schema response format. May be empty (or null) for models that advertise no special capabilities; null is normalized to an empty set.

public record ModelMetadata(String name, int maxContextTokens, int maxOutputTokens, Set<ModelCapability> capabilities) extends Record
Describes a single model offered by a provider.
  • Constructor Details

    • ModelMetadata

      public ModelMetadata(String name, int maxContextTokens, int maxOutputTokens, @Nullable Set<ModelCapability> capabilities)
      Creates an instance of a ModelMetadata record class.
      Parameters:
      name - the value for the name record component
      maxContextTokens - the value for the maxContextTokens record component
      maxOutputTokens - the value for the maxOutputTokens record component
      capabilities - the value for the capabilities record component
    • ModelMetadata

      public ModelMetadata(String name, int maxContextTokens, @Nullable Set<ModelCapability> capabilities)
      Constructor for callers that do not report a max-output cap; leaves it as 0.
  • Method Details

    • of

      public static ModelMetadata of(String name, int maxContextTokens)
      Construct a ModelMetadata with no advertised capabilities. Preferred over the positional constructor for callers that do not advertise any capability.
    • of

      public static ModelMetadata of(String name, int maxContextTokens, int maxOutputTokens)
      As of(String, int), additionally advertising the model's max-output-token cap.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • maxContextTokens

      public int maxContextTokens()
      Returns the value of the maxContextTokens record component.
      Returns:
      the value of the maxContextTokens record component
    • maxOutputTokens

      public int maxOutputTokens()
      Returns the value of the maxOutputTokens record component.
      Returns:
      the value of the maxOutputTokens record component
    • capabilities

      public Set<ModelCapability> capabilities()
      Returns the value of the capabilities record component.
      Returns:
      the value of the capabilities record component