Record Class Store.ChatRequest

java.lang.Object
java.lang.Record
com.oracle.coherence.rag.api.Store.ChatRequest
Record Components:
chatModel - name of the chat model to use (null for default)
question - the user question to answer
maxResults - maximum number of context documents to retrieve
minScore - minimum relevance score for context documents
fullTextWeight - weight for full-text search in context retrieval (0.0-1.0)
scoringModel - optional scoring model for context re-ranking
Enclosing class:
Store

public static record Store.ChatRequest(String chatModel, String question, int maxResults, double minScore, double fullTextWeight, String scoringModel) extends Record
Request object for chat operations with RAG context retrieval.

This record encapsulates all parameters needed for RAG-enhanced chat functionality, including model selection, context retrieval settings, and optional result re-ranking.

Since:
25.09
Author:
Aleks Seovic 2025.07.04
  • Constructor Details

    • ChatRequest

      public ChatRequest(String chatModel, String question, int maxResults, double minScore, double fullTextWeight, String scoringModel)
      Creates an instance of a ChatRequest record class.
      Parameters:
      chatModel - the value for the chatModel record component
      question - the value for the question record component
      maxResults - the value for the maxResults record component
      minScore - the value for the minScore record component
      fullTextWeight - the value for the fullTextWeight record component
      scoringModel - the value for the scoringModel record component
  • Method Details

    • maxResults

      public int maxResults()
      Returns the maximum results with a default value.

      This method ensures a sensible default when maxResults is 0.

      Returns:
      maxResults or 5 if maxResults is 0
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • chatModel

      public String chatModel()
      Returns the value of the chatModel record component.
      Returns:
      the value of the chatModel record component
    • question

      public String question()
      Returns the value of the question record component.
      Returns:
      the value of the question record component
    • minScore

      public double minScore()
      Returns the value of the minScore record component.
      Returns:
      the value of the minScore record component
    • fullTextWeight

      public double fullTextWeight()
      Returns the value of the fullTextWeight record component.
      Returns:
      the value of the fullTextWeight record component
    • scoringModel

      public String scoringModel()
      Returns the value of the scoringModel record component.
      Returns:
      the value of the scoringModel record component