Class ProcessorRun.Builder
- java.lang.Object
-
- ai.extend.types.ProcessorRun.Builder
-
- All Implemented Interfaces:
ProcessorRun._FinalStage,ProcessorRun.ConfigStage,ProcessorRun.EditedStage,ProcessorRun.IdStage,ProcessorRun.ObjectStage,ProcessorRun.OutputStage,ProcessorRun.ProcessorIdStage,ProcessorRun.ProcessorNameStage,ProcessorRun.ProcessorVersionIdStage,ProcessorRun.ReviewedStage,ProcessorRun.StatusStage,ProcessorRun.TypeStage,ProcessorRun.UrlStage
- Enclosing class:
- ProcessorRun
public static final class ProcessorRun.Builder extends java.lang.Object implements ProcessorRun.ObjectStage, ProcessorRun.IdStage, ProcessorRun.ProcessorIdStage, ProcessorRun.ProcessorVersionIdStage, ProcessorRun.ProcessorNameStage, ProcessorRun.StatusStage, ProcessorRun.OutputStage, ProcessorRun.ReviewedStage, ProcessorRun.EditedStage, ProcessorRun.TypeStage, ProcessorRun.ConfigStage, ProcessorRun.UrlStage, ProcessorRun._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessorRun._FinalStageaddAllFiles(java.util.List<File> files)Details of the processed files.ProcessorRun._FinalStageaddAllMergedProcessors(java.util.List<ProcessorRunMergedProcessorsItem> mergedProcessors)An array of processors that were merged to create this output.ProcessorRun._FinalStageaddFiles(File files)Details of the processed files.ProcessorRun._FinalStageaddMergedProcessors(ProcessorRunMergedProcessorsItem mergedProcessors)An array of processors that were merged to create this output.ProcessorRunbuild()ProcessorRun.UrlStageconfig(ProcessorRunConfig config)The configuration used for this processor run.ProcessorRun.TypeStageedited(boolean edited)Indicates whether the run results have been edited.ProcessorRun._FinalStageedits(java.lang.String key, ExtractionOutputEdits value)ProcessorRun._FinalStageedits(java.util.Map<java.lang.String,ExtractionOutputEdits> edits)ProcessorRun._FinalStagefailureMessage(java.lang.String failureMessage)If the run failed, provides a detailed message about the failure.ProcessorRun._FinalStagefailureMessage(java.util.Optional<java.lang.String> failureMessage)If the run failed, provides a detailed message about the failure.ProcessorRun._FinalStagefailureReason(java.lang.String failureReason)If the run failed, indicates the reason for failure.ProcessorRun._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)If the run failed, indicates the reason for failure.ProcessorRun._FinalStagefiles(java.util.List<File> files)Details of the processed files.ProcessorRun.Builderfrom(ProcessorRun other)ProcessorRun.ProcessorIdStageid(java.lang.String id)The unique identifier for this processor run.ProcessorRun._FinalStageinitialOutput(ProcessorOutput initialOutput)The initial output from the processor run.ProcessorRun._FinalStageinitialOutput(java.util.Optional<ProcessorOutput> initialOutput)The initial output from the processor run.ProcessorRun._FinalStagemergedProcessors(java.util.List<ProcessorRunMergedProcessorsItem> mergedProcessors)An array of processors that were merged to create this output.ProcessorRun._FinalStagemetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)Any metadata that was provided when creating the processor run.ProcessorRun._FinalStagemetadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)Any metadata that was provided when creating the processor run.ProcessorRun.IdStageobject(java.lang.String object)The type of response.ProcessorRun.ReviewedStageoutput(ProcessorOutput output)The final output, either reviewed or initial.ProcessorRun.ProcessorVersionIdStageprocessorId(java.lang.String processorId)The ID of the processor used for this run.ProcessorRun.StatusStageprocessorName(java.lang.String processorName)The name of the processor.ProcessorRun.ProcessorNameStageprocessorVersionId(java.lang.String processorVersionId)The ID of the specific processor version used.ProcessorRun._FinalStageputAllEdits(java.util.Map<java.lang.String,ExtractionOutputEdits> edits)ProcessorRun.EditedStagereviewed(boolean reviewed)Indicates whether the run has been reviewed.ProcessorRun._FinalStagereviewedOutput(ProcessorOutput reviewedOutput)The output after review, if any.ProcessorRun._FinalStagereviewedOutput(java.util.Optional<ProcessorOutput> reviewedOutput)The output after review, if any.ProcessorRun.OutputStagestatus(ProcessorRunStatus status)The current status of the processor run:ProcessorRun.ConfigStagetype(ProcessorRunType type)The type of processor:ProcessorRun._FinalStageurl(java.lang.String url)The URL to view the processor run.
-
-
-
Method Detail
-
from
public ProcessorRun.Builder from(ProcessorRun other)
- Specified by:
fromin interfaceProcessorRun.ObjectStage
-
object
public ProcessorRun.IdStage object(@NotNull java.lang.String object)
The type of response. In this case, it will always be
"document_processor_run".The type of response. In this case, it will always be
"document_processor_run".- Specified by:
objectin interfaceProcessorRun.ObjectStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
id
public ProcessorRun.ProcessorIdStage id(@NotNull java.lang.String id)
The unique identifier for this processor run.
Example:
"dpr_Xj8mK2pL9nR4vT7qY5wZ"The unique identifier for this processor run.
Example:
"dpr_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
idin interfaceProcessorRun.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
processorId
public ProcessorRun.ProcessorVersionIdStage processorId(@NotNull java.lang.String processorId)
The ID of the processor used for this run.
Example:
"dp_Xj8mK2pL9nR4vT7qY5wZ"The ID of the processor used for this run.
Example:
"dp_Xj8mK2pL9nR4vT7qY5wZ"- Specified by:
processorIdin interfaceProcessorRun.ProcessorIdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
processorVersionId
public ProcessorRun.ProcessorNameStage processorVersionId(@NotNull java.lang.String processorVersionId)
The ID of the specific processor version used.
The ID of the specific processor version used.
- Specified by:
processorVersionIdin interfaceProcessorRun.ProcessorVersionIdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
processorName
public ProcessorRun.StatusStage processorName(@NotNull java.lang.String processorName)
The name of the processor.
Example:
"Invoice Processor"The name of the processor.
Example:
"Invoice Processor"- Specified by:
processorNamein interfaceProcessorRun.ProcessorNameStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public ProcessorRun.OutputStage status(@NotNull ProcessorRunStatus status)
The current status of the processor run:
"PROCESSING"- The processor is currently running"PROCESSED"- The processor has completed successfully"FAILED"- The processor encountered an error"CANCELLED"- The processor run was cancelled
The current status of the processor run:
"PROCESSING"- The processor is currently running"PROCESSED"- The processor has completed successfully"FAILED"- The processor encountered an error"CANCELLED"- The processor run was cancelled
- Specified by:
statusin interfaceProcessorRun.StatusStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
output
public ProcessorRun.ReviewedStage output(@NotNull ProcessorOutput output)
The final output, either reviewed or initial.
Conforms to the shape of output types and depends on the processor type and configuration shape.
The final output, either reviewed or initial.
Conforms to the shape of output types and depends on the processor type and configuration shape.
- Specified by:
outputin interfaceProcessorRun.OutputStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewed
public ProcessorRun.EditedStage reviewed(boolean reviewed)
Indicates whether the run has been reviewed.
Indicates whether the run has been reviewed.
- Specified by:
reviewedin interfaceProcessorRun.ReviewedStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
edited
public ProcessorRun.TypeStage edited(boolean edited)
Indicates whether the run results have been edited.
Indicates whether the run results have been edited.
- Specified by:
editedin interfaceProcessorRun.EditedStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
type
public ProcessorRun.ConfigStage type(@NotNull ProcessorRunType type)
The type of processor:
"CLASSIFY"- Classifies documents into categories"EXTRACT"- Extracts structured data from documents"SPLITTER"- Splits documents into multiple parts
The type of processor:
"CLASSIFY"- Classifies documents into categories"EXTRACT"- Extracts structured data from documents"SPLITTER"- Splits documents into multiple parts
- Specified by:
typein interfaceProcessorRun.TypeStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
config
public ProcessorRun.UrlStage config(@NotNull ProcessorRunConfig config)
The configuration used for this processor run. The type of configuration will match the processor type.
The configuration used for this processor run. The type of configuration will match the processor type.
- Specified by:
configin interfaceProcessorRun.ConfigStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
url
public ProcessorRun._FinalStage url(@NotNull java.lang.String url)
The URL to view the processor run.
The URL to view the processor run.
- Specified by:
urlin interfaceProcessorRun.UrlStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addAllMergedProcessors
public ProcessorRun._FinalStage addAllMergedProcessors(java.util.List<ProcessorRunMergedProcessorsItem> mergedProcessors)
An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.
- Specified by:
addAllMergedProcessorsin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addMergedProcessors
public ProcessorRun._FinalStage addMergedProcessors(ProcessorRunMergedProcessorsItem mergedProcessors)
An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.
- Specified by:
addMergedProcessorsin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
mergedProcessors
public ProcessorRun._FinalStage mergedProcessors(java.util.List<ProcessorRunMergedProcessorsItem> mergedProcessors)
An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.
- Specified by:
mergedProcessorsin interfaceProcessorRun._FinalStage
-
addAllFiles
public ProcessorRun._FinalStage addAllFiles(java.util.List<File> files)
Details of the processed files.
If this was a file generated from a splitter processor, this will be the sub file.
See the File object for more details.
- Specified by:
addAllFilesin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addFiles
public ProcessorRun._FinalStage addFiles(File files)
Details of the processed files.
If this was a file generated from a splitter processor, this will be the sub file.
See the File object for more details.
- Specified by:
addFilesin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
files
public ProcessorRun._FinalStage files(java.util.List<File> files)
Details of the processed files.
If this was a file generated from a splitter processor, this will be the sub file.
See the File object for more details.
- Specified by:
filesin interfaceProcessorRun._FinalStage
-
reviewedOutput
public ProcessorRun._FinalStage reviewedOutput(ProcessorOutput reviewedOutput)
The output after review, if any.
- Specified by:
reviewedOutputin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewedOutput
public ProcessorRun._FinalStage reviewedOutput(java.util.Optional<ProcessorOutput> reviewedOutput)
The output after review, if any.
- Specified by:
reviewedOutputin interfaceProcessorRun._FinalStage
-
initialOutput
public ProcessorRun._FinalStage initialOutput(ProcessorOutput initialOutput)
The initial output from the processor run. The type of output will match the processor type.
- Specified by:
initialOutputin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
initialOutput
public ProcessorRun._FinalStage initialOutput(java.util.Optional<ProcessorOutput> initialOutput)
The initial output from the processor run. The type of output will match the processor type.
- Specified by:
initialOutputin interfaceProcessorRun._FinalStage
-
edits
public ProcessorRun._FinalStage edits(java.lang.String key, ExtractionOutputEdits value)
- Specified by:
editsin interfaceProcessorRun._FinalStage
-
putAllEdits
public ProcessorRun._FinalStage putAllEdits(java.util.Map<java.lang.String,ExtractionOutputEdits> edits)
- Specified by:
putAllEditsin interfaceProcessorRun._FinalStage
-
edits
public ProcessorRun._FinalStage edits(java.util.Map<java.lang.String,ExtractionOutputEdits> edits)
- Specified by:
editsin interfaceProcessorRun._FinalStage
-
metadata
public ProcessorRun._FinalStage metadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
Any metadata that was provided when creating the processor run.
- Specified by:
metadatain interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public ProcessorRun._FinalStage metadata(java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> metadata)
Any metadata that was provided when creating the processor run.
- Specified by:
metadatain interfaceProcessorRun._FinalStage
-
failureMessage
public ProcessorRun._FinalStage failureMessage(java.lang.String failureMessage)
If the run failed, provides a detailed message about the failure.
- Specified by:
failureMessagein interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public ProcessorRun._FinalStage failureMessage(java.util.Optional<java.lang.String> failureMessage)
If the run failed, provides a detailed message about the failure.
- Specified by:
failureMessagein interfaceProcessorRun._FinalStage
-
failureReason
public ProcessorRun._FinalStage failureReason(java.lang.String failureReason)
If the run failed, indicates the reason for failure.
- Specified by:
failureReasonin interfaceProcessorRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public ProcessorRun._FinalStage failureReason(java.util.Optional<java.lang.String> failureReason)
If the run failed, indicates the reason for failure.
- Specified by:
failureReasonin interfaceProcessorRun._FinalStage
-
build
public ProcessorRun build()
- Specified by:
buildin interfaceProcessorRun._FinalStage
-
-