Interface ThinkOption

All Known Implementing Classes:
ThinkOption.ThinkBoolean, ThinkOption.ThinkLevel

public sealed interface ThinkOption permits ThinkOption.ThinkBoolean, ThinkOption.ThinkLevel
Represents the thinking option for Ollama models. The think option controls whether models emit their reasoning trace before the final answer.

Most models (Qwen 3, DeepSeek-v3.1, DeepSeek R1) accept boolean enable/disable. The GPT-OSS model requires string levels: "low", "medium", or "high".

Since:
1.1.0
Author:
Mark Pollack
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Boolean-style think option for models that support simple enable/disable.
    static final record 
    String-level think option for the GPT-OSS model which requires explicit levels.
    static class 
    Deserializer that reads boolean or string values into ThinkOption instances.
    static class 
    Serializer that writes ThinkOption as raw boolean or string values.
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts this think option to its JSON representation.
  • Method Details

    • toJsonValue

      Object toJsonValue()
      Converts this think option to its JSON representation.
      Returns:
      the JSON value (Boolean or String)