Package com.tnsai.rag
Record Class ExtractionContext
java.lang.Object
java.lang.Record
com.tnsai.rag.ExtractionContext
- Record Components:
sourceName- knowledge-source declaration nameattributes- extractor-neutral invocation attributesmaxInputBytes- maximum admitted raw input bytesmaxContentChars- maximum normalized whole-document charactersmaxBlocks- maximum structural blocksmaxBlockChars- maximum characters in one structural blockmaxStructuralPathChars- maximum characters in one structural pathmaxTotalBlockChars- maximum characters across all blocksmaxTotalStructuralPathChars- maximum structural-path characters across all blocksmaxTotalMetadataEntries- maximum metadata keys and values across the outputmaxTotalMetadataChars- maximum scalar characters across output metadata
public record ExtractionContext(String sourceName, Map<String,Object> attributes, int maxInputBytes, int maxContentChars, int maxBlocks, int maxBlockChars, int maxStructuralPathChars, int maxTotalBlockChars, int maxTotalStructuralPathChars, int maxTotalMetadataEntries, int maxTotalMetadataChars)
extends Record
Immutable declaration context supplied to document extractors.
Attribute values follow the immutable metadata algebra and bounds documented
by
DocumentInput.- Since:
- 0.13.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum normalized text size per structural block.static final intDefault maximum number of structural blocks per document.static final intDefault maximum normalized document text size.static final intDefault maximum raw input size per extracted document.static final intDefault maximum structural path size per block.static final intDefault maximum normalized text across all structural blocks.static final intDefault maximum scalar characters across one output's metadata.static final intDefault maximum metadata keys and values across one output.static final intDefault maximum path characters across all structural blocks. -
Constructor Summary
ConstructorsConstructorDescriptionExtractionContext(String sourceName, Map<String, Object> attributes) Creates a context with the framework's bounded extraction defaults.ExtractionContext(String sourceName, Map<String, Object> attributes, int maxInputBytes, int maxContentChars, int maxBlocks, int maxBlockChars, int maxStructuralPathChars, int maxTotalBlockChars, int maxTotalStructuralPathChars, int maxTotalMetadataEntries, int maxTotalMetadataChars) Creates an instance of aExtractionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.final booleanIndicates whether some other object is "equal to" this one.static ExtractionContextCreates a context without optional attributes.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxBlockCharsrecord component.intReturns the value of themaxBlocksrecord component.intReturns the value of themaxContentCharsrecord component.intReturns the value of themaxInputBytesrecord component.intReturns the value of themaxStructuralPathCharsrecord component.intReturns the value of themaxTotalBlockCharsrecord component.intReturns the value of themaxTotalMetadataCharsrecord component.intReturns the value of themaxTotalMetadataEntriesrecord component.intReturns the value of themaxTotalStructuralPathCharsrecord component.Returns the value of thesourceNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_MAX_INPUT_BYTES
public static final int DEFAULT_MAX_INPUT_BYTESDefault maximum raw input size per extracted document.- See Also:
-
DEFAULT_MAX_CONTENT_CHARS
public static final int DEFAULT_MAX_CONTENT_CHARSDefault maximum normalized document text size.- See Also:
-
DEFAULT_MAX_BLOCKS
public static final int DEFAULT_MAX_BLOCKSDefault maximum number of structural blocks per document.- See Also:
-
DEFAULT_MAX_BLOCK_CHARS
public static final int DEFAULT_MAX_BLOCK_CHARSDefault maximum normalized text size per structural block.- See Also:
-
DEFAULT_MAX_STRUCTURAL_PATH_CHARS
public static final int DEFAULT_MAX_STRUCTURAL_PATH_CHARSDefault maximum structural path size per block.- See Also:
-
DEFAULT_MAX_TOTAL_BLOCK_CHARS
public static final int DEFAULT_MAX_TOTAL_BLOCK_CHARSDefault maximum normalized text across all structural blocks.- See Also:
-
DEFAULT_MAX_TOTAL_STRUCTURAL_PATH_CHARS
public static final int DEFAULT_MAX_TOTAL_STRUCTURAL_PATH_CHARSDefault maximum path characters across all structural blocks.- See Also:
-
DEFAULT_MAX_TOTAL_METADATA_ENTRIES
public static final int DEFAULT_MAX_TOTAL_METADATA_ENTRIESDefault maximum metadata keys and values across one output.- See Also:
-
DEFAULT_MAX_TOTAL_METADATA_CHARS
public static final int DEFAULT_MAX_TOTAL_METADATA_CHARSDefault maximum scalar characters across one output's metadata.- See Also:
-
-
Constructor Details
-
ExtractionContext
public ExtractionContext(String sourceName, Map<String, Object> attributes, int maxInputBytes, int maxContentChars, int maxBlocks, int maxBlockChars, int maxStructuralPathChars, int maxTotalBlockChars, int maxTotalStructuralPathChars, int maxTotalMetadataEntries, int maxTotalMetadataChars) Creates an instance of aExtractionContextrecord class.- Parameters:
sourceName- the value for thesourceNamerecord componentattributes- the value for theattributesrecord componentmaxInputBytes- the value for themaxInputBytesrecord componentmaxContentChars- the value for themaxContentCharsrecord componentmaxBlocks- the value for themaxBlocksrecord componentmaxBlockChars- the value for themaxBlockCharsrecord componentmaxStructuralPathChars- the value for themaxStructuralPathCharsrecord componentmaxTotalBlockChars- the value for themaxTotalBlockCharsrecord componentmaxTotalStructuralPathChars- the value for themaxTotalStructuralPathCharsrecord componentmaxTotalMetadataEntries- the value for themaxTotalMetadataEntriesrecord componentmaxTotalMetadataChars- the value for themaxTotalMetadataCharsrecord component
-
ExtractionContext
Creates a context with the framework's bounded extraction defaults.- Parameters:
sourceName- knowledge-source declaration nameattributes- extractor-neutral invocation attributes
-
-
Method Details
-
forSource
Creates a context without optional attributes. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
sourceName
Returns the value of thesourceNamerecord component.- Returns:
- the value of the
sourceNamerecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
maxInputBytes
public int maxInputBytes()Returns the value of themaxInputBytesrecord component.- Returns:
- the value of the
maxInputBytesrecord component
-
maxContentChars
public int maxContentChars()Returns the value of themaxContentCharsrecord component.- Returns:
- the value of the
maxContentCharsrecord component
-
maxBlocks
public int maxBlocks()Returns the value of themaxBlocksrecord component.- Returns:
- the value of the
maxBlocksrecord component
-
maxBlockChars
public int maxBlockChars()Returns the value of themaxBlockCharsrecord component.- Returns:
- the value of the
maxBlockCharsrecord component
-
maxStructuralPathChars
public int maxStructuralPathChars()Returns the value of themaxStructuralPathCharsrecord component.- Returns:
- the value of the
maxStructuralPathCharsrecord component
-
maxTotalBlockChars
public int maxTotalBlockChars()Returns the value of themaxTotalBlockCharsrecord component.- Returns:
- the value of the
maxTotalBlockCharsrecord component
-
maxTotalStructuralPathChars
public int maxTotalStructuralPathChars()Returns the value of themaxTotalStructuralPathCharsrecord component.- Returns:
- the value of the
maxTotalStructuralPathCharsrecord component
-
maxTotalMetadataEntries
public int maxTotalMetadataEntries()Returns the value of themaxTotalMetadataEntriesrecord component.- Returns:
- the value of the
maxTotalMetadataEntriesrecord component
-
maxTotalMetadataChars
public int maxTotalMetadataChars()Returns the value of themaxTotalMetadataCharsrecord component.- Returns:
- the value of the
maxTotalMetadataCharsrecord component
-