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):
systemPromptnon-null and non-blank.userPromptnon-null. Empty string is allowed — some flows send a system-only prompt with the document data already encoded into the system message.responseSchemanon-null. The library always supplies a schema even if the caller did not requestwithProvenance()/withConfidence().optionsnon-null.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionProviderRequest(String systemPrompt, String userPrompt, com.fasterxml.jackson.databind.JsonNode responseSchema, ProviderOptions options) Creates an instance of aProviderRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.options()Returns the value of theoptionsrecord component.com.fasterxml.jackson.databind.JsonNodeReturns the value of theresponseSchemarecord component.Returns the value of thesystemPromptrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theuserPromptrecord component.
-
Constructor Details
-
ProviderRequest
public ProviderRequest(String systemPrompt, String userPrompt, com.fasterxml.jackson.databind.JsonNode responseSchema, ProviderOptions options) Creates an instance of aProviderRequestrecord class.- Parameters:
systemPrompt- the value for thesystemPromptrecord componentuserPrompt- the value for theuserPromptrecord componentresponseSchema- the value for theresponseSchemarecord componentoptions- the value for theoptionsrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
systemPrompt
Returns the value of thesystemPromptrecord component.- Returns:
- the value of the
systemPromptrecord component
-
userPrompt
Returns the value of theuserPromptrecord component.- Returns:
- the value of the
userPromptrecord component
-
responseSchema
public com.fasterxml.jackson.databind.JsonNode responseSchema()Returns the value of theresponseSchemarecord component.- Returns:
- the value of the
responseSchemarecord component
-
options
-