Record Class Qwen3ChatTemplate.Variant

java.lang.Object
java.lang.Record
smile.llm.template.Qwen3ChatTemplate.Variant
Record Components:
reasoningEffort - renders the reasoning-effort system instructions while thinking is on.
thinkingDefaultOn - thinking is on unless enable_thinking is false (otherwise: only when true).
honorPreserveThinking - assistant turns before the last user query keep their think block unless preserve_thinking is false (otherwise: only turns after that query do).
splitThinkFromContent - a </think> inside assistant content is split into reasoning and answer.
tojsonScalars - non-string tool arguments are rendered as JSON (otherwise only mappings and lists; scalars as Python str()).
Enclosing class:
Qwen3ChatTemplate

public static record Qwen3ChatTemplate.Variant(boolean reasoningEffort, boolean thinkingDefaultOn, boolean honorPreserveThinking, boolean splitThinkFromContent, boolean tojsonScalars) extends Record
The behaviours in which the released Qwen3.x templates differ.
  • Field Details

  • Constructor Details

    • Variant

      public Variant(boolean reasoningEffort, boolean thinkingDefaultOn, boolean honorPreserveThinking, boolean splitThinkFromContent, boolean tojsonScalars)
      Creates an instance of a Variant record class.
      Parameters:
      reasoningEffort - the value for the reasoningEffort record component
      thinkingDefaultOn - the value for the thinkingDefaultOn record component
      honorPreserveThinking - the value for the honorPreserveThinking record component
      splitThinkFromContent - the value for the splitThinkFromContent record component
      tojsonScalars - the value for the tojsonScalars record component
  • Method Details

    • detect

      public static Qwen3ChatTemplate.Variant detect(String jinja)
      Reads the behaviours from the text of a chat_template.jinja.
      Parameters:
      jinja - the template source.
      Returns:
      the variant.
    • 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. All components in this record class 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.
    • reasoningEffort

      public boolean reasoningEffort()
      Returns the value of the reasoningEffort record component.
      Returns:
      the value of the reasoningEffort record component
    • thinkingDefaultOn

      public boolean thinkingDefaultOn()
      Returns the value of the thinkingDefaultOn record component.
      Returns:
      the value of the thinkingDefaultOn record component
    • honorPreserveThinking

      public boolean honorPreserveThinking()
      Returns the value of the honorPreserveThinking record component.
      Returns:
      the value of the honorPreserveThinking record component
    • splitThinkFromContent

      public boolean splitThinkFromContent()
      Returns the value of the splitThinkFromContent record component.
      Returns:
      the value of the splitThinkFromContent record component
    • tojsonScalars

      public boolean tojsonScalars()
      Returns the value of the tojsonScalars record component.
      Returns:
      the value of the tojsonScalars record component