@@ -33,6 +33,8 @@ public final class Eval<INPUT, OUTPUT> {
3333 private final @ Nonnull Dataset <INPUT , OUTPUT > dataset ;
3434 private final @ Nonnull Task <INPUT , OUTPUT > task ;
3535 private final @ Nonnull List <Scorer <INPUT , OUTPUT >> scorers ;
36+ private final @ Nonnull List <String > tags ;
37+ private final @ Nonnull Map <String , Object > metadata ;
3638
3739 private Eval (Builder <INPUT , OUTPUT > builder ) {
3840 this .experimentName = builder .experimentName ;
@@ -52,6 +54,8 @@ private Eval(Builder<INPUT, OUTPUT> builder) {
5254 this .dataset = builder .dataset ;
5355 this .task = Objects .requireNonNull (builder .task );
5456 this .scorers = List .copyOf (builder .scorers );
57+ this .tags = List .copyOf (builder .tags );
58+ this .metadata = Map .copyOf (builder .metadata );
5559 }
5660
5761 /** Runs the evaluation and returns results. */
@@ -62,7 +66,9 @@ public EvalResult run() {
6266 orgAndProject .project ().id (),
6367 experimentName ,
6468 Optional .empty (),
65- Optional .empty ()));
69+ Optional .empty (),
70+ tags .isEmpty () ? Optional .empty () : Optional .of (tags ),
71+ metadata .isEmpty () ? Optional .empty () : Optional .of (metadata )));
6672 dataset .forEach (datasetCase -> evalOne (experiment .id (), datasetCase ));
6773 var experimentUrl =
6874 "%s/experiments/%s"
@@ -163,6 +169,8 @@ public static final class Builder<INPUT, OUTPUT> {
163169 private @ Nullable Tracer tracer = null ;
164170 private @ Nullable Task <INPUT , OUTPUT > task ;
165171 private @ Nonnull List <Scorer <INPUT , OUTPUT >> scorers = List .of ();
172+ private @ Nonnull List <String > tags = List .of ();
173+ private @ Nonnull Map <String , Object > metadata = Map .of ();
166174
167175 public Eval <INPUT , OUTPUT > build () {
168176 if (config == null ) {
@@ -256,5 +264,23 @@ public final Builder<INPUT, OUTPUT> scorers(Scorer<INPUT, OUTPUT>... scorers) {
256264 this .scorers = List .of (scorers );
257265 return this ;
258266 }
267+
268+ /** Sets tags for the experiment. */
269+ public Builder <INPUT , OUTPUT > tags (List <String > tags ) {
270+ this .tags = List .copyOf (tags );
271+ return this ;
272+ }
273+
274+ /** Sets tags for the experiment (varargs convenience method). */
275+ public Builder <INPUT , OUTPUT > tags (String ... tags ) {
276+ this .tags = List .of (tags );
277+ return this ;
278+ }
279+
280+ /** Sets metadata for the experiment. */
281+ public Builder <INPUT , OUTPUT > metadata (Map <String , Object > metadata ) {
282+ this .metadata = Map .copyOf (metadata );
283+ return this ;
284+ }
259285 }
260286}
0 commit comments