Class ExtractRun
- java.lang.Object
-
- ai.extend.types.ExtractRun
-
public final class ExtractRun extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceExtractRun._FinalStagestatic classExtractRun.Builderstatic interfaceExtractRun.ConfigStagestatic interfaceExtractRun.CreatedAtStagestatic interfaceExtractRun.DashboardUrlStagestatic interfaceExtractRun.EditedStagestatic interfaceExtractRun.IdStagestatic interfaceExtractRun.ReviewedStagestatic interfaceExtractRun.StatusStagestatic interfaceExtractRun.UpdatedAtStage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExtractRun.IdStagebuilder()booleanequals(java.lang.Object other)java.util.Map<java.lang.String,java.lang.Object>getAdditionalProperties()ExtractConfiggetConfig()java.time.OffsetDateTimegetCreatedAt()java.lang.StringgetDashboardUrl()booleangetEdited()java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>>getEdits()java.util.Optional<ExtractorSummary>getExtractor()java.util.Optional<ExtractorVersionSummary>getExtractorVersion()java.util.Optional<java.lang.String>getFailureMessage()java.util.Optional<java.lang.String>getFailureReason()java.util.Optional<FileSummary>getFile()java.lang.StringgetId()java.util.Optional<ExtractOutput>getInitialOutput()java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>>getMetadata()java.lang.StringgetObject()java.util.Optional<ExtractOutput>getOutput()java.util.Optional<java.lang.String>getParseRunId()booleangetReviewed()java.util.Optional<ExtractOutput>getReviewedOutput()ProcessorRunStatusgetStatus()java.time.OffsetDateTimegetUpdatedAt()java.util.Optional<RunUsage>getUsage()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getObject
public java.lang.String getObject()
- Returns:
- The type of object. Will always be
"extract_run".
-
getId
public java.lang.String getId()
- Returns:
- The unique identifier for this extract run.
Example:
"exr_Xj8mK2pL9nR4vT7qY5wZ"
-
getStatus
public ProcessorRunStatus getStatus()
-
getOutput
public java.util.Optional<ExtractOutput> getOutput()
- Returns:
- The final output, either reviewed or initial. This is a union of two possible shapes:
- JSON Schema output: The current output format, returned for runs created with a JSON Schema config.
- Legacy output: A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config.
Availability: Present when
statusis"PROCESSED".
-
getInitialOutput
public java.util.Optional<ExtractOutput> getInitialOutput()
- Returns:
- The initial output from the extract run, before any review edits.
Availability: Present when
reviewedistrue.
-
getReviewedOutput
public java.util.Optional<ExtractOutput> getReviewedOutput()
- Returns:
- The output after human review.
Availability: Present when
reviewedistrue.
-
getFailureReason
public java.util.Optional<java.lang.String> getFailureReason()
- Returns:
- The reason for failure.
Availability: Present when
statusis"FAILED".Possible values include:
ABORTED- The run was aborted by the userINTERNAL_ERROR- An unexpected internal error occurredFAILED_TO_PROCESS_FILE- Failed to process the file (e.g., OCR failure, file access issues)INVALID_PROCESSOR- The processor configuration is invalidINVALID_CONFIGURATION- The provided configuration is incompatible with the selected modelPARSING_ERROR- Failed to parse the extraction outputPRE_PROCESSING_FAILURE- An error occurred during preprocessing (e.g., chunking)POST_PROCESSING_FAILURE- An error occurred during postprocessingOUT_OF_CREDITS- Insufficient credits to run the extractionSCHEMA_GENERATION_FAILED- Automatic schema inference failed (only applies whenschemais omitted). The file could not be parsed or a schema could not be generated from it.
Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
-
getFailureMessage
public java.util.Optional<java.lang.String> getFailureMessage()
- Returns:
- A detailed message about the failure.
Availability: Present when
statusis"FAILED".
-
getMetadata
public java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> getMetadata()
- Returns:
- Any metadata that was provided when creating the extract run.
Availability: Present when metadata was provided during creation.
-
getReviewed
public boolean getReviewed()
- Returns:
- Indicates whether the run has been reviewed by a human.
-
getEdited
public boolean getEdited()
- Returns:
- Indicates whether the run results have been edited during review.
-
getEdits
public java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<ExtractOutputEdits>>> getEdits()
- Returns:
- Details of edits made during review.
Availability: Present when
editedistrue.
-
getConfig
public ExtractConfig getConfig()
- Returns:
- The configuration used for this extract run. This is a union of two possible shapes:
- JSON Schema config: The current config format. All runs created through this API version use this shape.
- Legacy config: A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs.
-
getExtractor
public java.util.Optional<ExtractorSummary> getExtractor()
- Returns:
- The extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.
-
getExtractorVersion
public java.util.Optional<ExtractorVersionSummary> getExtractorVersion()
- Returns:
- The version of the extractor that was used for this run.
Availability: Present when an extractor reference was provided. Not present when using inline
config.
-
getFile
public java.util.Optional<FileSummary> getFile()
- Returns:
- The file that was processed.
nullwhen the file could not be accessed or processed (for example a run that failed during file ingestion, or a multi-file batch run).
-
getParseRunId
public java.util.Optional<java.lang.String> getParseRunId()
- Returns:
- The ID of the parse run that was used for this extract run.
Availability: Present when a parse run was created.
-
getDashboardUrl
public java.lang.String getDashboardUrl()
- Returns:
- The URL to view the extract run in the Extend dashboard.
-
getUsage
public java.util.Optional<RunUsage> getUsage()
- Returns:
- Usage credits consumed by this extract run.
Availability: Present when
statusis"PROCESSED". Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
-
getCreatedAt
public java.time.OffsetDateTime getCreatedAt()
-
getUpdatedAt
public java.time.OffsetDateTime getUpdatedAt()
-
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 ExtractRun.IdStage builder()
-
-