-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPIK-147] Add filters to dataset item experiment compare endpoint (#359
- Loading branch information
1 parent
63d162b
commit 373194c
Showing
11 changed files
with
578 additions
and
54 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
apps/opik-backend/src/main/java/com/comet/opik/api/filter/ExperimentsComparisonField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.comet.opik.api.filter; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum ExperimentsComparisonField implements Field { | ||
|
||
INPUT(INPUT_QUERY_PARAM, FieldType.STRING), | ||
EXPECTED_OUTPUT(EXPECTED_OUTPUT_QUERY_PARAM, FieldType.STRING), | ||
OUTPUT(OUTPUT_QUERY_PARAM, FieldType.STRING), | ||
METADATA(METADATA_QUERY_PARAM, FieldType.DICTIONARY), | ||
FEEDBACK_SCORES(FEEDBACK_SCORES_QUERY_PARAM, FieldType.FEEDBACK_SCORES_NUMBER), | ||
; | ||
|
||
private final String queryParamField; | ||
private final FieldType type; | ||
} |
28 changes: 28 additions & 0 deletions
28
apps/opik-backend/src/main/java/com/comet/opik/api/filter/ExperimentsComparisonFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.comet.opik.api.filter; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.List; | ||
|
||
@SuperBuilder(toBuilder = true) | ||
public class ExperimentsComparisonFilter extends FilterImpl { | ||
|
||
public static final TypeReference<List<ExperimentsComparisonFilter>> LIST_TYPE_REFERENCE = new TypeReference<>() { | ||
}; | ||
|
||
@JsonCreator | ||
public ExperimentsComparisonFilter(@JsonProperty(value = "field", required = true) ExperimentsComparisonField field, | ||
@JsonProperty(value = "operator", required = true) Operator operator, | ||
@JsonProperty("key") String key, | ||
@JsonProperty(value = "value", required = true) String value) { | ||
super(field, operator, key, value); | ||
} | ||
|
||
@Override | ||
public Filter build(String decodedValue) { | ||
return toBuilder().value(decodedValue).build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.