Record Class LLMPrompt

java.lang.Object
java.lang.Record
com.tnsai.llm.observability.LLMPrompt

public record LLMPrompt(List<Map<String,Object>> messages, Optional<String> systemPrompt, Map<String,Object> parameters, LLMPrompt.PromptCacheInfo cacheInfo) extends Record
Captured input side of an LLM call (issue #79).

Contains the full message history sent to the provider, optional system prompt, the parameters dict (temperature, top-p, max-tokens, etc.), and prompt-cache metadata. The messages format is the provider-agnostic Map<String,Object> the framework already passes around — typed-message-conversion belongs to a follow-up.

Privacy: this record holds the raw prompt text. The capture wrapper (follow-up PR — AbstractLLMClient integration) is responsible for routing through the redaction SPI before publication when the tenant's capture mode is HASH_ONLY or REDACTED.

Since:
0.5.0 (issue #79)
  • Constructor Details

    • LLMPrompt

      public LLMPrompt(List<Map<String,Object>> messages, Optional<String> systemPrompt, Map<String,Object> parameters, LLMPrompt.PromptCacheInfo cacheInfo)
      Creates an instance of a LLMPrompt record class.
      Parameters:
      messages - the value for the messages record component
      systemPrompt - the value for the systemPrompt record component
      parameters - the value for the parameters record component
      cacheInfo - the value for the cacheInfo 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.
    • messages

      public List<Map<String,Object>> messages()
      Returns the value of the messages record component.
      Returns:
      the value of the messages record component
    • systemPrompt

      public Optional<String> systemPrompt()
      Returns the value of the systemPrompt record component.
      Returns:
      the value of the systemPrompt record component
    • parameters

      public Map<String,Object> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • cacheInfo

      public LLMPrompt.PromptCacheInfo cacheInfo()
      Returns the value of the cacheInfo record component.
      Returns:
      the value of the cacheInfo record component