Skip to content

Commit

Permalink
Add support for manually entering eval datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
spong committed Sep 25, 2024
1 parent 8c35839 commit 2b1ebee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ export const EvaluationSettings: React.FC = React.memo(() => {
},
[setSelectedDatasetOptions]
);
const onDatasetCreateOption = useCallback(
(searchValue = []) => {
const normalizedSearchValue = searchValue.trim().toLowerCase();
if (!normalizedSearchValue) {
return;
}
const newOption = {
label: searchValue,
};

setSelectedDatasetOptions([newOption]);
},
[setSelectedDatasetOptions]
);

// Predictions
// Connectors / Models
Expand Down Expand Up @@ -244,6 +258,7 @@ export const EvaluationSettings: React.FC = React.memo(() => {
options={datasetOptions}
selectedOptions={selectedDatasetOptions}
onChange={onDatasetOptionsChange}
onCreateOption={onDatasetCreateOption}
compressed={true}
/>
</EuiFormRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export const EVALUATOR_DATASET_LABEL = i18n.translate(
export const LANGSMITH_DATASET_DESCRIPTION = i18n.translate(
'xpack.elasticAssistant.assistant.settings.evaluationSettings.langsmithDatasetDescription',
{
defaultMessage: 'Name of dataset hosted on LangSmith to evaluate.',
defaultMessage:
'Name of dataset hosted on LangSmith to evaluate. Must manually enter on cloud environments.',
}
);

Expand Down

0 comments on commit 2b1ebee

Please sign in to comment.