增加 openai 的模型兼容

This commit is contained in:
jwangkun
2026-01-08 17:09:34 +08:00
parent 6558006a4d
commit 579071ac95
18 changed files with 5185 additions and 212 deletions

View File

@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { getAI } from '../api';
import { getAI, getAIProvider, findCustomModel } from '../api';
import { getThinkingBudget } from '../config';
import { AppConfig, ModelOption, ExpertResult, ChatMessage } from '../types';
@@ -99,9 +99,13 @@ export const useDeepThink = () => {
setProcessStartTime(Date.now());
setProcessEndTime(null);
const provider = getAIProvider(model);
const customModelConfig = findCustomModel(model, config.customModels);
const ai = getAI({
apiKey: config.enableCustomApi ? config.customApiKey : undefined,
baseUrl: (config.enableCustomApi && config.customBaseUrl) ? config.customBaseUrl : undefined
provider,
apiKey: customModelConfig?.apiKey || config.customApiKey,
baseUrl: customModelConfig?.baseUrl || config.customBaseUrl
});
try {