add: 更新Gemini模型列表,添加 gemini3.0
fix: 修复提供商池配置路径默认值及参数传递问题 设置默认的提供商池配置文件路径为'provider_pools.json' 移除前端提供商池菜单显示控制逻辑 更新Gemini模型列表,添加 gemini3.0
This commit is contained in:
parent
ed9d7e2106
commit
9b5b5810e3
4 changed files with 14 additions and 11 deletions
|
|
@ -85,7 +85,7 @@ export async function initializeConfig(args = process.argv.slice(2), configFileP
|
|||
REQUEST_BASE_DELAY: 1000,
|
||||
CRON_NEAR_MINUTES: 15,
|
||||
CRON_REFRESH_TOKEN: false,
|
||||
PROVIDER_POOLS_FILE_PATH: '', // 新增号池配置文件路径
|
||||
PROVIDER_POOLS_FILE_PATH: 'provider_pools.json', // 新增号池配置文件路径
|
||||
MAX_ERROR_COUNT: 3 // 提供商最大错误次数
|
||||
};
|
||||
console.log('[Config] Using default configuration.');
|
||||
|
|
@ -270,6 +270,9 @@ export async function initializeConfig(args = process.argv.slice(2), configFileP
|
|||
currentConfig.SYSTEM_PROMPT_CONTENT = await getSystemPromptFileContent(currentConfig.SYSTEM_PROMPT_FILE_PATH);
|
||||
|
||||
// 加载号池配置
|
||||
if (!currentConfig.PROVIDER_POOLS_FILE_PATH) {
|
||||
currentConfig.PROVIDER_POOLS_FILE_PATH = 'provider_pools.json';
|
||||
}
|
||||
if (currentConfig.PROVIDER_POOLS_FILE_PATH) {
|
||||
try {
|
||||
const poolsData = await pfs.readFile(currentConfig.PROVIDER_POOLS_FILE_PATH, 'utf8');
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const CODE_ASSIST_ENDPOINT = 'https://cloudcode-pa.googleapis.com';
|
|||
const CODE_ASSIST_API_VERSION = 'v1internal';
|
||||
const OAUTH_CLIENT_ID = '681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com';
|
||||
const OAUTH_CLIENT_SECRET = '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';
|
||||
const GEMINI_MODELS = ['gemini-2.5-flash', 'gemini-2.5-flash-lite', 'gemini-2.5-pro' , 'gemini-2.5-pro-preview-06-05', 'gemini-2.5-flash-preview-09-2025', 'gemini-3-pro-preview-11-2025'];
|
||||
const GEMINI_MODELS = ['gemini-2.5-flash', 'gemini-2.5-flash-lite', 'gemini-2.5-pro' , 'gemini-2.5-pro-preview-06-05', 'gemini-2.5-flash-preview-09-2025', 'gemini-3-pro-preview'];
|
||||
const ANTI_TRUNCATION_MODELS = GEMINI_MODELS.map(model => `anti-${model}`);
|
||||
|
||||
function is_anti_truncation_model(model) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ async function loadConfiguration() {
|
|||
if (requestBaseDelayEl) requestBaseDelayEl.value = data.REQUEST_BASE_DELAY || 1000;
|
||||
if (cronNearMinutesEl) cronNearMinutesEl.value = data.CRON_NEAR_MINUTES || 1;
|
||||
if (cronRefreshTokenEl) cronRefreshTokenEl.checked = data.CRON_REFRESH_TOKEN || false;
|
||||
if (providerPoolsFilePathEl) providerPoolsFilePathEl.value = data.PROVIDER_POOLS_FILE_PATH || '';
|
||||
if (providerPoolsFilePathEl) providerPoolsFilePathEl.value = data.PROVIDER_POOLS_FILE_PATH || 'provider_pools.json';
|
||||
if (maxErrorCountEl) maxErrorCountEl.value = data.MAX_ERROR_COUNT || 3;
|
||||
|
||||
// 触发提供商配置显示
|
||||
|
|
@ -108,13 +108,13 @@ async function loadConfiguration() {
|
|||
}
|
||||
|
||||
// 检查并设置提供商池菜单显示状态
|
||||
const providerPoolsFilePath = data.PROVIDER_POOLS_FILE_PATH;
|
||||
const providersMenuItem = document.querySelector('.nav-item[data-section="providers"]');
|
||||
if (providerPoolsFilePath && providerPoolsFilePath.trim() !== '') {
|
||||
if (providersMenuItem) providersMenuItem.style.display = 'flex';
|
||||
} else {
|
||||
if (providersMenuItem) providersMenuItem.style.display = 'none';
|
||||
}
|
||||
// const providerPoolsFilePath = data.PROVIDER_POOLS_FILE_PATH;
|
||||
// const providersMenuItem = document.querySelector('.nav-item[data-section="providers"]');
|
||||
// if (providerPoolsFilePath && providerPoolsFilePath.trim() !== '') {
|
||||
// if (providersMenuItem) providersMenuItem.style.display = 'flex';
|
||||
// } else {
|
||||
// if (providersMenuItem) providersMenuItem.style.display = 'none';
|
||||
// }
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to load configuration:', error);
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@
|
|||
|
||||
<div class="form-group pool-section">
|
||||
<label for="providerPoolsFilePath">提供商池配置文件路径</label>
|
||||
<input type="text" id="providerPoolsFilePath" class="form-control" value="" placeholder="例如: provider_pools.json">
|
||||
<input type="text" id="providerPoolsFilePath" class="form-control" value="provider_pools.json" placeholder="例如: provider_pools.json">
|
||||
<small class="form-text">配置了提供商池后,可在提供商池管理中查看详细信息</small>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue