priority) {
}
/**
- * Predetermined outputs to be used for the workflow run. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known.
+ * Predetermined outputs to be used for the workflow run. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known. Not supported on package runs — a package run produces a single merged result across all files and cannot accept pre-supplied per-processor outputs.
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@@ -261,7 +274,7 @@ public _FinalStage outputs(List outputs) {
}
/**
- * Predetermined outputs to be used for the workflow run. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known.
+ * Predetermined outputs to be used for the workflow run. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known. Not supported on package runs — a package run produces a single merged result across all files and cannot accept pre-supplied per-processor outputs.
*/
@java.lang.Override
@JsonSetter(value = "outputs", nulls = Nulls.SKIP)
@@ -270,10 +283,50 @@ public _FinalStage outputs(Optional>
return this;
}
+ /**
+ * A set of 2–50 files to process together in a single workflow run. Mutually exclusive with file — provide one or the other.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage package_(WorkflowRunPackage package_) {
+ this.package_ = Optional.ofNullable(package_);
+ return this;
+ }
+
+ /**
+ * A set of 2–50 files to process together in a single workflow run. Mutually exclusive with file — provide one or the other.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "package", nulls = Nulls.SKIP)
+ public _FinalStage package_(Optional package_) {
+ this.package_ = package_;
+ return this;
+ }
+
+ /**
+ * The file to be processed. Supported file types can be found here . Files can be provided as a URL, an Extend file ID, or raw text. Mutually exclusive with package — provide one or the other. If you wish to process many files as independent runs, consider using the Batch Run Workflow endpoint.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage file(WorkflowRunsCreateRequestFile file) {
+ this.file = Optional.ofNullable(file);
+ return this;
+ }
+
+ /**
+ * The file to be processed. Supported file types can be found here . Files can be provided as a URL, an Extend file ID, or raw text. Mutually exclusive with package — provide one or the other. If you wish to process many files as independent runs, consider using the Batch Run Workflow endpoint.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "file", nulls = Nulls.SKIP)
+ public _FinalStage file(Optional file) {
+ this.file = file;
+ return this;
+ }
+
@java.lang.Override
public WorkflowRunsCreateRequest build() {
return new WorkflowRunsCreateRequest(
- workflow, file, outputs, priority, metadata, secrets, additionalProperties);
+ workflow, file, package_, outputs, priority, metadata, secrets, additionalProperties);
}
}
}
diff --git a/src/main/java/ai/extend/types/BlockMetadata.java b/src/main/java/ai/extend/types/BlockMetadata.java
index 6c90a97..95311b5 100644
--- a/src/main/java/ai/extend/types/BlockMetadata.java
+++ b/src/main/java/ai/extend/types/BlockMetadata.java
@@ -27,8 +27,6 @@ public final class BlockMetadata {
private final Optional sheet;
- private final Optional textDirection;
-
private final Optional minOcrConfidence;
private final Optional avgOcrConfidence;
@@ -38,13 +36,11 @@ public final class BlockMetadata {
private BlockMetadata(
Optional page,
Optional sheet,
- Optional textDirection,
Optional minOcrConfidence,
Optional avgOcrConfidence,
Map additionalProperties) {
this.page = page;
this.sheet = sheet;
- this.textDirection = textDirection;
this.minOcrConfidence = minOcrConfidence;
this.avgOcrConfidence = avgOcrConfidence;
this.additionalProperties = additionalProperties;
@@ -66,14 +62,6 @@ public Optional getSheet() {
return sheet;
}
- /**
- * @return Text direction for this block's content ("ltr" for left-to-right, "rtl" for right-to-left).
- */
- @JsonProperty("textDirection")
- public Optional getTextDirection() {
- return textDirection;
- }
-
/**
* @return Lowest per-word OCR confidence across words in this block, or null when word-level confidence is unavailable.
*/
@@ -122,14 +110,13 @@ public Map getAdditionalProperties() {
private boolean equalTo(BlockMetadata other) {
return page.equals(other.page)
&& sheet.equals(other.sheet)
- && textDirection.equals(other.textDirection)
&& minOcrConfidence.equals(other.minOcrConfidence)
&& avgOcrConfidence.equals(other.avgOcrConfidence);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.page, this.sheet, this.textDirection, this.minOcrConfidence, this.avgOcrConfidence);
+ return Objects.hash(this.page, this.sheet, this.minOcrConfidence, this.avgOcrConfidence);
}
@java.lang.Override
@@ -147,8 +134,6 @@ public static final class Builder {
private Optional sheet = Optional.empty();
- private Optional textDirection = Optional.empty();
-
private Optional minOcrConfidence = Optional.empty();
private Optional avgOcrConfidence = Optional.empty();
@@ -161,7 +146,6 @@ private Builder() {}
public Builder from(BlockMetadata other) {
page(other.getPage());
sheet(other.getSheet());
- textDirection(other.getTextDirection());
minOcrConfidence(other.getMinOcrConfidence());
avgOcrConfidence(other.getAvgOcrConfidence());
return this;
@@ -195,20 +179,6 @@ public Builder sheet(BlockMetadataSheet sheet) {
return this;
}
- /**
- * Text direction for this block's content ("ltr" for left-to-right, "rtl" for right-to-left).
- */
- @JsonSetter(value = "textDirection", nulls = Nulls.SKIP)
- public Builder textDirection(Optional textDirection) {
- this.textDirection = textDirection;
- return this;
- }
-
- public Builder textDirection(BlockMetadataTextDirection textDirection) {
- this.textDirection = Optional.ofNullable(textDirection);
- return this;
- }
-
/**
* Lowest per-word OCR confidence across words in this block, or null when word-level confidence is unavailable.
*/
@@ -260,8 +230,7 @@ public Builder avgOcrConfidence(Nullable avgOcrConfidence) {
}
public BlockMetadata build() {
- return new BlockMetadata(
- page, sheet, textDirection, minOcrConfidence, avgOcrConfidence, additionalProperties);
+ return new BlockMetadata(page, sheet, minOcrConfidence, avgOcrConfidence, additionalProperties);
}
}
}
diff --git a/src/main/java/ai/extend/types/BlockMetadataTextDirection.java b/src/main/java/ai/extend/types/BlockMetadataTextDirection.java
deleted file mode 100644
index 081fc0e..0000000
--- a/src/main/java/ai/extend/types/BlockMetadataTextDirection.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package ai.extend.types;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-
-public final class BlockMetadataTextDirection {
- public static final BlockMetadataTextDirection LTR = new BlockMetadataTextDirection(Value.LTR, "ltr");
-
- public static final BlockMetadataTextDirection RTL = new BlockMetadataTextDirection(Value.RTL, "rtl");
-
- private final Value value;
-
- private final String string;
-
- BlockMetadataTextDirection(Value value, String string) {
- this.value = value;
- this.string = string;
- }
-
- public Value getEnumValue() {
- return value;
- }
-
- @java.lang.Override
- @JsonValue
- public String toString() {
- return this.string;
- }
-
- @java.lang.Override
- public boolean equals(Object other) {
- return (this == other)
- || (other instanceof BlockMetadataTextDirection
- && this.string.equals(((BlockMetadataTextDirection) other).string));
- }
-
- @java.lang.Override
- public int hashCode() {
- return this.string.hashCode();
- }
-
- public T visit(Visitor visitor) {
- switch (value) {
- case LTR:
- return visitor.visitLtr();
- case RTL:
- return visitor.visitRtl();
- case UNKNOWN:
- default:
- return visitor.visitUnknown(string);
- }
- }
-
- @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
- public static BlockMetadataTextDirection valueOf(String value) {
- switch (value) {
- case "ltr":
- return LTR;
- case "rtl":
- return RTL;
- default:
- return new BlockMetadataTextDirection(Value.UNKNOWN, value);
- }
- }
-
- public enum Value {
- LTR,
-
- RTL,
-
- UNKNOWN
- }
-
- public interface Visitor {
- T visitLtr();
-
- T visitRtl();
-
- T visitUnknown(String unknownType);
- }
-}
diff --git a/src/main/java/ai/extend/types/ClassificationMetric.java b/src/main/java/ai/extend/types/ClassificationMetric.java
new file mode 100644
index 0000000..47a4804
--- /dev/null
+++ b/src/main/java/ai/extend/types/ClassificationMetric.java
@@ -0,0 +1,255 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package ai.extend.types;
+
+import ai.extend.core.ObjectMappers;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ClassificationMetric.Builder.class)
+public final class ClassificationMetric {
+ private final Optional countExpected;
+
+ private final Optional countPredicted;
+
+ private final Optional countCorrect;
+
+ private final Optional precision;
+
+ private final Optional recall;
+
+ private final Optional f1;
+
+ private final Map additionalProperties;
+
+ private ClassificationMetric(
+ Optional countExpected,
+ Optional countPredicted,
+ Optional countCorrect,
+ Optional precision,
+ Optional recall,
+ Optional f1,
+ Map additionalProperties) {
+ this.countExpected = countExpected;
+ this.countPredicted = countPredicted;
+ this.countCorrect = countCorrect;
+ this.precision = precision;
+ this.recall = recall;
+ this.f1 = f1;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The number of files whose expected classification was this class.
+ */
+ @JsonProperty("countExpected")
+ public Optional getCountExpected() {
+ return countExpected;
+ }
+
+ /**
+ * @return The number of files the model classified as this class.
+ */
+ @JsonProperty("countPredicted")
+ public Optional getCountPredicted() {
+ return countPredicted;
+ }
+
+ /**
+ * @return The number of files correctly classified as this class.
+ */
+ @JsonProperty("countCorrect")
+ public Optional getCountCorrect() {
+ return countCorrect;
+ }
+
+ /**
+ * @return countCorrect / countPredicted for this class.
+ */
+ @JsonProperty("precision")
+ public Optional getPrecision() {
+ return precision;
+ }
+
+ /**
+ * @return countCorrect / countExpected for this class.
+ */
+ @JsonProperty("recall")
+ public Optional getRecall() {
+ return recall;
+ }
+
+ /**
+ * @return Harmonic mean of precision and recall.
+ */
+ @JsonProperty("f1")
+ public Optional getF1() {
+ return f1;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ClassificationMetric && equalTo((ClassificationMetric) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(ClassificationMetric other) {
+ return countExpected.equals(other.countExpected)
+ && countPredicted.equals(other.countPredicted)
+ && countCorrect.equals(other.countCorrect)
+ && precision.equals(other.precision)
+ && recall.equals(other.recall)
+ && f1.equals(other.f1);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(
+ this.countExpected, this.countPredicted, this.countCorrect, this.precision, this.recall, this.f1);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional countExpected = Optional.empty();
+
+ private Optional countPredicted = Optional.empty();
+
+ private Optional countCorrect = Optional.empty();
+
+ private Optional precision = Optional.empty();
+
+ private Optional recall = Optional.empty();
+
+ private Optional f1 = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(ClassificationMetric other) {
+ countExpected(other.getCountExpected());
+ countPredicted(other.getCountPredicted());
+ countCorrect(other.getCountCorrect());
+ precision(other.getPrecision());
+ recall(other.getRecall());
+ f1(other.getF1());
+ return this;
+ }
+
+ /**
+ * The number of files whose expected classification was this class.
+ */
+ @JsonSetter(value = "countExpected", nulls = Nulls.SKIP)
+ public Builder countExpected(Optional countExpected) {
+ this.countExpected = countExpected;
+ return this;
+ }
+
+ public Builder countExpected(Double countExpected) {
+ this.countExpected = Optional.ofNullable(countExpected);
+ return this;
+ }
+
+ /**
+ * The number of files the model classified as this class.
+ */
+ @JsonSetter(value = "countPredicted", nulls = Nulls.SKIP)
+ public Builder countPredicted(Optional countPredicted) {
+ this.countPredicted = countPredicted;
+ return this;
+ }
+
+ public Builder countPredicted(Double countPredicted) {
+ this.countPredicted = Optional.ofNullable(countPredicted);
+ return this;
+ }
+
+ /**
+ * The number of files correctly classified as this class.
+ */
+ @JsonSetter(value = "countCorrect", nulls = Nulls.SKIP)
+ public Builder countCorrect(Optional countCorrect) {
+ this.countCorrect = countCorrect;
+ return this;
+ }
+
+ public Builder countCorrect(Double countCorrect) {
+ this.countCorrect = Optional.ofNullable(countCorrect);
+ return this;
+ }
+
+ /**
+ * countCorrect / countPredicted for this class.
+ */
+ @JsonSetter(value = "precision", nulls = Nulls.SKIP)
+ public Builder precision(Optional precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Builder precision(Double precision) {
+ this.precision = Optional.ofNullable(precision);
+ return this;
+ }
+
+ /**
+ * countCorrect / countExpected for this class.
+ */
+ @JsonSetter(value = "recall", nulls = Nulls.SKIP)
+ public Builder recall(Optional recall) {
+ this.recall = recall;
+ return this;
+ }
+
+ public Builder recall(Double recall) {
+ this.recall = Optional.ofNullable(recall);
+ return this;
+ }
+
+ /**
+ * Harmonic mean of precision and recall.
+ */
+ @JsonSetter(value = "f1", nulls = Nulls.SKIP)
+ public Builder f1(Optional f1) {
+ this.f1 = f1;
+ return this;
+ }
+
+ public Builder f1(Double f1) {
+ this.f1 = Optional.ofNullable(f1);
+ return this;
+ }
+
+ public ClassificationMetric build() {
+ return new ClassificationMetric(
+ countExpected, countPredicted, countCorrect, precision, recall, f1, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/ai/extend/types/ClassifyEvaluationSetRunMetrics.java b/src/main/java/ai/extend/types/ClassifyEvaluationSetRunMetrics.java
new file mode 100644
index 0000000..64ad018
--- /dev/null
+++ b/src/main/java/ai/extend/types/ClassifyEvaluationSetRunMetrics.java
@@ -0,0 +1,435 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package ai.extend.types;
+
+import ai.extend.core.ObjectMappers;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = ClassifyEvaluationSetRunMetrics.Builder.class)
+public final class ClassifyEvaluationSetRunMetrics implements IEvaluationSetRunMetricsBase {
+ private final Optional numFilesTotal;
+
+ private final Optional numFilesProcessed;
+
+ private final Optional numFiles;
+
+ private final Optional numPages;
+
+ private final Optional meanLatencyMs;
+
+ private final Optional p50LatencyMs;
+
+ private final Optional p90LatencyMs;
+
+ private final Optional p95LatencyMs;
+
+ private final Optional p99LatencyMs;
+
+ private final Optional accuracy;
+
+ private final Optional> classificationMetrics;
+
+ private final Map additionalProperties;
+
+ private ClassifyEvaluationSetRunMetrics(
+ Optional numFilesTotal,
+ Optional numFilesProcessed,
+ Optional numFiles,
+ Optional numPages,
+ Optional meanLatencyMs,
+ Optional p50LatencyMs,
+ Optional p90LatencyMs,
+ Optional p95LatencyMs,
+ Optional p99LatencyMs,
+ Optional accuracy,
+ Optional> classificationMetrics,
+ Map additionalProperties) {
+ this.numFilesTotal = numFilesTotal;
+ this.numFilesProcessed = numFilesProcessed;
+ this.numFiles = numFiles;
+ this.numPages = numPages;
+ this.meanLatencyMs = meanLatencyMs;
+ this.p50LatencyMs = p50LatencyMs;
+ this.p90LatencyMs = p90LatencyMs;
+ this.p95LatencyMs = p95LatencyMs;
+ this.p99LatencyMs = p99LatencyMs;
+ this.accuracy = accuracy;
+ this.classificationMetrics = classificationMetrics;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The total number of files that will be processed in this evaluation set run.
+ */
+ @JsonProperty("numFilesTotal")
+ @java.lang.Override
+ public Optional getNumFilesTotal() {
+ return numFilesTotal;
+ }
+
+ /**
+ * @return The number of files that have finished processing.
+ */
+ @JsonProperty("numFilesProcessed")
+ @java.lang.Override
+ public Optional getNumFilesProcessed() {
+ return numFilesProcessed;
+ }
+
+ /**
+ * @return Deprecated. Use numFilesProcessed instead.
+ */
+ @JsonProperty("numFiles")
+ @java.lang.Override
+ public Optional getNumFiles() {
+ return numFiles;
+ }
+
+ /**
+ * @return The total number of pages processed across the completed files.
+ */
+ @JsonProperty("numPages")
+ @java.lang.Override
+ public Optional getNumPages() {
+ return numPages;
+ }
+
+ /**
+ * @return Mean per-file latency in milliseconds.
+ */
+ @JsonProperty("meanLatencyMs")
+ @java.lang.Override
+ public Optional getMeanLatencyMs() {
+ return meanLatencyMs;
+ }
+
+ /**
+ * @return 50th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p50LatencyMs")
+ @java.lang.Override
+ public Optional getP50LatencyMs() {
+ return p50LatencyMs;
+ }
+
+ /**
+ * @return 90th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p90LatencyMs")
+ @java.lang.Override
+ public Optional getP90LatencyMs() {
+ return p90LatencyMs;
+ }
+
+ /**
+ * @return 95th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p95LatencyMs")
+ @java.lang.Override
+ public Optional getP95LatencyMs() {
+ return p95LatencyMs;
+ }
+
+ /**
+ * @return 99th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p99LatencyMs")
+ @java.lang.Override
+ public Optional getP99LatencyMs() {
+ return p99LatencyMs;
+ }
+
+ /**
+ * @return Overall accuracy across the evaluation set, computed as the share of files whose predicted class matched the expected class.
+ */
+ @JsonProperty("accuracy")
+ public Optional getAccuracy() {
+ return accuracy;
+ }
+
+ /**
+ * @return Per-class precision, recall, and F1. Keys are the classifier's classification types as defined in the classifier configuration.
+ */
+ @JsonProperty("classificationMetrics")
+ public Optional> getClassificationMetrics() {
+ return classificationMetrics;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ClassifyEvaluationSetRunMetrics && equalTo((ClassifyEvaluationSetRunMetrics) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(ClassifyEvaluationSetRunMetrics other) {
+ return numFilesTotal.equals(other.numFilesTotal)
+ && numFilesProcessed.equals(other.numFilesProcessed)
+ && numFiles.equals(other.numFiles)
+ && numPages.equals(other.numPages)
+ && meanLatencyMs.equals(other.meanLatencyMs)
+ && p50LatencyMs.equals(other.p50LatencyMs)
+ && p90LatencyMs.equals(other.p90LatencyMs)
+ && p95LatencyMs.equals(other.p95LatencyMs)
+ && p99LatencyMs.equals(other.p99LatencyMs)
+ && accuracy.equals(other.accuracy)
+ && classificationMetrics.equals(other.classificationMetrics);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(
+ this.numFilesTotal,
+ this.numFilesProcessed,
+ this.numFiles,
+ this.numPages,
+ this.meanLatencyMs,
+ this.p50LatencyMs,
+ this.p90LatencyMs,
+ this.p95LatencyMs,
+ this.p99LatencyMs,
+ this.accuracy,
+ this.classificationMetrics);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional numFilesTotal = Optional.empty();
+
+ private Optional numFilesProcessed = Optional.empty();
+
+ private Optional numFiles = Optional.empty();
+
+ private Optional numPages = Optional.empty();
+
+ private Optional meanLatencyMs = Optional.empty();
+
+ private Optional p50LatencyMs = Optional.empty();
+
+ private Optional p90LatencyMs = Optional.empty();
+
+ private Optional p95LatencyMs = Optional.empty();
+
+ private Optional p99LatencyMs = Optional.empty();
+
+ private Optional accuracy = Optional.empty();
+
+ private Optional> classificationMetrics = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(ClassifyEvaluationSetRunMetrics other) {
+ numFilesTotal(other.getNumFilesTotal());
+ numFilesProcessed(other.getNumFilesProcessed());
+ numFiles(other.getNumFiles());
+ numPages(other.getNumPages());
+ meanLatencyMs(other.getMeanLatencyMs());
+ p50LatencyMs(other.getP50LatencyMs());
+ p90LatencyMs(other.getP90LatencyMs());
+ p95LatencyMs(other.getP95LatencyMs());
+ p99LatencyMs(other.getP99LatencyMs());
+ accuracy(other.getAccuracy());
+ classificationMetrics(other.getClassificationMetrics());
+ return this;
+ }
+
+ /**
+ * The total number of files that will be processed in this evaluation set run.
+ */
+ @JsonSetter(value = "numFilesTotal", nulls = Nulls.SKIP)
+ public Builder numFilesTotal(Optional numFilesTotal) {
+ this.numFilesTotal = numFilesTotal;
+ return this;
+ }
+
+ public Builder numFilesTotal(Double numFilesTotal) {
+ this.numFilesTotal = Optional.ofNullable(numFilesTotal);
+ return this;
+ }
+
+ /**
+ * The number of files that have finished processing.
+ */
+ @JsonSetter(value = "numFilesProcessed", nulls = Nulls.SKIP)
+ public Builder numFilesProcessed(Optional numFilesProcessed) {
+ this.numFilesProcessed = numFilesProcessed;
+ return this;
+ }
+
+ public Builder numFilesProcessed(Double numFilesProcessed) {
+ this.numFilesProcessed = Optional.ofNullable(numFilesProcessed);
+ return this;
+ }
+
+ /**
+ * Deprecated. Use numFilesProcessed instead.
+ */
+ @JsonSetter(value = "numFiles", nulls = Nulls.SKIP)
+ public Builder numFiles(Optional numFiles) {
+ this.numFiles = numFiles;
+ return this;
+ }
+
+ public Builder numFiles(Double numFiles) {
+ this.numFiles = Optional.ofNullable(numFiles);
+ return this;
+ }
+
+ /**
+ * The total number of pages processed across the completed files.
+ */
+ @JsonSetter(value = "numPages", nulls = Nulls.SKIP)
+ public Builder numPages(Optional numPages) {
+ this.numPages = numPages;
+ return this;
+ }
+
+ public Builder numPages(Double numPages) {
+ this.numPages = Optional.ofNullable(numPages);
+ return this;
+ }
+
+ /**
+ * Mean per-file latency in milliseconds.
+ */
+ @JsonSetter(value = "meanLatencyMs", nulls = Nulls.SKIP)
+ public Builder meanLatencyMs(Optional meanLatencyMs) {
+ this.meanLatencyMs = meanLatencyMs;
+ return this;
+ }
+
+ public Builder meanLatencyMs(Double meanLatencyMs) {
+ this.meanLatencyMs = Optional.ofNullable(meanLatencyMs);
+ return this;
+ }
+
+ /**
+ * 50th percentile per-file latency in milliseconds.
+ */
+ @JsonSetter(value = "p50LatencyMs", nulls = Nulls.SKIP)
+ public Builder p50LatencyMs(Optional p50LatencyMs) {
+ this.p50LatencyMs = p50LatencyMs;
+ return this;
+ }
+
+ public Builder p50LatencyMs(Double p50LatencyMs) {
+ this.p50LatencyMs = Optional.ofNullable(p50LatencyMs);
+ return this;
+ }
+
+ /**
+ * 90th percentile per-file latency in milliseconds.
+ */
+ @JsonSetter(value = "p90LatencyMs", nulls = Nulls.SKIP)
+ public Builder p90LatencyMs(Optional p90LatencyMs) {
+ this.p90LatencyMs = p90LatencyMs;
+ return this;
+ }
+
+ public Builder p90LatencyMs(Double p90LatencyMs) {
+ this.p90LatencyMs = Optional.ofNullable(p90LatencyMs);
+ return this;
+ }
+
+ /**
+ * 95th percentile per-file latency in milliseconds.
+ */
+ @JsonSetter(value = "p95LatencyMs", nulls = Nulls.SKIP)
+ public Builder p95LatencyMs(Optional p95LatencyMs) {
+ this.p95LatencyMs = p95LatencyMs;
+ return this;
+ }
+
+ public Builder p95LatencyMs(Double p95LatencyMs) {
+ this.p95LatencyMs = Optional.ofNullable(p95LatencyMs);
+ return this;
+ }
+
+ /**
+ * 99th percentile per-file latency in milliseconds.
+ */
+ @JsonSetter(value = "p99LatencyMs", nulls = Nulls.SKIP)
+ public Builder p99LatencyMs(Optional p99LatencyMs) {
+ this.p99LatencyMs = p99LatencyMs;
+ return this;
+ }
+
+ public Builder p99LatencyMs(Double p99LatencyMs) {
+ this.p99LatencyMs = Optional.ofNullable(p99LatencyMs);
+ return this;
+ }
+
+ /**
+ * Overall accuracy across the evaluation set, computed as the share of files whose predicted class matched the expected class.
+ */
+ @JsonSetter(value = "accuracy", nulls = Nulls.SKIP)
+ public Builder accuracy(Optional accuracy) {
+ this.accuracy = accuracy;
+ return this;
+ }
+
+ public Builder accuracy(Double accuracy) {
+ this.accuracy = Optional.ofNullable(accuracy);
+ return this;
+ }
+
+ /**
+ * Per-class precision, recall, and F1. Keys are the classifier's classification types as defined in the classifier configuration.
+ */
+ @JsonSetter(value = "classificationMetrics", nulls = Nulls.SKIP)
+ public Builder classificationMetrics(Optional> classificationMetrics) {
+ this.classificationMetrics = classificationMetrics;
+ return this;
+ }
+
+ public Builder classificationMetrics(Map classificationMetrics) {
+ this.classificationMetrics = Optional.ofNullable(classificationMetrics);
+ return this;
+ }
+
+ public ClassifyEvaluationSetRunMetrics build() {
+ return new ClassifyEvaluationSetRunMetrics(
+ numFilesTotal,
+ numFilesProcessed,
+ numFiles,
+ numPages,
+ meanLatencyMs,
+ p50LatencyMs,
+ p90LatencyMs,
+ p95LatencyMs,
+ p99LatencyMs,
+ accuracy,
+ classificationMetrics,
+ additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/ai/extend/types/EvaluationSetRun.java b/src/main/java/ai/extend/types/EvaluationSetRun.java
index 71f20c4..5c8d712 100644
--- a/src/main/java/ai/extend/types/EvaluationSetRun.java
+++ b/src/main/java/ai/extend/types/EvaluationSetRun.java
@@ -105,6 +105,9 @@ public EvaluationSetRunEntityVersion getEntityVersion() {
return entityVersion;
}
+ /**
+ * @return Metrics for the evaluation set run. The shape depends on the entity type.
+ */
@JsonProperty("metrics")
public EvaluationSetRunMetrics getMetrics() {
return metrics;
@@ -212,6 +215,9 @@ public interface EntityVersionStage {
}
public interface MetricsStage {
+ /**
+ * Metrics for the evaluation set run. The shape depends on the entity type.
+ */
StatusStage metrics(@NotNull EvaluationSetRunMetrics metrics);
}
@@ -339,6 +345,11 @@ public MetricsStage entityVersion(@NotNull EvaluationSetRunEntityVersion entityV
return this;
}
+ /**
+ * Metrics for the evaluation set run. The shape depends on the entity type.
+ * Metrics for the evaluation set run. The shape depends on the entity type.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
@JsonSetter("metrics")
public StatusStage metrics(@NotNull EvaluationSetRunMetrics metrics) {
diff --git a/src/main/java/ai/extend/types/EvaluationSetRunFieldMetric.java b/src/main/java/ai/extend/types/EvaluationSetRunFieldMetric.java
new file mode 100644
index 0000000..faf382c
--- /dev/null
+++ b/src/main/java/ai/extend/types/EvaluationSetRunFieldMetric.java
@@ -0,0 +1,224 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package ai.extend.types;
+
+import ai.extend.core.ObjectMappers;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = EvaluationSetRunFieldMetric.Builder.class)
+public final class EvaluationSetRunFieldMetric {
+ private final Optional countTotal;
+
+ private final Optional countPresent;
+
+ private final Optional countExpected;
+
+ private final Optional countAccurate;
+
+ private final Optional accuracy;
+
+ private final Map additionalProperties;
+
+ private EvaluationSetRunFieldMetric(
+ Optional countTotal,
+ Optional countPresent,
+ Optional countExpected,
+ Optional countAccurate,
+ Optional accuracy,
+ Map additionalProperties) {
+ this.countTotal = countTotal;
+ this.countPresent = countPresent;
+ this.countExpected = countExpected;
+ this.countAccurate = countAccurate;
+ this.accuracy = accuracy;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The number of runs that included this field in the schema.
+ */
+ @JsonProperty("countTotal")
+ public Optional getCountTotal() {
+ return countTotal;
+ }
+
+ /**
+ * @return The number of runs where the model produced a non-null value for this field.
+ */
+ @JsonProperty("countPresent")
+ public Optional getCountPresent() {
+ return countPresent;
+ }
+
+ /**
+ * @return The number of runs where an expected value was provided.
+ */
+ @JsonProperty("countExpected")
+ public Optional getCountExpected() {
+ return countExpected;
+ }
+
+ /**
+ * @return The number of runs where the extracted value matched the expected value.
+ */
+ @JsonProperty("countAccurate")
+ public Optional getCountAccurate() {
+ return countAccurate;
+ }
+
+ /**
+ * @return Accuracy for this field, computed as countAccurate / countExpected. Omitted when countExpected is 0.
+ */
+ @JsonProperty("accuracy")
+ public Optional getAccuracy() {
+ return accuracy;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof EvaluationSetRunFieldMetric && equalTo((EvaluationSetRunFieldMetric) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(EvaluationSetRunFieldMetric other) {
+ return countTotal.equals(other.countTotal)
+ && countPresent.equals(other.countPresent)
+ && countExpected.equals(other.countExpected)
+ && countAccurate.equals(other.countAccurate)
+ && accuracy.equals(other.accuracy);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.countTotal, this.countPresent, this.countExpected, this.countAccurate, this.accuracy);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional countTotal = Optional.empty();
+
+ private Optional countPresent = Optional.empty();
+
+ private Optional countExpected = Optional.empty();
+
+ private Optional countAccurate = Optional.empty();
+
+ private Optional accuracy = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(EvaluationSetRunFieldMetric other) {
+ countTotal(other.getCountTotal());
+ countPresent(other.getCountPresent());
+ countExpected(other.getCountExpected());
+ countAccurate(other.getCountAccurate());
+ accuracy(other.getAccuracy());
+ return this;
+ }
+
+ /**
+ * The number of runs that included this field in the schema.
+ */
+ @JsonSetter(value = "countTotal", nulls = Nulls.SKIP)
+ public Builder countTotal(Optional countTotal) {
+ this.countTotal = countTotal;
+ return this;
+ }
+
+ public Builder countTotal(Double countTotal) {
+ this.countTotal = Optional.ofNullable(countTotal);
+ return this;
+ }
+
+ /**
+ * The number of runs where the model produced a non-null value for this field.
+ */
+ @JsonSetter(value = "countPresent", nulls = Nulls.SKIP)
+ public Builder countPresent(Optional countPresent) {
+ this.countPresent = countPresent;
+ return this;
+ }
+
+ public Builder countPresent(Double countPresent) {
+ this.countPresent = Optional.ofNullable(countPresent);
+ return this;
+ }
+
+ /**
+ * The number of runs where an expected value was provided.
+ */
+ @JsonSetter(value = "countExpected", nulls = Nulls.SKIP)
+ public Builder countExpected(Optional countExpected) {
+ this.countExpected = countExpected;
+ return this;
+ }
+
+ public Builder countExpected(Double countExpected) {
+ this.countExpected = Optional.ofNullable(countExpected);
+ return this;
+ }
+
+ /**
+ * The number of runs where the extracted value matched the expected value.
+ */
+ @JsonSetter(value = "countAccurate", nulls = Nulls.SKIP)
+ public Builder countAccurate(Optional countAccurate) {
+ this.countAccurate = countAccurate;
+ return this;
+ }
+
+ public Builder countAccurate(Double countAccurate) {
+ this.countAccurate = Optional.ofNullable(countAccurate);
+ return this;
+ }
+
+ /**
+ * Accuracy for this field, computed as countAccurate / countExpected. Omitted when countExpected is 0.
+ */
+ @JsonSetter(value = "accuracy", nulls = Nulls.SKIP)
+ public Builder accuracy(Optional accuracy) {
+ this.accuracy = accuracy;
+ return this;
+ }
+
+ public Builder accuracy(Double accuracy) {
+ this.accuracy = Optional.ofNullable(accuracy);
+ return this;
+ }
+
+ public EvaluationSetRunFieldMetric build() {
+ return new EvaluationSetRunFieldMetric(
+ countTotal, countPresent, countExpected, countAccurate, accuracy, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/ai/extend/types/EvaluationSetRunMetrics.java b/src/main/java/ai/extend/types/EvaluationSetRunMetrics.java
index 09b541d..0825de2 100644
--- a/src/main/java/ai/extend/types/EvaluationSetRunMetrics.java
+++ b/src/main/java/ai/extend/types/EvaluationSetRunMetrics.java
@@ -3,128 +3,261 @@
*/
package ai.extend.types;
-import ai.extend.core.ObjectMappers;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSetter;
-import com.fasterxml.jackson.annotation.Nulls;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.HashMap;
-import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonUnwrapped;
+import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
-@JsonInclude(JsonInclude.Include.NON_ABSENT)
-@JsonDeserialize(builder = EvaluationSetRunMetrics.Builder.class)
public final class EvaluationSetRunMetrics {
- private final Optional numFiles;
+ private final Value value;
- private final Optional numPages;
+ @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
+ private EvaluationSetRunMetrics(Value value) {
+ this.value = value;
+ }
+
+ public T visit(Visitor visitor) {
+ return value.visit(visitor);
+ }
+
+ public static EvaluationSetRunMetrics extract(ExtractEvaluationSetRunMetrics value) {
+ return new EvaluationSetRunMetrics(new ExtractValue(value));
+ }
+
+ public static EvaluationSetRunMetrics classify(ClassifyEvaluationSetRunMetrics value) {
+ return new EvaluationSetRunMetrics(new ClassifyValue(value));
+ }
- private final Map additionalProperties;
+ public static EvaluationSetRunMetrics splitter(SplitterEvaluationSetRunMetrics value) {
+ return new EvaluationSetRunMetrics(new SplitterValue(value));
+ }
- private EvaluationSetRunMetrics(
- Optional numFiles, Optional numPages, Map additionalProperties) {
- this.numFiles = numFiles;
- this.numPages = numPages;
- this.additionalProperties = additionalProperties;
+ public boolean isExtract() {
+ return value instanceof ExtractValue;
}
- /**
- * @return The total number of files processed in this evaluation set run
- */
- @JsonProperty("numFiles")
- public Optional getNumFiles() {
- return numFiles;
+ public boolean isClassify() {
+ return value instanceof ClassifyValue;
}
- /**
- * @return The total number of pages processed in this evaluation set run
- */
- @JsonProperty("numPages")
- public Optional getNumPages() {
- return numPages;
+ public boolean isSplitter() {
+ return value instanceof SplitterValue;
}
- @java.lang.Override
- public boolean equals(Object other) {
- if (this == other) return true;
- return other instanceof EvaluationSetRunMetrics && equalTo((EvaluationSetRunMetrics) other);
+ public boolean _isUnknown() {
+ return value instanceof _UnknownValue;
}
- @JsonAnyGetter
- public Map getAdditionalProperties() {
- return this.additionalProperties;
+ public Optional getExtract() {
+ if (isExtract()) {
+ return Optional.of(((ExtractValue) value).value);
+ }
+ return Optional.empty();
}
- private boolean equalTo(EvaluationSetRunMetrics other) {
- return numFiles.equals(other.numFiles) && numPages.equals(other.numPages);
+ public Optional getClassify() {
+ if (isClassify()) {
+ return Optional.of(((ClassifyValue) value).value);
+ }
+ return Optional.empty();
}
- @java.lang.Override
- public int hashCode() {
- return Objects.hash(this.numFiles, this.numPages);
+ public Optional getSplitter() {
+ if (isSplitter()) {
+ return Optional.of(((SplitterValue) value).value);
+ }
+ return Optional.empty();
}
- @java.lang.Override
- public String toString() {
- return ObjectMappers.stringify(this);
+ public Optional _getUnknown() {
+ if (_isUnknown()) {
+ return Optional.of(((_UnknownValue) value).value);
+ }
+ return Optional.empty();
}
- public static Builder builder() {
- return new Builder();
+ @JsonValue
+ private Value getValue() {
+ return this.value;
}
+ public interface Visitor {
+ T visitExtract(ExtractEvaluationSetRunMetrics extract);
+
+ T visitClassify(ClassifyEvaluationSetRunMetrics classify);
+
+ T visitSplitter(SplitterEvaluationSetRunMetrics splitter);
+
+ T _visitUnknown(Object unknownType);
+ }
+
+ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class)
+ @JsonSubTypes({
+ @JsonSubTypes.Type(ExtractValue.class),
+ @JsonSubTypes.Type(ClassifyValue.class),
+ @JsonSubTypes.Type(SplitterValue.class)
+ })
@JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder {
- private Optional numFiles = Optional.empty();
+ private interface Value {
+ T visit(Visitor visitor);
+ }
+
+ @JsonTypeName("EXTRACT")
+ @JsonIgnoreProperties("type")
+ private static final class ExtractValue implements Value {
+ @JsonUnwrapped
+ private ExtractEvaluationSetRunMetrics value;
+
+ @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
+ private ExtractValue() {}
- private Optional numPages = Optional.empty();
+ private ExtractValue(ExtractEvaluationSetRunMetrics value) {
+ this.value = value;
+ }
- @JsonAnySetter
- private Map additionalProperties = new HashMap<>();
+ @java.lang.Override
+ public T visit(Visitor visitor) {
+ return visitor.visitExtract(value);
+ }
- private Builder() {}
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ExtractValue && equalTo((ExtractValue) other);
+ }
- public Builder from(EvaluationSetRunMetrics other) {
- numFiles(other.getNumFiles());
- numPages(other.getNumPages());
- return this;
+ private boolean equalTo(ExtractValue other) {
+ return value.equals(other.value);
}
- /**
- * The total number of files processed in this evaluation set run
- */
- @JsonSetter(value = "numFiles", nulls = Nulls.SKIP)
- public Builder numFiles(Optional numFiles) {
- this.numFiles = numFiles;
- return this;
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.value);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return "EvaluationSetRunMetrics{" + "value: " + value + "}";
+ }
+ }
+
+ @JsonTypeName("CLASSIFY")
+ @JsonIgnoreProperties("type")
+ private static final class ClassifyValue implements Value {
+ @JsonUnwrapped
+ private ClassifyEvaluationSetRunMetrics value;
+
+ @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
+ private ClassifyValue() {}
+
+ private ClassifyValue(ClassifyEvaluationSetRunMetrics value) {
+ this.value = value;
+ }
+
+ @java.lang.Override
+ public T visit(Visitor visitor) {
+ return visitor.visitClassify(value);
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof ClassifyValue && equalTo((ClassifyValue) other);
+ }
+
+ private boolean equalTo(ClassifyValue other) {
+ return value.equals(other.value);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.value);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return "EvaluationSetRunMetrics{" + "value: " + value + "}";
+ }
+ }
+
+ @JsonTypeName("SPLITTER")
+ @JsonIgnoreProperties("type")
+ private static final class SplitterValue implements Value {
+ @JsonUnwrapped
+ private SplitterEvaluationSetRunMetrics value;
+
+ @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
+ private SplitterValue() {}
+
+ private SplitterValue(SplitterEvaluationSetRunMetrics value) {
+ this.value = value;
+ }
+
+ @java.lang.Override
+ public T visit(Visitor visitor) {
+ return visitor.visitSplitter(value);
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof SplitterValue && equalTo((SplitterValue) other);
+ }
+
+ private boolean equalTo(SplitterValue other) {
+ return value.equals(other.value);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.value);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return "EvaluationSetRunMetrics{" + "value: " + value + "}";
+ }
+ }
+
+ @JsonIgnoreProperties("type")
+ private static final class _UnknownValue implements Value {
+ private String type;
+
+ @JsonValue
+ private Object value;
+
+ @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
+ private _UnknownValue(@JsonProperty("value") Object value) {}
+
+ @java.lang.Override
+ public T visit(Visitor visitor) {
+ return visitor._visitUnknown(value);
}
- public Builder numFiles(Double numFiles) {
- this.numFiles = Optional.ofNullable(numFiles);
- return this;
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof _UnknownValue && equalTo((_UnknownValue) other);
}
- /**
- * The total number of pages processed in this evaluation set run
- */
- @JsonSetter(value = "numPages", nulls = Nulls.SKIP)
- public Builder numPages(Optional numPages) {
- this.numPages = numPages;
- return this;
+ private boolean equalTo(_UnknownValue other) {
+ return type.equals(other.type) && value.equals(other.value);
}
- public Builder numPages(Double numPages) {
- this.numPages = Optional.ofNullable(numPages);
- return this;
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.type, this.value);
}
- public EvaluationSetRunMetrics build() {
- return new EvaluationSetRunMetrics(numFiles, numPages, additionalProperties);
+ @java.lang.Override
+ public String toString() {
+ return "EvaluationSetRunMetrics{" + "type: " + type + ", value: " + value + "}";
}
}
}
diff --git a/src/main/java/ai/extend/types/EvaluationSetRunMetricsBase.java b/src/main/java/ai/extend/types/EvaluationSetRunMetricsBase.java
new file mode 100644
index 0000000..c945923
--- /dev/null
+++ b/src/main/java/ai/extend/types/EvaluationSetRunMetricsBase.java
@@ -0,0 +1,371 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package ai.extend.types;
+
+import ai.extend.core.ObjectMappers;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = EvaluationSetRunMetricsBase.Builder.class)
+public final class EvaluationSetRunMetricsBase implements IEvaluationSetRunMetricsBase {
+ private final Optional numFilesTotal;
+
+ private final Optional numFilesProcessed;
+
+ private final Optional numFiles;
+
+ private final Optional numPages;
+
+ private final Optional meanLatencyMs;
+
+ private final Optional p50LatencyMs;
+
+ private final Optional p90LatencyMs;
+
+ private final Optional p95LatencyMs;
+
+ private final Optional p99LatencyMs;
+
+ private final Map additionalProperties;
+
+ private EvaluationSetRunMetricsBase(
+ Optional numFilesTotal,
+ Optional numFilesProcessed,
+ Optional numFiles,
+ Optional numPages,
+ Optional meanLatencyMs,
+ Optional p50LatencyMs,
+ Optional p90LatencyMs,
+ Optional p95LatencyMs,
+ Optional p99LatencyMs,
+ Map additionalProperties) {
+ this.numFilesTotal = numFilesTotal;
+ this.numFilesProcessed = numFilesProcessed;
+ this.numFiles = numFiles;
+ this.numPages = numPages;
+ this.meanLatencyMs = meanLatencyMs;
+ this.p50LatencyMs = p50LatencyMs;
+ this.p90LatencyMs = p90LatencyMs;
+ this.p95LatencyMs = p95LatencyMs;
+ this.p99LatencyMs = p99LatencyMs;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The total number of files that will be processed in this evaluation set run.
+ */
+ @JsonProperty("numFilesTotal")
+ @java.lang.Override
+ public Optional getNumFilesTotal() {
+ return numFilesTotal;
+ }
+
+ /**
+ * @return The number of files that have finished processing.
+ */
+ @JsonProperty("numFilesProcessed")
+ @java.lang.Override
+ public Optional getNumFilesProcessed() {
+ return numFilesProcessed;
+ }
+
+ /**
+ * @return Deprecated. Use numFilesProcessed instead.
+ */
+ @JsonProperty("numFiles")
+ @java.lang.Override
+ public Optional getNumFiles() {
+ return numFiles;
+ }
+
+ /**
+ * @return The total number of pages processed across the completed files.
+ */
+ @JsonProperty("numPages")
+ @java.lang.Override
+ public Optional getNumPages() {
+ return numPages;
+ }
+
+ /**
+ * @return Mean per-file latency in milliseconds.
+ */
+ @JsonProperty("meanLatencyMs")
+ @java.lang.Override
+ public Optional getMeanLatencyMs() {
+ return meanLatencyMs;
+ }
+
+ /**
+ * @return 50th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p50LatencyMs")
+ @java.lang.Override
+ public Optional getP50LatencyMs() {
+ return p50LatencyMs;
+ }
+
+ /**
+ * @return 90th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p90LatencyMs")
+ @java.lang.Override
+ public Optional getP90LatencyMs() {
+ return p90LatencyMs;
+ }
+
+ /**
+ * @return 95th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p95LatencyMs")
+ @java.lang.Override
+ public Optional getP95LatencyMs() {
+ return p95LatencyMs;
+ }
+
+ /**
+ * @return 99th percentile per-file latency in milliseconds.
+ */
+ @JsonProperty("p99LatencyMs")
+ @java.lang.Override
+ public Optional getP99LatencyMs() {
+ return p99LatencyMs;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof EvaluationSetRunMetricsBase && equalTo((EvaluationSetRunMetricsBase) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(EvaluationSetRunMetricsBase other) {
+ return numFilesTotal.equals(other.numFilesTotal)
+ && numFilesProcessed.equals(other.numFilesProcessed)
+ && numFiles.equals(other.numFiles)
+ && numPages.equals(other.numPages)
+ && meanLatencyMs.equals(other.meanLatencyMs)
+ && p50LatencyMs.equals(other.p50LatencyMs)
+ && p90LatencyMs.equals(other.p90LatencyMs)
+ && p95LatencyMs.equals(other.p95LatencyMs)
+ && p99LatencyMs.equals(other.p99LatencyMs);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(
+ this.numFilesTotal,
+ this.numFilesProcessed,
+ this.numFiles,
+ this.numPages,
+ this.meanLatencyMs,
+ this.p50LatencyMs,
+ this.p90LatencyMs,
+ this.p95LatencyMs,
+ this.p99LatencyMs);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private Optional numFilesTotal = Optional.empty();
+
+ private Optional numFilesProcessed = Optional.empty();
+
+ private Optional numFiles = Optional.empty();
+
+ private Optional numPages = Optional.empty();
+
+ private Optional meanLatencyMs = Optional.empty();
+
+ private Optional p50LatencyMs = Optional.empty();
+
+ private Optional p90LatencyMs = Optional.empty();
+
+ private Optional p95LatencyMs = Optional.empty();
+
+ private Optional