Package com.tnsai.llm.observability
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)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCache-control metadata for prompt-caching providers (Anthropic, Google). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecacheInforecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.messages()Returns the value of themessagesrecord component.Returns the value of theparametersrecord component.Returns the value of thesystemPromptrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LLMPrompt
public LLMPrompt(List<Map<String, Object>> messages, Optional<String> systemPrompt, Map<String, Object> parameters, LLMPrompt.PromptCacheInfo cacheInfo) Creates an instance of aLLMPromptrecord class.- Parameters:
messages- the value for themessagesrecord componentsystemPrompt- the value for thesystemPromptrecord componentparameters- the value for theparametersrecord componentcacheInfo- the value for thecacheInforecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-
systemPrompt
Returns the value of thesystemPromptrecord component.- Returns:
- the value of the
systemPromptrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
cacheInfo
Returns the value of thecacheInforecord component.- Returns:
- the value of the
cacheInforecord component
-