Record Class GenerationRequest

java.lang.Object
java.lang.Record
uno.anahata.asi.agi.provider.GenerationRequest
Record Components:
config - The configuration for the generation request, including behavioral parameters (temperature, topK, etc.) and tool definitions.
history - The list of messages forming the conversation history to be sent to the model. This list is typically filtered and processed by the ContextManager before being encapsulated in this request.

public record GenerationRequest(@NonNull RequestConfig config, @NonNull List<AbstractMessage> history) extends Record
A simple, immutable record that encapsulates all the information required for a model to generate content: the configuration and the conversation history.

This record serves as the primary input for the generateContent and generateContentStream methods in AbstractModel. It decouples the model implementation from the complex Agi orchestrator by providing a snapshot of the request parameters and the relevant message history.

Author:
anahata-ai
  • Field Details

  • Constructor Details

    • GenerationRequest

      public GenerationRequest(@NonNull @NonNull RequestConfig config, @NonNull @NonNull List<AbstractMessage> history)
      Creates an instance of a GenerationRequest record class.
      Parameters:
      config - the value for the config record component
      history - the value for the history record component
  • Method Details

    • 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.
    • config

      @NonNull public @NonNull RequestConfig config()
      Returns the value of the config record component.
      Returns:
      the value of the config record component
    • history

      @NonNull public @NonNull List<AbstractMessage> history()
      Returns the value of the history record component.
      Returns:
      the value of the history record component