Enum Class OllamaObject.Thinking

java.lang.Object
java.lang.Enum<OllamaObject.Thinking>
me.neurodock.ollama.OllamaObject.Thinking
All Implemented Interfaces:
Serializable, Comparable<OllamaObject.Thinking>, Constable
Enclosing class:
OllamaObject

public static enum OllamaObject.Thinking extends Enum<OllamaObject.Thinking>
Represents the "thinking" tier that can be requested from an Ollama model via the think request field.

Support for this varies by model, and models that do support it do not agree on a single scheme:

All six values live in this single enum for convenience, but mixing schemes on a model that doesn't support the one you pick is a caller error — e.g. sending HIGH to a model that only understands TRUE/FALSE is not guaranteed to fail cleanly and may simply be ignored. Callers must know which scheme their target model expects before choosing a value here.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Thinking disabled, for models using the boolean on/off scheme.
    High thinking effort, for models using the graded-level scheme.
    Lowest thinking effort, for models using the graded-level scheme.
    Maximum thinking effort, for models using the graded-level scheme.
    Moderate thinking effort, for models using the graded-level scheme.
    Thinking enabled, for models using the boolean on/off scheme.
  • Method Summary

    Modifier and Type
    Method
    Description
    Resolves a OllamaObject.Thinking constant from its raw string value.
    Returns the raw string form of this tier, as expected by Ollama's think request field.
    boolean
    True if this constant belongs to the boolean on/off scheme, false if it's a graded level.
    void
    putInto(org.json.JSONObject json, String key)
    Puts this thinking tier into the given JSON object under the given key, using whichever JSON type Ollama expects for this constant — a real boolean for TRUE/FALSE, or a string for the graded levels.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TRUE

      public static final OllamaObject.Thinking TRUE
      Thinking enabled, for models using the boolean on/off scheme.
    • FALSE

      public static final OllamaObject.Thinking FALSE
      Thinking disabled, for models using the boolean on/off scheme.
    • LOW

      public static final OllamaObject.Thinking LOW
      Lowest thinking effort, for models using the graded-level scheme.
    • MEDIUM

      public static final OllamaObject.Thinking MEDIUM
      Moderate thinking effort, for models using the graded-level scheme.
    • HIGH

      public static final OllamaObject.Thinking HIGH
      High thinking effort, for models using the graded-level scheme.
    • MAX

      public static final OllamaObject.Thinking MAX
      Maximum thinking effort, for models using the graded-level scheme.
  • Method Details

    • values

      public static OllamaObject.Thinking[] 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 OllamaObject.Thinking 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
    • isBoolean

      public boolean isBoolean()
      True if this constant belongs to the boolean on/off scheme, false if it's a graded level.
    • putInto

      public void putInto(org.json.JSONObject json, String key)
      Puts this thinking tier into the given JSON object under the given key, using whichever JSON type Ollama expects for this constant — a real boolean for TRUE/FALSE, or a string for the graded levels.
    • getValue

      public String getValue()
      Returns the raw string form of this tier, as expected by Ollama's think request field.
      Returns:
      the raw value, e.g. "true" or "high"
    • fromValue

      public static OllamaObject.Thinking fromValue(String value)
      Resolves a OllamaObject.Thinking constant from its raw string value.

      Matching is case-insensitive; the input is lowercased before comparison.

      Parameters:
      value - the raw value to resolve, e.g. "true" or "HIGH"
      Returns:
      the matching OllamaObject.Thinking constant
      Throws:
      IllegalArgumentException - if no constant matches the given value