Record Class AiRequest

java.lang.Object
java.lang.Record
com.shaft.pilot.ai.AiRequest
Record Components:
requestId - safe request correlation identifier
purpose - purpose-bound operation name
schemaVersion - request contract version
text - primary text input
evidence - additional textual evidence
images - approved image evidence
desiredResponseSchema - desired JSON response schema
timeout - request timeout
budget - request budget
approvalPolicy - explicit processing and evidence approval
deterministicFallback - caller-owned deterministic result

public record AiRequest(String requestId, String purpose, String schemaVersion, String text, List<EvidenceReference> evidence, List<AiImage> images, com.fasterxml.jackson.databind.JsonNode desiredResponseSchema, Duration timeout, AiBudget budget, ApprovalPolicy approvalPolicy, com.fasterxml.jackson.databind.JsonNode deterministicFallback) extends Record
Immutable provider-neutral request.
  • Field Details

  • Constructor Details

  • Method Details

    • builder

      public static AiRequest.Builder builder(String purpose, com.fasterxml.jackson.databind.JsonNode responseSchema)
      Starts a request builder.
      Parameters:
      purpose - purpose-bound operation name
      responseSchema - desired JSON response schema
      Returns:
      request builder
    • evidenceCategories

      public Set<EvidenceCategory> evidenceCategories()
      Returns all evidence categories present in this request.
      Returns:
      immutable category set
    • withSanitizedContent

      public AiRequest withSanitizedContent(String sanitizedText, List<EvidenceReference> sanitizedEvidence)
      Creates a copy containing sanitized text and evidence.
      Parameters:
      sanitizedText - redacted primary text
      sanitizedEvidence - redacted evidence
      Returns:
      sanitized request copy
    • withTimeout

      public AiRequest withTimeout(Duration effectiveTimeout)
      Creates a copy with an effective timeout.
      Parameters:
      effectiveTimeout - timeout already constrained by global policy
      Returns:
      request copy
    • 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.
    • requestId

      public String requestId()
      Returns the value of the requestId record component.
      Returns:
      the value of the requestId record component
    • purpose

      public String purpose()
      Returns the value of the purpose record component.
      Returns:
      the value of the purpose record component
    • schemaVersion

      public String schemaVersion()
      Returns the value of the schemaVersion record component.
      Returns:
      the value of the schemaVersion record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • evidence

      public List<EvidenceReference> evidence()
      Returns the value of the evidence record component.
      Returns:
      the value of the evidence record component
    • images

      public List<AiImage> images()
      Returns the value of the images record component.
      Returns:
      the value of the images record component
    • desiredResponseSchema

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

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • budget

      public AiBudget budget()
      Returns the value of the budget record component.
      Returns:
      the value of the budget record component
    • approvalPolicy

      public ApprovalPolicy approvalPolicy()
      Returns the value of the approvalPolicy record component.
      Returns:
      the value of the approvalPolicy record component
    • deterministicFallback

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