Package ai.extend.types
Class FileContents
- java.lang.Object
-
- ai.extend.types.FileContents
-
public final class FileContents extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileContents.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileContents.Builderbuilder()booleanequals(java.lang.Object other)java.util.Map<java.lang.String,java.lang.Object>getAdditionalProperties()java.util.Optional<java.util.List<FileContentsPagesItem>>getPages()java.util.Optional<java.lang.String>getRawText()java.util.Optional<java.util.List<FileContentsSectionsItem>>getSections()java.util.Optional<java.util.List<FileContentsSheetsItem>>getSheets()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getRawText
public java.util.Optional<java.lang.String> getRawText()
- Returns:
- The raw text content of the file. Available for all file types when the
rawTextquery parameter is set to true.- PDF/IMG: Concatenated raw text from all pages
- DOCX: The document's raw text
- CSV: Concatenated chunks or CSV text
- EXCEL: Not included (use
sheetsinstead) - TXT/XML/HTML: The file's text content
-
getPages
public java.util.Optional<java.util.List<FileContentsPagesItem>> getPages()
- Returns:
- Page-level content for document file types.
- PDF/IMG: Contains
pageNumber,pageHeight,pageWidth, andmarkdown(ifmarkdownquery param is true) - DOCX: Contains
pageNumberandhtml(ifhtmlquery param is true) - Other file types: Empty array
- PDF/IMG: Contains
-
getSections
public java.util.Optional<java.util.List<FileContentsSectionsItem>> getSections()
- Returns:
- Section-level content for documents that support section-based chunking. Available for PDF and IMG file types.
-
getSheets
public java.util.Optional<java.util.List<FileContentsSheetsItem>> getSheets()
- Returns:
- Sheet-level content for spreadsheet file types. Available for EXCEL files.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getAdditionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalProperties()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static FileContents.Builder builder()
-
-