Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"testImplementation org.mockito:mockito-inline:4.11.0"
]
},
"originGitCommit": "a5c1143a7b724689db7c5e4cee897834882c9d69",
"sdkVersion": "1.18.0"
"originGitCommit": "204f01f5a6e9ad6585d71b0ad6315aef1be1f537",
"sdkVersion": "1.19.0"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ java {

group = 'ai.extend'

version = '1.18.0'
version = '1.19.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -81,11 +81,11 @@ publishing {
maven(MavenPublication) {
groupId = 'ai.extend'
artifactId = 'extend-java-sdk'
version = '1.18.0'
version = '1.19.0'
from components.java
pom {
name = 'Extend.ai'
description = 'The Java SDK for Extend.ai'
description = 'Official Java SDK for Extend (extend.ai) — the document processing API. Parse, extract, classify, split, and edit PDFs and 35+ file types'
url = 'https://docs.extend.ai/2026-02-09/api-reference'
licenses {
license {
Expand Down
2 changes: 1 addition & 1 deletion reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6715,7 +6715,7 @@ Example: `"invoice"`

Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.

Pass `file` for a single document, or `package` to process 2-50 files together as one package in a single run. Exactly one of `file` or `package` must be provided.
Pass `file` for a single document use case (more common), or `package` to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of `file` or `package` must be provided.

The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Workflow Run endpoint for results.
</dd>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/extend/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "ai.extend:extend-java-sdk/1.18.0");
put("User-Agent", "ai.extend:extend-java-sdk/1.19.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.extendconfig.fern:api-sdk");
put("X-Fern-SDK-Version", "1.18.0");
put("X-Fern-SDK-Version", "1.19.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public CompletableFuture<ExtendClientBaseHttpResponse<WorkflowRun>> create(WorkflowRunsCreateRequest request) {
Expand All @@ -220,7 +220,7 @@ public CompletableFuture<ExtendClientBaseHttpResponse<WorkflowRun>> create(Workf

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public CompletableFuture<ExtendClientBaseHttpResponse<WorkflowRun>> create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public CompletableFuture<WorkflowRunsListResponse> list(

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public CompletableFuture<WorkflowRun> create(WorkflowRunsCreateRequest request) {
Expand All @@ -75,7 +75,7 @@ public CompletableFuture<WorkflowRun> create(WorkflowRunsCreateRequest request)

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public CompletableFuture<WorkflowRun> create(WorkflowRunsCreateRequest request, RequestOptions requestOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public ExtendClientBaseHttpResponse<WorkflowRunsListResponse> list(

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public ExtendClientBaseHttpResponse<WorkflowRun> create(WorkflowRunsCreateRequest request) {
Expand All @@ -185,7 +185,7 @@ public ExtendClientBaseHttpResponse<WorkflowRun> create(WorkflowRunsCreateReques

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public ExtendClientBaseHttpResponse<WorkflowRun> create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public WorkflowRunsListResponse list(WorkflowRunsListRequest request, RequestOpt

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public WorkflowRun create(WorkflowRunsCreateRequest request) {
Expand All @@ -73,7 +73,7 @@ public WorkflowRun create(WorkflowRunsCreateRequest request) {

/**
* Run a workflow. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome.
* <p>Pass <code>file</code> for a single document, or <code>package</code> to process 2-50 files together as one package in a single run. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>Pass <code>file</code> for a single document use case (more common), or <code>package</code> to process 2-50 files together as one package in a single run where context across files is used together to determine final output. Exactly one of <code>file</code> or <code>package</code> must be provided.</p>
* <p>The request returns immediately with a <code>PROCESSING</code> status. Use webhooks or poll the Get Workflow Run endpoint for results.</p>
*/
public WorkflowRun create(WorkflowRunsCreateRequest request, RequestOptions requestOptions) {
Expand Down
62 changes: 58 additions & 4 deletions src/main/java/ai/extend/types/ParseRunOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
*/
package ai.extend.types;

import ai.extend.core.Nullable;
import ai.extend.core.NullableNonemptyFilter;
import ai.extend.core.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -26,12 +29,18 @@ public final class ParseRunOutput {

private final Optional<ParseRunOutputOcr> ocr;

private final Optional<ParseRunOutputMetadata> metadata;

private final Map<String, Object> additionalProperties;

private ParseRunOutput(
List<Chunk> chunks, Optional<ParseRunOutputOcr> ocr, Map<String, Object> additionalProperties) {
List<Chunk> chunks,
Optional<ParseRunOutputOcr> ocr,
Optional<ParseRunOutputMetadata> metadata,
Map<String, Object> additionalProperties) {
this.chunks = chunks;
this.ocr = ocr;
this.metadata = metadata;
this.additionalProperties = additionalProperties;
}

Expand All @@ -51,6 +60,23 @@ public Optional<ParseRunOutputOcr> getOcr() {
return ocr;
}

/**
* @return Rotation, dimension, and file-type metadata about the parse output. <code>null</code> for parse runs that completed before this field was introduced.
*/
@JsonIgnore
public Optional<ParseRunOutputMetadata> getMetadata() {
if (metadata == null) {
return Optional.empty();
}
return metadata;
}

@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class)
@JsonProperty("metadata")
private Optional<ParseRunOutputMetadata> _getMetadata() {
return metadata;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -63,12 +89,12 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(ParseRunOutput other) {
return chunks.equals(other.chunks) && ocr.equals(other.ocr);
return chunks.equals(other.chunks) && ocr.equals(other.ocr) && metadata.equals(other.metadata);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.chunks, this.ocr);
return Objects.hash(this.chunks, this.ocr, this.metadata);
}

@java.lang.Override
Expand All @@ -86,6 +112,8 @@ public static final class Builder {

private Optional<ParseRunOutputOcr> ocr = Optional.empty();

private Optional<ParseRunOutputMetadata> metadata = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

Expand All @@ -94,6 +122,7 @@ private Builder() {}
public Builder from(ParseRunOutput other) {
chunks(other.getChunks());
ocr(other.getOcr());
metadata(other.getMetadata());
return this;
}

Expand Down Expand Up @@ -135,8 +164,33 @@ public Builder ocr(ParseRunOutputOcr ocr) {
return this;
}

/**
* <p>Rotation, dimension, and file-type metadata about the parse output. <code>null</code> for parse runs that completed before this field was introduced.</p>
*/
@JsonSetter(value = "metadata", nulls = Nulls.SKIP)
public Builder metadata(Optional<ParseRunOutputMetadata> metadata) {
this.metadata = metadata;
return this;
}

public Builder metadata(ParseRunOutputMetadata metadata) {
this.metadata = Optional.ofNullable(metadata);
return this;
}

public Builder metadata(Nullable<ParseRunOutputMetadata> metadata) {
if (metadata.isNull()) {
this.metadata = null;
} else if (metadata.isEmpty()) {
this.metadata = Optional.empty();
} else {
this.metadata = Optional.of(metadata.get());
}
return this;
}

public ParseRunOutput build() {
return new ParseRunOutput(chunks, ocr, additionalProperties);
return new ParseRunOutput(chunks, ocr, metadata, additionalProperties);
}
}
}
Loading
Loading