Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Assistant] Add support for manually entering eval datasets #194072

Merged
merged 2 commits into from
Sep 26, 2024
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 @@ -95,6 +95,20 @@ export const EvaluationSettings: React.FC = React.memo(() => {
},
[setSelectedDatasetOptions]
);
const onDatasetCreateOption = useCallback(
(searchValue: string) => {
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