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 @@ -28,7 +28,7 @@ llms:
api_key: not-used
model_name: ${NEMO_DEFAULT_MODEL}
temperature: 0.0
max_tokens: 512
max_tokens: 1024

workflow:
_type: react_agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface ControlledDatasetFileSelectProps extends UseControllerComponentProps {
datasetLabel?: string;
/** Auto-select the first root-level accepted file on fileset selection. */
autoSelectFirstAcceptable?: boolean;
showUpdatedAt?: boolean;
/**
* Callback fired when a file is selected. Useful for custom validation or processing.
* Called with the selected file info, or null when file is cleared.
Expand Down Expand Up @@ -83,6 +84,7 @@ export const ControlledDatasetFileSelect: FC<ControlledDatasetFileSelectProps> =
filesetPurpose,
datasetLabel,
autoSelectFirstAcceptable,
showUpdatedAt,
}) => {
const {
field: { onChange, value },
Expand Down Expand Up @@ -144,6 +146,7 @@ export const ControlledDatasetFileSelect: FC<ControlledDatasetFileSelectProps> =
filesetPurpose={filesetPurpose}
datasetLabel={datasetLabel}
autoSelectFirstAcceptable={autoSelectFirstAcceptable}
showUpdatedAt={showUpdatedAt}
/>
</FormField>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ interface DatasetFileSelectProps {
datasetLabel?: string;
/** Auto-select the first root-level accepted file on fileset selection. */
autoSelectFirstAcceptable?: boolean;
showUpdatedAt?: boolean;
}

/**
Expand Down Expand Up @@ -87,6 +88,7 @@ export const DatasetFileSelect: FC<DatasetFileSelectProps> = ({
filesetPurpose,
datasetLabel,
autoSelectFirstAcceptable,
showUpdatedAt,
}) => {
const [isModalOpen, setIsModalOpen] = useState(false);

Expand Down Expand Up @@ -211,6 +213,7 @@ export const DatasetFileSelect: FC<DatasetFileSelectProps> = ({
filesetPurpose={filesetPurpose}
datasetLabel={datasetLabel}
autoSelectFirstAcceptable={autoSelectFirstAcceptable}
showUpdatedAt={showUpdatedAt}
/>
) : (
<DatasetFileSelectButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type UploadModalState = {
datasetLabel?: string;
/** Auto-select the first root-level accepted file on fileset selection. */
autoSelectFirstAcceptable?: boolean;
showUpdatedAt?: boolean;
Comment thread
nv-odrulea marked this conversation as resolved.
errors: Record<string, string>;
};

Expand Down Expand Up @@ -106,6 +107,7 @@ export const uploadModalReducer = (
allowMultipleFileSelection: state.allowMultipleFileSelection,
invalidFileMode: state.invalidFileMode,
allowNewDataset: state.allowNewDataset,
showUpdatedAt: state.showUpdatedAt,
};

case 'UPDATE_DATASET':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { getFileExtension } from '@nemo/common/src/components/DatasetFileSelect/utils';
import { RelativeTime } from '@nemo/common/src/components/RelativeTime';
import { useUploadModalContext } from '@nemo/common/src/components/UploadModal/Context/useUploadModalContext';
import { getExistingFileId } from '@nemo/common/src/components/UploadModal/utils';
import { getEntityReference } from '@nemo/common/src/namedEntity';
Expand All @@ -20,14 +21,29 @@ interface Props {
error?: string;
}

const filesetToOption = (fileset: FilesetOutput) => ({
const filesetToOption = (fileset: FilesetOutput, showUpdatedAt?: boolean) => ({
children: fileset.name ?? '',
value: getEntityReference(fileset),
...(showUpdatedAt && fileset.updated_at
? {
slotEnd: (
<Text kind="body/regular/xs" color="secondary">
<RelativeTime datetime={fileset.updated_at} />
</Text>
),
}
: {}),
});

export const DatasetSelect: FC<Props> = ({ project, disabled, error }) => {
const [state, dispatch] = useUploadModalContext();
const { dataset, allowNewDataset, acceptableFileTypes, autoSelectFirstAcceptable } = state;
const {
dataset,
allowNewDataset,
acceptableFileTypes,
autoSelectFirstAcceptable,
showUpdatedAt,
} = state;
const purpose = state.filesetPurpose ?? 'dataset';
const label = state.datasetLabel ?? 'Dataset';

Expand Down Expand Up @@ -105,9 +121,9 @@ export const DatasetSelect: FC<Props> = ({ project, disabled, error }) => {
return (
filesets
?.sort((filesetA, filesetB) => (filesetA?.name || '').localeCompare(filesetB.name || ''))
.map(filesetToOption) || []
.map((fileset) => filesetToOption(fileset, showUpdatedAt)) || []
);
}, [filesets, isLoading, isError]);
}, [filesets, isLoading, isError, showUpdatedAt]);

return (
<FormField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type InlineUploadPickerProps = Pick<
| 'filesetPurpose'
| 'datasetLabel'
| 'autoSelectFirstAcceptable'
| 'showUpdatedAt'
> & {
/** Called once the picked / uploaded file is committed. */
onSubmit: (data: SubmitUploadType) => void;
Expand Down Expand Up @@ -154,6 +155,7 @@ export const InlineUploadPicker: FC<InlineUploadPickerProps> = ({
filesetPurpose,
datasetLabel,
autoSelectFirstAcceptable,
showUpdatedAt,
onSubmit,
addButtonText = 'Add file',
autoCommit = false,
Expand All @@ -178,6 +180,7 @@ export const InlineUploadPicker: FC<InlineUploadPickerProps> = ({
datasetLabel: datasetLabel ?? uploadModalInitialState.datasetLabel,
autoSelectFirstAcceptable:
autoSelectFirstAcceptable ?? uploadModalInitialState.autoSelectFirstAcceptable,
showUpdatedAt: showUpdatedAt ?? uploadModalInitialState.showUpdatedAt,
}),
[
allowMultipleFileSelection,
Expand All @@ -188,6 +191,7 @@ export const InlineUploadPicker: FC<InlineUploadPickerProps> = ({
filesetPurpose,
datasetLabel,
autoSelectFirstAcceptable,
showUpdatedAt,
]
);
return (
Expand Down
2 changes: 2 additions & 0 deletions web/packages/common/src/components/UploadModal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export interface UploadModalProps {
datasetLabel?: string;
/** Auto-select the first root-level accepted file on fileset selection. */
autoSelectFirstAcceptable?: boolean;
/** Show each fileset's updated-at date in the picker options (opt-in). */
showUpdatedAt?: boolean;
attributes?: {
ModalRoot?: React.ComponentProps<typeof ModalRoot>;
ModalContent?: React.ComponentProps<typeof ModalContent>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"tasks": [
{
"id": "calc-0",
"intent": "Compute the product of 3 and 7 and compare it to the current hour",
"inputs": {
"instruction": "What is the product of 3 and 7, and is it greater than the current hour?"
},
"reference": {
"product": 21
}
},
{
"id": "calc-1",
"intent": "Compute the sum of 12 and 8 and compare it to the current day of the week",
"inputs": {
"instruction": "Is the sum of 12 and 8 greater than the current day of the week in number form?"
},
"reference": {
"sum": 20
}
},
{
"id": "calc-2",
"intent": "Compute the difference between 50 and 35 and compare it to the current minute",
"inputs": {
"instruction": "What is the difference between 50 and 35, and is it smaller than the current minute of the hour?"
},
"reference": {
"difference": 15
}
}
],
"metric": {
"bundle_kind": "metric-bundle",
"bundle_format_version": "v1",
"metric_type": "llm-judge",
"metadata": {
"description": null,
"labels": {}
},
"outputs": [
{
"name": "accuracy",
"description": null,
"value_json_schema": {
"description": "Continuous numeric metric value.",
"title": "ContinuousScore",
"type": "number"
}
}
],
"secrets": {},
"payload": {
"kind": "inline",
"metric": {
"type": "llm-judge",
"model": "default/nvidia-nemotron-3-super-120b-a12b",
"prompt_template": {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"messages": [
{
"role": "user",
"content": "You are scoring a calculator agent that performs arithmetic and datetime comparisons.\n\nThe expected numeric result for this task is: {{ item.reference }}.\n\nAgent response:\n{{ sample.output_text }}\n\nScore whether the agent's response contains the correct numeric result and a valid datetime comparison.\n- accuracy = 1 if the response contains the correct number (e.g. 21 for 3*7) and makes a valid comparison to the current time value.\n- accuracy = 0 if the numeric result is wrong or the comparison is missing or nonsensical.\n- accuracy = 0.5 if the numeric result is correct but the datetime comparison is absent or unclear.\n\nRespond with a JSON object {\"accuracy\": <value>} where accuracy is 0, 0.5, or 1."
}
]
},
"scores": [
{
"name": "accuracy",
"minimum": 0,
"maximum": 1
}
],
"inference": {
"max_tokens": 1024,
"extra_body": {
"nvext": {
"max_thinking_tokens": 256
}
}
},
"reasoning": {
"end_token": "</think>"
}
}
}
},
"max_concurrent_tasks": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ llms:
api_key: not-used
model_name: ${NEMO_DEFAULT_MODEL}
temperature: 0.0
max_tokens: 512
max_tokens: 1024
workflow:
_type: tool_calling_agent
tool_names: [email_phishing_analyzer]
Expand Down
Loading
Loading