mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Add LlmSettingFieldItems component #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -119,6 +119,26 @@ export const useFetchNextDialogList = () => {
|
||||
return { data, loading, refetch };
|
||||
};
|
||||
|
||||
export const useFetchChatAppList = () => {
|
||||
const {
|
||||
data,
|
||||
isFetching: loading,
|
||||
refetch,
|
||||
} = useQuery<IDialog[]>({
|
||||
queryKey: ['fetchChatAppList'],
|
||||
initialData: [],
|
||||
gcTime: 0,
|
||||
refetchOnWindowFocus: false,
|
||||
queryFn: async () => {
|
||||
const { data } = await chatService.listDialog();
|
||||
|
||||
return data?.data ?? [];
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, refetch };
|
||||
};
|
||||
|
||||
export const useSetNextDialog = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
|
||||
@ -116,7 +116,11 @@ export const useComposeLlmOptionsByModelTypes = (
|
||||
) => {
|
||||
const allOptions = useSelectLlmOptionsByModelType();
|
||||
|
||||
return modelTypes.reduce<DefaultOptionType[]>((pre, cur) => {
|
||||
return modelTypes.reduce<
|
||||
(DefaultOptionType & {
|
||||
options: { label: JSX.Element; value: string; disabled: boolean }[];
|
||||
})[]
|
||||
>((pre, cur) => {
|
||||
const options = allOptions[cur];
|
||||
options.forEach((x) => {
|
||||
const item = pre.find((y) => y.label === x.label);
|
||||
|
||||
Reference in New Issue
Block a user