Record Class ProviderRequest

java.lang.Object
java.lang.Record
ai.doctruth.ProviderRequest
Record Components:
systemPrompt - the instructions / role prompt.
userPrompt - the document content rendered for the LLM.
responseSchema - Jackson-shaped JSON Schema describing the target type.
options - per-call options (retries + timeout).

public record ProviderRequest(String systemPrompt, String userPrompt, com.fasterxml.jackson.databind.JsonNode responseSchema, ProviderOptions options) extends Record
What the library hands an LlmProvider on every call: the system prompt, the user prompt (rendered from a ParsedDocument by the configured ContextStrategy), the JSON Schema for the target type, and the per-call options.

Invariants (compact constructor):

  • systemPrompt non-null and non-blank.
  • userPrompt non-null. Empty string is allowed — some flows send a system-only prompt with the document data already encoded into the system message.
  • responseSchema non-null. The library always supplies a schema even if the caller did not request withProvenance() / withConfidence().
  • options non-null.
Since:
0.1.0
  • Constructor Details

    • ProviderRequest

      public ProviderRequest(String systemPrompt, String userPrompt, com.fasterxml.jackson.databind.JsonNode responseSchema, ProviderOptions options)
      Creates an instance of a ProviderRequest record class.
      Parameters:
      systemPrompt - the value for the systemPrompt record component
      userPrompt - the value for the userPrompt record component
      responseSchema - the value for the responseSchema record component
      options - the value for the options 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.
    • systemPrompt

      public String systemPrompt()
      Returns the value of the systemPrompt record component.
      Returns:
      the value of the systemPrompt record component
    • userPrompt

      public String userPrompt()
      Returns the value of the userPrompt record component.
      Returns:
      the value of the userPrompt record component
    • responseSchema

      public com.fasterxml.jackson.databind.JsonNode responseSchema()
      Returns the value of the responseSchema record component.
      Returns:
      the value of the responseSchema record component
    • options

      public ProviderOptions options()
      Returns the value of the options record component.
      Returns:
      the value of the options record component