Package ai.extend.types
Class FileContents.Builder
- java.lang.Object
-
- ai.extend.types.FileContents.Builder
-
- Enclosing class:
- FileContents
public static final class FileContents.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileContentsbuild()FileContents.Builderfrom(FileContents other)FileContents.Builderpages(java.util.List<FileContentsPagesItem> pages)FileContents.Builderpages(java.util.Optional<java.util.List<FileContentsPagesItem>> pages)Page-level content for document file types.FileContents.BuilderrawText(java.lang.String rawText)FileContents.BuilderrawText(java.util.Optional<java.lang.String> rawText)The raw text content of the file.FileContents.Buildersections(java.util.List<FileContentsSectionsItem> sections)FileContents.Buildersections(java.util.Optional<java.util.List<FileContentsSectionsItem>> sections)Section-level content for documents that support section-based chunking.FileContents.Buildersheets(java.util.List<FileContentsSheetsItem> sheets)FileContents.Buildersheets(java.util.Optional<java.util.List<FileContentsSheetsItem>> sheets)Sheet-level content for spreadsheet file types.
-
-
-
Method Detail
-
from
public FileContents.Builder from(FileContents other)
-
rawText
public FileContents.Builder rawText(java.util.Optional<java.lang.String> rawText)
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
-
rawText
public FileContents.Builder rawText(java.lang.String rawText)
-
pages
public FileContents.Builder pages(java.util.Optional<java.util.List<FileContentsPagesItem>> pages)
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
-
pages
public FileContents.Builder pages(java.util.List<FileContentsPagesItem> pages)
-
sections
public FileContents.Builder sections(java.util.Optional<java.util.List<FileContentsSectionsItem>> sections)
Section-level content for documents that support section-based chunking. Available for PDF and IMG file types.
-
sections
public FileContents.Builder sections(java.util.List<FileContentsSectionsItem> sections)
-
sheets
public FileContents.Builder sheets(java.util.Optional<java.util.List<FileContentsSheetsItem>> sheets)
Sheet-level content for spreadsheet file types. Available for EXCEL files.
-
sheets
public FileContents.Builder sheets(java.util.List<FileContentsSheetsItem> sheets)
-
build
public FileContents build()
-
-