Package com.tnsai.llm

Record Class LLMClientSettings

java.lang.Object
java.lang.Record
com.tnsai.llm.LLMClientSettings

public record LLMClientSettings(String endpoint, String apiKeyEnv, int timeoutMs, float frequencyPenalty, float presencePenalty) extends Record
Phase 1 transport / sampling extras from LLMSpec (TAN-3637).

Defaults match LLMSpec: empty endpoint and apiKeyEnv, timeoutMs=60000, penalties 0. Non-default values are honored by OpenAI and Ollama; other providers fail loud.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LLMClientSettings(String endpoint, String apiKeyEnv, int timeoutMs, float frequencyPenalty, float presencePenalty)
    Creates an instance of a LLMClientSettings record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the apiKeyEnv record component.
     
    Returns the value of the endpoint record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the frequencyPenalty record component.
    from(com.tnsai.annotations.LLMSpec spec)
     
    final int
    Returns a hash code value for this object.
    boolean
     
    float
    Returns the value of the presencePenalty record component.
    int
    Returns the value of the timeoutMs record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • LLMClientSettings

      public LLMClientSettings(String endpoint, String apiKeyEnv, int timeoutMs, float frequencyPenalty, float presencePenalty)
      Creates an instance of a LLMClientSettings record class.
      Parameters:
      endpoint - the value for the endpoint record component
      apiKeyEnv - the value for the apiKeyEnv record component
      timeoutMs - the value for the timeoutMs record component
      frequencyPenalty - the value for the frequencyPenalty record component
      presencePenalty - the value for the presencePenalty record component
  • Method Details

    • defaults

      public static LLMClientSettings defaults()
    • from

      public static LLMClientSettings from(com.tnsai.annotations.LLMSpec spec)
    • hasNonDefault

      public boolean hasNonDefault()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • apiKeyEnv

      public String apiKeyEnv()
      Returns the value of the apiKeyEnv record component.
      Returns:
      the value of the apiKeyEnv record component
    • timeoutMs

      public int timeoutMs()
      Returns the value of the timeoutMs record component.
      Returns:
      the value of the timeoutMs record component
    • frequencyPenalty

      public float frequencyPenalty()
      Returns the value of the frequencyPenalty record component.
      Returns:
      the value of the frequencyPenalty record component
    • presencePenalty

      public float presencePenalty()
      Returns the value of the presencePenalty record component.
      Returns:
      the value of the presencePenalty record component