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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception {
EvalCase.of("asparagus", "vegetable"),
EvalCase.of("apple", "fruit"),
EvalCase.of("banana", "fruit"))
.task(getFoodType)
.taskFunction(getFoodType)
.scorers(
Scorer.of(
"fruit_scorer",
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/braintrust/eval/Eval.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public Builder<INPUT, OUTPUT> task(Task<INPUT, OUTPUT> task) {
return this;
}

public Builder<INPUT, OUTPUT> task(Function<INPUT, OUTPUT> taskFn) {
return task((Task<INPUT, OUTPUT>) evalCase -> taskFn.apply(evalCase.input()));
public Builder<INPUT, OUTPUT> taskFunction(Function<INPUT, OUTPUT> taskFn) {
return task(evalCase -> taskFn.apply(evalCase.input()));
}

@SafeVarargs
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/dev/braintrust/eval/EvalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import dev.braintrust.api.BraintrustApiClient;
import dev.braintrust.trace.BraintrustTracing;
import io.opentelemetry.api.common.AttributeKey;
import java.util.function.Function;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand All @@ -30,7 +29,7 @@ public void evalOtelTraceWithProperAttributes() {
.cases(
EvalCase.of("strawberry", "fruit"),
EvalCase.of("asparagus", "vegetable"))
.task((Function<String, String>) food -> "fruit")
.task(food -> "fruit")
.scorers(
Scorer.of(
"fruit_scorer",
Expand Down