Record Class AgentConfiguration.AgentSettings

java.lang.Object
java.lang.Record
com.tnsai.integration.scop.AgentConfiguration.AgentSettings
Enclosing class:
AgentConfiguration

public static record AgentConfiguration.AgentSettings(LLMOverrides llm) extends Record
The llm of one Agents entry, or of a file that holds only LLM settings.
Since:
0.17.5
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a AgentSettings record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromJson(org.json.JSONObject entry)
    Decodes an entry that holds only LLM settings, {"llm": {...}}, the field optional, without reading any file.
    final int
    Returns a hash code value for this object.
    llm()
    Returns the value of the llm 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
  • Constructor Details

    • AgentSettings

      public AgentSettings(LLMOverrides llm)
      Creates an instance of a AgentSettings record class.
      Parameters:
      llm - the value for the llm record component
  • Method Details

    • fromJson

      public static AgentConfiguration.AgentSettings fromJson(org.json.JSONObject entry)
      Decodes an entry that holds only LLM settings, {"llm": {...}}, the field optional, without reading any file. LLM settings go under llm, as {"llm": {"temperature": 0.2}}, and a flat setting such as {"temperature": 0.2} is an unknown field. knowledge and roles configure the agent type, in the run file's Agents.<Type> entry, which AgentConfiguration.parse(org.json.JSONObject) reads, or in the class's @Config file, so they fail here.
      Parameters:
      entry - one entry, as a JSON object
      Returns:
      the entry's llm
      Throws:
      IllegalArgumentException - if the entry has a field other than llm, a flat LLM setting, knowledge or roles included, or an llm that is not an object; a knowledgeSources key says where knowledge moved
      LLMConfigurationException - if llm holds an unknown or invalid field
      Since:
      0.17.5
    • 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 Objects::equals(Object,Object).
      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.
    • llm

      public LLMOverrides llm()
      Returns the value of the llm record component.
      Returns:
      the value of the llm record component