mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-30 12:39:27 +08:00
Fix: model selection format compat and provider api_key wrapping (#17112)
This commit is contained in:
@@ -29,7 +29,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { parseModelValue } from '@/utils/llm-util';
|
||||
import { buildModelValue, parseModelValue } from '@/utils/llm-util';
|
||||
import { useWarnEmptyModel } from './use-warn-empty-model';
|
||||
|
||||
export const enum LLMApiAction {
|
||||
@@ -629,7 +629,17 @@ export const useFetchDefaultModelDictionary = (showEmptyModelWarn = false) => {
|
||||
const dict: Record<string, string> = {};
|
||||
Object.entries(ModelTypeToField).forEach(([key, field]) => {
|
||||
const model = defaultModels.find((m) => m.model_type === key);
|
||||
dict[field] = model && model.enable ? model.model_id : '';
|
||||
if (!model || !model.enable) {
|
||||
dict[field] = '';
|
||||
return;
|
||||
}
|
||||
dict[field] =
|
||||
model.model_id ||
|
||||
buildModelValue({
|
||||
model_name: model.model_name,
|
||||
model_instance: model.model_instance,
|
||||
model_provider: model.model_provider,
|
||||
});
|
||||
});
|
||||
return dict;
|
||||
}, [defaultModels]);
|
||||
|
||||
Reference in New Issue
Block a user