feat: update Gemini default model and remove Google Official preset model

Updated default model from gemini-2.5-pro to gemini-3-pro-preview across:
- Provider presets (PackyCode, Custom)
- Form field placeholders
- Default configurations
- Test cases

Google Official preset now has empty env config, allowing users to choose
their own model or use application defaults, which is more appropriate for
OAuth-based authentication.

Changes:
- geminiProviderPresets.ts: updated model to gemini-3-pro-preview, removed model from Google Official
- GeminiFormFields.tsx: updated placeholder to gemini-3-pro-preview
- GeminiConfigSections.tsx: updated placeholder to gemini-3-pro-preview
- ProviderForm.tsx: updated default config to gemini-3-pro-preview
- gemini_config.rs: updated test examples to gemini-3-pro-preview
This commit is contained in:
farion1231
2025-11-19 10:53:33 +08:00
parent 00e3e6fa70
commit bb0951552d
5 changed files with 16 additions and 19 deletions

View File

@@ -368,7 +368,7 @@ mod tests {
# Comment line
GOOGLE_GEMINI_BASE_URL=https://example.com
GEMINI_API_KEY=sk-test123
GEMINI_MODEL=gemini-2.5-pro
GEMINI_MODEL=gemini-3-pro-preview
# Another comment
"#;
@@ -381,19 +381,19 @@ GEMINI_MODEL=gemini-2.5-pro
Some(&"https://example.com".to_string())
);
assert_eq!(map.get("GEMINI_API_KEY"), Some(&"sk-test123".to_string()));
assert_eq!(map.get("GEMINI_MODEL"), Some(&"gemini-2.5-pro".to_string()));
assert_eq!(map.get("GEMINI_MODEL"), Some(&"gemini-3-pro-preview".to_string()));
}
#[test]
fn test_serialize_env_file() {
let mut map = HashMap::new();
map.insert("GEMINI_API_KEY".to_string(), "sk-test".to_string());
map.insert("GEMINI_MODEL".to_string(), "gemini-2.5-pro".to_string());
map.insert("GEMINI_MODEL".to_string(), "gemini-3-pro-preview".to_string());
let content = serialize_env_file(&map);
assert!(content.contains("GEMINI_API_KEY=sk-test"));
assert!(content.contains("GEMINI_MODEL=gemini-2.5-pro"));
assert!(content.contains("GEMINI_MODEL=gemini-3-pro-preview"));
}
#[test]
@@ -417,7 +417,7 @@ GEMINI_MODEL=gemini-2.5-pro
# Comment line
GOOGLE_GEMINI_BASE_URL=https://example.com
GEMINI_API_KEY=sk-test123
GEMINI_MODEL=gemini-2.5-pro
GEMINI_MODEL=gemini-3-pro-preview
# Another comment
"#;
@@ -432,7 +432,7 @@ GEMINI_MODEL=gemini-2.5-pro
Some(&"https://example.com".to_string())
);
assert_eq!(map.get("GEMINI_API_KEY"), Some(&"sk-test123".to_string()));
assert_eq!(map.get("GEMINI_MODEL"), Some(&"gemini-2.5-pro".to_string()));
assert_eq!(map.get("GEMINI_MODEL"), Some(&"gemini-3-pro-preview".to_string()));
}
#[test]
@@ -598,7 +598,7 @@ KEY_WITH-DASH=value";
let settings = serde_json::json!({
"env": {
"GEMINI_API_KEY": "sk-test123",
"GEMINI_MODEL": "gemini-2.5-pro"
"GEMINI_MODEL": "gemini-3-pro-preview"
}
});
@@ -611,7 +611,7 @@ KEY_WITH-DASH=value";
// 测试缺少 API Key 的非空配置在基本验证中可以通过(用户稍后填写)
let settings = serde_json::json!({
"env": {
"GEMINI_MODEL": "gemini-2.5-pro"
"GEMINI_MODEL": "gemini-3-pro-preview"
}
});

View File

@@ -61,7 +61,7 @@ export const GeminiEnvSection: React.FC<GeminiEnvSectionProps> = ({
onBlur={onBlur}
placeholder={`GOOGLE_GEMINI_BASE_URL=https://your-api-endpoint.com/
GEMINI_API_KEY=sk-your-api-key-here
GEMINI_MODEL=gemini-2.5-pro`}
GEMINI_MODEL=gemini-3-pro-preview`}
rows={6}
className="w-full px-3 py-2 border border-border-default dark:bg-gray-800 dark:text-gray-100 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 transition-colors resize-y min-h-[8rem]"
autoComplete="off"

View File

@@ -127,7 +127,7 @@ export function GeminiFormFields({
id="gemini-model"
value={model}
onChange={(e) => onModelChange(e.target.value)}
placeholder="gemini-2.5-pro"
placeholder="gemini-3-pro-preview"
/>
</div>
)}

View File

@@ -53,7 +53,7 @@ const GEMINI_DEFAULT_CONFIG = JSON.stringify(
env: {
GOOGLE_GEMINI_BASE_URL: "",
GEMINI_API_KEY: "",
GEMINI_MODEL: "gemini-2.5-pro",
GEMINI_MODEL: "gemini-3-pro-preview",
},
},
null,

View File

@@ -33,14 +33,11 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
websiteUrl: "https://ai.google.dev/",
apiKeyUrl: "https://aistudio.google.com/apikey",
settingsConfig: {
env: {
GEMINI_MODEL: "gemini-2.5-pro",
},
env: {},
},
description: "Google 官方 Gemini API (OAuth)",
category: "official",
partnerPromotionKey: "google-official",
model: "gemini-2.5-pro",
theme: {
icon: "gemini",
backgroundColor: "#4285F4",
@@ -54,11 +51,11 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
settingsConfig: {
env: {
GOOGLE_GEMINI_BASE_URL: "https://www.packyapi.com",
GEMINI_MODEL: "gemini-2.5-pro",
GEMINI_MODEL: "gemini-3-pro-preview",
},
},
baseURL: "https://www.packyapi.com",
model: "gemini-2.5-pro",
model: "gemini-3-pro-preview",
description: "PackyCode",
category: "third_party",
isPartner: true,
@@ -74,10 +71,10 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
settingsConfig: {
env: {
GOOGLE_GEMINI_BASE_URL: "",
GEMINI_MODEL: "gemini-2.5-pro",
GEMINI_MODEL: "gemini-3-pro-preview",
},
},
model: "gemini-2.5-pro",
model: "gemini-3-pro-preview",
description: "自定义 Gemini API 端点",
category: "custom",
},