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 @@ -39,7 +39,7 @@ const BaseModelSearchFilterFieldSingle: FC<

const { models, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = useBaseModels({
workspace,
filter: searchInput.trim() ? { name: searchInput.trim() } : undefined,
filter: searchInput.trim() ? { name: { $like: searchInput.trim() } } : undefined,
sort: ModelEntitySortField.name,
});

Expand All @@ -52,7 +52,11 @@ const BaseModelSearchFilterFieldSingle: FC<
}, [selectedBaseModel, form]);

const options = useMemo(
() => models.map((model) => ({ value: model.name ?? '', label: model.name ?? '' })),
() =>
models.map((model) => ({
value: `${model.workspace}/${model.name ?? ''}`,
label: model.name ?? '',
})),
[models]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,21 @@ export const VirtualModelsDataView: FC<VirtualModelsDataViewProps> = ({
const columnFilters = new Map(dataViewState.debouncedColumnFilters.map((f) => [f.id, f.value]));
const name = dataViewState.debouncedSearchBar || undefined;
const defaultModelEntity = columnFilters.get('default_model_entity') as string | undefined;
// API requires workspace-qualified form ("default/model-name"); dropdown yields bare names.
const qualifiedDefaultModelEntity = defaultModelEntity
? defaultModelEntity.includes('/')
? defaultModelEntity
: `${workspace}/${defaultModelEntity}`
: undefined;
Comment thread
htolentino-nvidia marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const createdAt = columnFilters.get('created_at') as DatetimeFilter | undefined;
return withOperators<VirtualModelFilter>({
...(name ? { name: { $like: name } } : {}),
...(defaultModelEntity ? { default_model_entity: { $eq: defaultModelEntity } } : {}),
...(qualifiedDefaultModelEntity
? { default_model_entity: { $eq: qualifiedDefaultModelEntity } }
: {}),
...(createdAt ? { created_at: createdAt } : {}),
});
}, [dataViewState.debouncedSearchBar, dataViewState.debouncedColumnFilters]);
}, [dataViewState.debouncedSearchBar, dataViewState.debouncedColumnFilters, workspace]);

const { data, isFetching, error } = useListVirtualModels(
workspace,
Expand Down