Class DecisionConfig

java.lang.Object
dyntabs.ai.decision.DecisionConfig

public final class DecisionConfig extends Object
Immutable settings for EasyAI.decide(...) — the cheap, probability-returning decision call.

Resolution order (first non-blank wins)

  • provider: easyai.decision.provider → easyai.provider → "openai"
  • API key: easyai.decision.api-key → easyai.api-key
  • base URL: easyai.decision.base-url → easyai.base-url
  • model: easyai.decision.model-name → "gpt-6-luna"

⚠ Read this if your chat provider is not OpenAI

A decision model is a dedicated endpoint, not a chat completion with an extra parameter. OpenAI serves it at POST {baseUrl}/decisions with its own small model. OpenAI-compatible chat providers such as Groq or DeepSeek do not implement that endpoint at all and answer 404, so "OpenAI-compatible" buys you nothing here. So unlike voice, where inheriting the chat endpoint is almost always right, here inheritance is only right when your chat provider is OpenAI.

If it is not, set both explicitly:

 easyai.decision.api-key=sk-...
 easyai.decision.base-url=https://api.openai.com/v1/
 

We inherit anyway rather than guessing, because a provider-level authentication or 404 error is unambiguous, whereas a library quietly swapping your endpoint is not.

Analogy: a precision instrument that needs mains power. It will accept the socket the rest of the workshop uses, but if that socket is a different voltage you must say so — the instrument is not going to guess, and a blown fuse tells you more than a silent adapter.

See Also:
  • Field Details

    • DEFAULT_MODEL

      public static final String DEFAULT_MODEL
      Default decision model. OpenAI exposes a dedicated, small model for this call — it is not a chat model, which is the whole point: one fast, cheap call instead of a full generation.
      See Also:
  • Method Details

    • provider

      public String provider()
      Returns:
      the provider id, e.g. "openai".
    • apiKey

      public String apiKey()
      Returns:
      the API key, or null if none was configured.
    • baseUrl

      public String baseUrl()
      Returns:
      the base URL override, or null to use the provider's default.
    • modelName

      public String modelName()
      Returns:
      the decision model name.
    • toBuilder

      public DecisionConfig.Builder toBuilder()
      Returns:
      a builder pre-filled with this configuration, for making a modified copy.
    • builder

      public static DecisionConfig.Builder builder()
      Returns:
      a new, empty builder.
    • forDeciding

      public static DecisionConfig forDeciding()
      Load the decision configuration from easyai.properties, falling back to the chat settings as described in the class documentation.
      Returns:
      settings for EasyAI.decide(String)
    • toString

      public String toString()
      Overrides:
      toString in class Object