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, or0when the provider does not report one. A caller that must send an explicit output cap uses its own default when this is0.capabilities- the optional model capabilities advertised to callers, e.g. strict JSON Schema response format. May be empty (ornull) for models that advertise no special capabilities;nullis 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 Summary
ConstructorsConstructorDescriptionModelMetadata(String name, int maxContextTokens, int maxOutputTokens, @Nullable Set<ModelCapability> capabilities) Creates an instance of aModelMetadatarecord class.ModelMetadata(String name, int maxContextTokens, @Nullable Set<ModelCapability> capabilities) Constructor for callers that do not report a max-output cap; leaves it as0. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecapabilitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxContextTokensrecord component.intReturns the value of themaxOutputTokensrecord component.name()Returns the value of thenamerecord component.static ModelMetadataConstruct aModelMetadatawith no advertised capabilities.static ModelMetadataAsof(String, int), additionally advertising the model's max-output-token cap.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModelMetadata
public ModelMetadata(String name, int maxContextTokens, int maxOutputTokens, @Nullable Set<ModelCapability> capabilities) Creates an instance of aModelMetadatarecord class.- Parameters:
name- the value for thenamerecord componentmaxContextTokens- the value for themaxContextTokensrecord componentmaxOutputTokens- the value for themaxOutputTokensrecord componentcapabilities- the value for thecapabilitiesrecord 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 as0.
-
-
Method Details
-
of
Construct aModelMetadatawith no advertised capabilities. Preferred over the positional constructor for callers that do not advertise any capability. -
of
Asof(String, int), additionally advertising the model's max-output-token cap. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
maxContextTokens
public int maxContextTokens()Returns the value of themaxContextTokensrecord component.- Returns:
- the value of the
maxContextTokensrecord component
-
maxOutputTokens
public int maxOutputTokens()Returns the value of themaxOutputTokensrecord component.- Returns:
- the value of the
maxOutputTokensrecord component
-
capabilities
Returns the value of thecapabilitiesrecord component.- Returns:
- the value of the
capabilitiesrecord component
-