Class ParserRun.Builder
- java.lang.Object
-
- ai.extend.types.ParserRun.Builder
-
- All Implemented Interfaces:
ParserRun._FinalStage,ParserRun.ConfigStage,ParserRun.FileIdStage,ParserRun.IdStage,ParserRun.MetricsStage,ParserRun.StatusStage
- Enclosing class:
- ParserRun
public static final class ParserRun.Builder extends java.lang.Object implements ParserRun.IdStage, ParserRun.FileIdStage, ParserRun.StatusStage, ParserRun.MetricsStage, ParserRun.ConfigStage, ParserRun._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParserRun._FinalStageaddAllChunks(java.util.List<Chunk> chunks)An array of chunks that were parsed from the file.ParserRun._FinalStageaddChunks(Chunk chunks)An array of chunks that were parsed from the file.ParserRunbuild()ParserRun._FinalStagechunks(java.util.List<Chunk> chunks)An array of chunks that were parsed from the file.ParserRun._FinalStageconfig(ParseConfig config)The configuration used for the parsing process, including any default values that were applied.ParserRun._FinalStagefailureReason(java.lang.String failureReason)The reason for failure if status is "FAILED".ParserRun._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)The reason for failure if status is "FAILED".ParserRun.StatusStagefileId(java.lang.String fileId)The identifier of the file that was parsed.ParserRun.Builderfrom(ParserRun other)ParserRun.FileIdStageid(java.lang.String id)A unique identifier for the parser run.ParserRun.ConfigStagemetrics(ParserRunMetrics metrics)Metrics about the parsing process.ParserRun._FinalStageocr(ParserRunOcr ocr)Raw OCR data from the parsing process.ParserRun._FinalStageocr(java.util.Optional<ParserRunOcr> ocr)Raw OCR data from the parsing process.ParserRun.MetricsStagestatus(ParserRunStatusEnum status)The status of the parser run:ParserRun._FinalStageusage(ParserRunCredits usage)ParserRun._FinalStageusage(java.util.Optional<ParserRunCredits> usage)
-
-
-
Method Detail
-
from
public ParserRun.Builder from(ParserRun other)
- Specified by:
fromin interfaceParserRun.IdStage
-
id
public ParserRun.FileIdStage id(@NotNull java.lang.String id)
A unique identifier for the parser run. Will always start with
"parser_run_"Example:
"parser_run_xK9mLPqRtN3vS8wF5hB2cQ"A unique identifier for the parser run. Will always start with
"parser_run_"Example:
"parser_run_xK9mLPqRtN3vS8wF5hB2cQ"- Specified by:
idin interfaceParserRun.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
fileId
public ParserRun.StatusStage fileId(@NotNull java.lang.String fileId)
The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs.
The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs.
- Specified by:
fileIdin interfaceParserRun.FileIdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public ParserRun.MetricsStage status(@NotNull ParserRunStatusEnum status)
The status of the parser run:
"PROCESSED"- The file was successfully processed"FAILED"- The processing failed (see failureReason for details)
The status of the parser run:
"PROCESSED"- The file was successfully processed"FAILED"- The processing failed (see failureReason for details)
- Specified by:
statusin interfaceParserRun.StatusStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metrics
public ParserRun.ConfigStage metrics(@NotNull ParserRunMetrics metrics)
Metrics about the parsing process.
Metrics about the parsing process.
- Specified by:
metricsin interfaceParserRun.MetricsStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
config
public ParserRun._FinalStage config(@NotNull ParseConfig config)
The configuration used for the parsing process, including any default values that were applied.
The configuration used for the parsing process, including any default values that were applied.
- Specified by:
configin interfaceParserRun.ConfigStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
usage
public ParserRun._FinalStage usage(ParserRunCredits usage)
- Specified by:
usagein interfaceParserRun._FinalStage
-
usage
public ParserRun._FinalStage usage(java.util.Optional<ParserRunCredits> usage)
- Specified by:
usagein interfaceParserRun._FinalStage
-
failureReason
public ParserRun._FinalStage failureReason(java.lang.String failureReason)
The reason for failure if status is "FAILED".
- Specified by:
failureReasonin interfaceParserRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ParserRun._FinalStage failureReason(java.util.Optional<java.lang.String> failureReason)
The reason for failure if status is "FAILED".
- Specified by:
failureReasonin interfaceParserRun._FinalStage
-
ocr
public ParserRun._FinalStage ocr(ParserRunOcr ocr)
Raw OCR data from the parsing process. Only included when
returnOcris configured in the parse config's advanced options.- Specified by:
ocrin interfaceParserRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
ocr
public ParserRun._FinalStage ocr(java.util.Optional<ParserRunOcr> ocr)
Raw OCR data from the parsing process. Only included when
returnOcris configured in the parse config's advanced options.- Specified by:
ocrin interfaceParserRun._FinalStage
-
addAllChunks
public ParserRun._FinalStage addAllChunks(java.util.List<Chunk> chunks)
An array of chunks that were parsed from the file.
- Specified by:
addAllChunksin interfaceParserRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addChunks
public ParserRun._FinalStage addChunks(Chunk chunks)
An array of chunks that were parsed from the file.
- Specified by:
addChunksin interfaceParserRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
chunks
public ParserRun._FinalStage chunks(java.util.List<Chunk> chunks)
An array of chunks that were parsed from the file.
- Specified by:
chunksin interfaceParserRun._FinalStage
-
build
public ParserRun build()
- Specified by:
buildin interfaceParserRun._FinalStage
-
-