2025-10-22 15:27:31 +08:00
|
|
|
import { useState, useCallback, useMemo, useEffect } from 'react';
|
2025-10-21 16:41:22 +08:00
|
|
|
import { useMessage } from '@/hooks/useSnackbar';
|
|
|
|
|
import userService from '@/services/user_service';
|
|
|
|
|
import logger from '@/utils/logger';
|
2025-10-22 11:51:27 +08:00
|
|
|
import type {
|
2025-10-21 16:41:22 +08:00
|
|
|
ApiKeyFormData,
|
|
|
|
|
AzureOpenAIFormData,
|
|
|
|
|
BedrockFormData,
|
|
|
|
|
OllamaFormData,
|
2025-10-24 11:41:44 +08:00
|
|
|
// SystemModelFormData,
|
2025-10-21 16:41:22 +08:00
|
|
|
} from '../components/ModelDialogs';
|
2025-10-22 11:51:27 +08:00
|
|
|
import type { ITenantInfo } from '@/interfaces/database/knowledge';
|
|
|
|
|
import { useLlmList } from '@/hooks/llm-hooks';
|
|
|
|
|
import type { LlmModelType } from '@/constants/knowledge';
|
2025-10-22 15:27:31 +08:00
|
|
|
import { useUserData } from '@/hooks/useUserData';
|
2025-10-24 17:49:25 +08:00
|
|
|
import type { ISetApiKeyRequestBody, IAddLlmRequestBody } from '@/interfaces/request/llm';
|
|
|
|
|
import type { ConfigFormItem, ConfigurationFormData, DocLinkConfig } from '../components/Dialog/ConfigurationDialog';
|
|
|
|
|
import { getLLMConfig } from '../components/Dialog/llmConfigs';
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
// 对话框状态管理 hook
|
|
|
|
|
export const useDialogState = () => {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
const [editMode, setEditMode] = useState(false);
|
|
|
|
|
const [initialData, setInitialData] = useState<any>(null);
|
|
|
|
|
|
|
|
|
|
const openDialog = useCallback((data?: any, isEdit = false) => {
|
2025-10-22 15:27:31 +08:00
|
|
|
if (data != null) {
|
|
|
|
|
setInitialData(data);
|
|
|
|
|
}
|
2025-10-21 16:41:22 +08:00
|
|
|
setEditMode(isEdit);
|
|
|
|
|
setOpen(true);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const closeDialog = useCallback(() => {
|
|
|
|
|
setOpen(false);
|
|
|
|
|
setInitialData(null);
|
|
|
|
|
setEditMode(false);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
open,
|
|
|
|
|
loading,
|
|
|
|
|
editMode,
|
|
|
|
|
initialData,
|
|
|
|
|
setLoading,
|
|
|
|
|
openDialog,
|
|
|
|
|
closeDialog,
|
|
|
|
|
};
|
2025-10-24 17:49:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通用配置对话框管理
|
|
|
|
|
export const useConfigurationDialog = (onSuccess?: () => void) => {
|
|
|
|
|
const dialogState = useDialogState();
|
|
|
|
|
const showMessage = useMessage();
|
|
|
|
|
const [llmFactory, setLlmFactory] = useState('');
|
|
|
|
|
const [config, setConfig] = useState<{
|
|
|
|
|
formItems: ConfigFormItem[];
|
|
|
|
|
docLink?: DocLinkConfig;
|
|
|
|
|
title: string;
|
|
|
|
|
defaultValues: Record<string, any>;
|
|
|
|
|
} | null>(null);
|
|
|
|
|
|
|
|
|
|
const openConfigurationDialog = useCallback((factory: string, data?: Partial<ConfigurationFormData>, isEdit = false) => {
|
|
|
|
|
setLlmFactory(factory);
|
|
|
|
|
const llmConfig = getLLMConfig(factory);
|
|
|
|
|
setConfig(llmConfig);
|
|
|
|
|
|
|
|
|
|
// 合并默认值和传入的数据
|
|
|
|
|
const mergedData = {
|
|
|
|
|
...llmConfig.defaultValues,
|
|
|
|
|
...data,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dialogState.openDialog(mergedData, isEdit);
|
|
|
|
|
}, [dialogState]);
|
|
|
|
|
|
|
|
|
|
const submitConfiguration = useCallback(async (data: Partial<ConfigurationFormData>) => {
|
|
|
|
|
dialogState.setLoading(true);
|
|
|
|
|
logger.info('提交配置:', data);
|
|
|
|
|
try {
|
|
|
|
|
// 构建请求参数
|
|
|
|
|
const params: Partial<IAddLlmRequestBody> = {
|
|
|
|
|
...data,
|
|
|
|
|
llm_factory: llmFactory,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await userService.add_llm(params);
|
|
|
|
|
showMessage.success(`${config?.title || llmFactory} 配置成功`);
|
|
|
|
|
dialogState.closeDialog();
|
|
|
|
|
|
|
|
|
|
// 调用成功回调
|
|
|
|
|
if (onSuccess) {
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error(`${config?.title || llmFactory} 配置失败:`, error);
|
|
|
|
|
showMessage.error(`${config?.title || llmFactory} 配置失败`);
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
|
|
|
|
}, [llmFactory, config, dialogState, showMessage, onSuccess]);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
llmFactory,
|
|
|
|
|
config,
|
|
|
|
|
openConfigurationDialog,
|
|
|
|
|
submitConfiguration,
|
|
|
|
|
};
|
2025-10-21 16:41:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// API Key 对话框管理
|
2025-10-22 16:32:49 +08:00
|
|
|
export const useApiKeyDialog = (onSuccess?: () => void) => {
|
2025-10-21 16:41:22 +08:00
|
|
|
const dialogState = useDialogState();
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
const [factoryName, setFactoryName] = useState('');
|
|
|
|
|
|
|
|
|
|
const openApiKeyDialog = useCallback((factory: string, data?: Partial<ApiKeyFormData>, isEdit = false) => {
|
|
|
|
|
setFactoryName(factory);
|
|
|
|
|
dialogState.openDialog(data, isEdit);
|
|
|
|
|
}, [dialogState]);
|
|
|
|
|
|
|
|
|
|
const submitApiKey = useCallback(async (data: ApiKeyFormData) => {
|
|
|
|
|
dialogState.setLoading(true);
|
2025-10-22 15:27:31 +08:00
|
|
|
logger.info('提交 API Key:', data);
|
2025-10-21 16:41:22 +08:00
|
|
|
try {
|
2025-10-22 15:27:31 +08:00
|
|
|
const params: ISetApiKeyRequestBody = {
|
|
|
|
|
llm_factory: factoryName,
|
|
|
|
|
api_key: data.api_key,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (data.base_url && data.base_url.trim() !== '') {
|
|
|
|
|
params.base_url = data.base_url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (data.group_id && data.group_id.trim() !== '') {
|
|
|
|
|
// params.group_id = data.group_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await userService.set_api_key(params);
|
2025-10-21 16:41:22 +08:00
|
|
|
showMessage.success('API Key 配置成功');
|
|
|
|
|
dialogState.closeDialog();
|
2025-10-22 16:32:49 +08:00
|
|
|
|
|
|
|
|
// 调用成功回调
|
|
|
|
|
if (onSuccess) {
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
2025-10-21 16:41:22 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('API Key 配置失败:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
2025-10-22 16:32:49 +08:00
|
|
|
}, [factoryName, dialogState, onSuccess]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
factoryName,
|
|
|
|
|
openApiKeyDialog,
|
|
|
|
|
submitApiKey,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Azure OpenAI 对话框管理
|
|
|
|
|
export const useAzureOpenAIDialog = () => {
|
|
|
|
|
const dialogState = useDialogState();
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
const submitAzureOpenAI = useCallback(async (data: AzureOpenAIFormData) => {
|
|
|
|
|
dialogState.setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
// 调用 Azure OpenAI 特定的 API
|
2025-10-24 15:40:34 +08:00
|
|
|
await userService.add_llm({
|
|
|
|
|
llm_factory: data.llm_factory,
|
|
|
|
|
llm_name: data.llm_name,
|
|
|
|
|
model_type: data.model_type,
|
|
|
|
|
api_base: data.api_base,
|
2025-10-21 16:41:22 +08:00
|
|
|
api_key: data.api_key,
|
2025-10-24 15:40:34 +08:00
|
|
|
// @ts-ignore
|
|
|
|
|
api_version: data.api_version,
|
|
|
|
|
max_tokens: data.max_tokens,
|
2025-10-21 16:41:22 +08:00
|
|
|
});
|
|
|
|
|
showMessage.success('Azure OpenAI 配置成功');
|
|
|
|
|
dialogState.closeDialog();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('Azure OpenAI 配置失败:', error);
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
2025-10-24 15:40:34 +08:00
|
|
|
}, [dialogState, showMessage]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
submitAzureOpenAI,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// AWS Bedrock 对话框管理
|
|
|
|
|
export const useBedrockDialog = () => {
|
|
|
|
|
const dialogState = useDialogState();
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
const submitBedrock = useCallback(async (data: BedrockFormData) => {
|
|
|
|
|
dialogState.setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
// 调用 Bedrock 特定的 API
|
2025-10-24 15:40:34 +08:00
|
|
|
await userService.add_llm({
|
|
|
|
|
llm_factory: data.llm_factory,
|
|
|
|
|
llm_name: data.llm_name,
|
|
|
|
|
model_type: data.model_type,
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
bedrock_ak: data.bedrock_ak,
|
|
|
|
|
bedrock_sk: data.bedrock_sk,
|
|
|
|
|
bedrock_region: data.bedrock_region,
|
|
|
|
|
max_tokens: data.max_tokens,
|
2025-10-21 16:41:22 +08:00
|
|
|
});
|
|
|
|
|
showMessage.success('AWS Bedrock 配置成功');
|
|
|
|
|
dialogState.closeDialog();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('AWS Bedrock 配置失败:', error);
|
|
|
|
|
showMessage.error('AWS Bedrock 配置失败');
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
|
|
|
|
}, [dialogState]);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
submitBedrock,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Ollama 对话框管理
|
|
|
|
|
export const useOllamaDialog = () => {
|
|
|
|
|
const dialogState = useDialogState();
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
const submitOllama = useCallback(async (data: OllamaFormData) => {
|
|
|
|
|
dialogState.setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
// 调用添加 LLM 的 API
|
|
|
|
|
await userService.add_llm({
|
2025-10-24 15:40:34 +08:00
|
|
|
llm_factory: data.llm_factory,
|
|
|
|
|
llm_name: data.llm_name,
|
|
|
|
|
model_type: data.model_type,
|
|
|
|
|
api_base: data.api_base,
|
|
|
|
|
api_key: data.api_key || '',
|
|
|
|
|
max_tokens: data.max_tokens,
|
2025-10-21 16:41:22 +08:00
|
|
|
});
|
|
|
|
|
showMessage.success('Ollama 模型添加成功');
|
|
|
|
|
dialogState.closeDialog();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('Ollama 模型添加失败:', error);
|
|
|
|
|
showMessage.error('Ollama 模型添加失败');
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
2025-10-24 15:40:34 +08:00
|
|
|
}, [dialogState, showMessage]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
submitOllama,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 删除操作管理
|
2025-10-22 16:32:49 +08:00
|
|
|
export const useDeleteOperations = (onSuccess?: () => void) => {
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
|
|
|
|
|
const deleteLlm = useCallback(async (factoryName: string, modelName: string) => {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
await userService.delete_llm({
|
2025-10-22 15:27:31 +08:00
|
|
|
llm_factory: factoryName,
|
|
|
|
|
llm_name: modelName,
|
2025-10-21 16:41:22 +08:00
|
|
|
});
|
|
|
|
|
showMessage.success('模型删除成功');
|
2025-10-22 16:32:49 +08:00
|
|
|
|
|
|
|
|
// 调用成功回调
|
|
|
|
|
if (onSuccess) {
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
2025-10-21 16:41:22 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('模型删除失败:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
}
|
2025-10-22 16:32:49 +08:00
|
|
|
}, [onSuccess]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
const deleteFactory = useCallback(async (factoryName: string) => {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
await userService.deleteFactory({
|
2025-10-22 15:27:31 +08:00
|
|
|
llm_factory: factoryName,
|
2025-10-21 16:41:22 +08:00
|
|
|
});
|
|
|
|
|
showMessage.success('模型工厂删除成功');
|
2025-10-22 16:32:49 +08:00
|
|
|
|
|
|
|
|
// 调用成功回调
|
|
|
|
|
if (onSuccess) {
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
2025-10-21 16:41:22 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('模型工厂删除失败:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
}
|
2025-10-22 16:32:49 +08:00
|
|
|
}, [onSuccess]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
loading,
|
|
|
|
|
deleteLlm,
|
|
|
|
|
deleteFactory,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 系统默认模型设置
|
2025-10-22 16:32:49 +08:00
|
|
|
export const useSystemModelSetting = (onSuccess?: () => void) => {
|
2025-10-21 16:41:22 +08:00
|
|
|
const dialogState = useDialogState();
|
2025-10-22 11:51:27 +08:00
|
|
|
const showMessage = useMessage();
|
2025-10-21 16:41:22 +08:00
|
|
|
|
2025-10-22 11:51:27 +08:00
|
|
|
const { data: llmList } = useLlmList();
|
|
|
|
|
|
2025-10-22 15:27:31 +08:00
|
|
|
const { tenantInfo, fetchTenantInfo } = useUserData();
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
fetchTenantInfo();
|
|
|
|
|
}, []);
|
|
|
|
|
|
2025-10-22 11:51:27 +08:00
|
|
|
const getOptionsByModelType = useCallback((modelType: LlmModelType) => {
|
|
|
|
|
return Object.entries(llmList)
|
|
|
|
|
.filter(([, value]) =>
|
|
|
|
|
modelType
|
|
|
|
|
? value.some((x) => x.model_type.includes(modelType))
|
|
|
|
|
: true,
|
|
|
|
|
)
|
|
|
|
|
.map(([key, value]) => {
|
|
|
|
|
return {
|
|
|
|
|
label: key,
|
|
|
|
|
options: value
|
|
|
|
|
.filter(
|
|
|
|
|
(x) =>
|
|
|
|
|
(modelType ? x.model_type.includes(modelType) : true) &&
|
|
|
|
|
x.available,
|
|
|
|
|
)
|
|
|
|
|
.map((x) => ({
|
|
|
|
|
label: x.llm_name,
|
|
|
|
|
value: `${x.llm_name}@${x.fid}`,
|
|
|
|
|
disabled: !x.available,
|
|
|
|
|
model: x,
|
|
|
|
|
})),
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
.filter((x) => x.options.length > 0);
|
|
|
|
|
}, [llmList]);
|
|
|
|
|
|
|
|
|
|
const allModelOptions = useMemo(() => {
|
|
|
|
|
const llmOptions = getOptionsByModelType('chat');
|
|
|
|
|
const image2textOptions = getOptionsByModelType('image2text');
|
|
|
|
|
const embeddingOptions = getOptionsByModelType('embedding');
|
|
|
|
|
const speech2textOptions = getOptionsByModelType('speech2text');
|
|
|
|
|
const rerankOptions = getOptionsByModelType('rerank');
|
|
|
|
|
const ttsOptions = getOptionsByModelType('tts');
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
llmOptions,
|
|
|
|
|
image2textOptions,
|
|
|
|
|
embeddingOptions,
|
|
|
|
|
speech2textOptions,
|
|
|
|
|
rerankOptions,
|
|
|
|
|
ttsOptions,
|
|
|
|
|
}
|
|
|
|
|
}, [llmList, getOptionsByModelType]);
|
|
|
|
|
|
|
|
|
|
const submitSystemModelSetting = useCallback(async (data: Partial<ITenantInfo>) => {
|
2025-10-21 16:41:22 +08:00
|
|
|
dialogState.setLoading(true);
|
2025-10-22 15:27:31 +08:00
|
|
|
logger.debug('submitSystemModelSetting data:', data);
|
2025-10-21 16:41:22 +08:00
|
|
|
try {
|
2025-10-22 15:27:31 +08:00
|
|
|
delete data.role;
|
2025-10-21 16:41:22 +08:00
|
|
|
// 这里需要根据实际的 API 接口调整
|
2025-10-22 15:27:31 +08:00
|
|
|
await userService.setTenantInfo({
|
|
|
|
|
...data,
|
|
|
|
|
});
|
2025-10-21 16:41:22 +08:00
|
|
|
showMessage.success('系统默认模型设置成功');
|
|
|
|
|
dialogState.closeDialog();
|
2025-10-22 15:27:31 +08:00
|
|
|
fetchTenantInfo();
|
2025-10-22 16:32:49 +08:00
|
|
|
|
|
|
|
|
// 调用成功回调
|
|
|
|
|
if (onSuccess) {
|
|
|
|
|
onSuccess();
|
|
|
|
|
}
|
2025-10-21 16:41:22 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
logger.error('系统默认模型设置失败:', error);
|
|
|
|
|
showMessage.error('系统默认模型设置失败');
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
dialogState.setLoading(false);
|
|
|
|
|
}
|
2025-10-22 16:32:49 +08:00
|
|
|
}, [dialogState, onSuccess]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...dialogState,
|
|
|
|
|
submitSystemModelSetting,
|
2025-10-22 11:51:27 +08:00
|
|
|
allModelOptions,
|
2025-10-22 15:27:31 +08:00
|
|
|
initialData: tenantInfo,
|
2025-10-21 16:41:22 +08:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 统一的模型对话框管理器
|
2025-10-22 16:32:49 +08:00
|
|
|
export const useModelDialogs = (onSuccess?: () => void) => {
|
|
|
|
|
const apiKeyDialog = useApiKeyDialog(onSuccess);
|
2025-10-21 16:41:22 +08:00
|
|
|
const azureDialog = useAzureOpenAIDialog();
|
|
|
|
|
const bedrockDialog = useBedrockDialog();
|
|
|
|
|
const ollamaDialog = useOllamaDialog();
|
2025-10-24 17:49:25 +08:00
|
|
|
const configurationDialog = useConfigurationDialog(onSuccess);
|
2025-10-22 16:32:49 +08:00
|
|
|
const systemDialog = useSystemModelSetting(onSuccess);
|
|
|
|
|
const deleteOps = useDeleteOperations(onSuccess);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
// 根据工厂类型打开对应的对话框
|
|
|
|
|
const openFactoryDialog = useCallback((factoryName: string, data?: any, isEdit = false) => {
|
2025-10-24 17:49:25 +08:00
|
|
|
// 使用通用的 ConfigurationDialog 替代特定的 Dialog
|
|
|
|
|
configurationDialog.openConfigurationDialog(factoryName, data, isEdit);
|
|
|
|
|
}, [configurationDialog]);
|
2025-10-21 16:41:22 +08:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
apiKeyDialog,
|
|
|
|
|
azureDialog,
|
|
|
|
|
bedrockDialog,
|
|
|
|
|
ollamaDialog,
|
2025-10-24 17:49:25 +08:00
|
|
|
configurationDialog,
|
2025-10-21 16:41:22 +08:00
|
|
|
systemDialog,
|
|
|
|
|
deleteOps,
|
|
|
|
|
openFactoryDialog,
|
|
|
|
|
};
|
|
|
|
|
};
|