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:
@@ -368,7 +368,7 @@ mod tests {
|
|||||||
# Comment line
|
# Comment line
|
||||||
GOOGLE_GEMINI_BASE_URL=https://example.com
|
GOOGLE_GEMINI_BASE_URL=https://example.com
|
||||||
GEMINI_API_KEY=sk-test123
|
GEMINI_API_KEY=sk-test123
|
||||||
GEMINI_MODEL=gemini-2.5-pro
|
GEMINI_MODEL=gemini-3-pro-preview
|
||||||
|
|
||||||
# Another comment
|
# Another comment
|
||||||
"#;
|
"#;
|
||||||
@@ -381,19 +381,19 @@ GEMINI_MODEL=gemini-2.5-pro
|
|||||||
Some(&"https://example.com".to_string())
|
Some(&"https://example.com".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(map.get("GEMINI_API_KEY"), Some(&"sk-test123".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]
|
#[test]
|
||||||
fn test_serialize_env_file() {
|
fn test_serialize_env_file() {
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
map.insert("GEMINI_API_KEY".to_string(), "sk-test".to_string());
|
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);
|
let content = serialize_env_file(&map);
|
||||||
|
|
||||||
assert!(content.contains("GEMINI_API_KEY=sk-test"));
|
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]
|
#[test]
|
||||||
@@ -417,7 +417,7 @@ GEMINI_MODEL=gemini-2.5-pro
|
|||||||
# Comment line
|
# Comment line
|
||||||
GOOGLE_GEMINI_BASE_URL=https://example.com
|
GOOGLE_GEMINI_BASE_URL=https://example.com
|
||||||
GEMINI_API_KEY=sk-test123
|
GEMINI_API_KEY=sk-test123
|
||||||
GEMINI_MODEL=gemini-2.5-pro
|
GEMINI_MODEL=gemini-3-pro-preview
|
||||||
|
|
||||||
# Another comment
|
# Another comment
|
||||||
"#;
|
"#;
|
||||||
@@ -432,7 +432,7 @@ GEMINI_MODEL=gemini-2.5-pro
|
|||||||
Some(&"https://example.com".to_string())
|
Some(&"https://example.com".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(map.get("GEMINI_API_KEY"), Some(&"sk-test123".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]
|
#[test]
|
||||||
@@ -598,7 +598,7 @@ KEY_WITH-DASH=value";
|
|||||||
let settings = serde_json::json!({
|
let settings = serde_json::json!({
|
||||||
"env": {
|
"env": {
|
||||||
"GEMINI_API_KEY": "sk-test123",
|
"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 的非空配置在基本验证中可以通过(用户稍后填写)
|
// 测试缺少 API Key 的非空配置在基本验证中可以通过(用户稍后填写)
|
||||||
let settings = serde_json::json!({
|
let settings = serde_json::json!({
|
||||||
"env": {
|
"env": {
|
||||||
"GEMINI_MODEL": "gemini-2.5-pro"
|
"GEMINI_MODEL": "gemini-3-pro-preview"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export const GeminiEnvSection: React.FC<GeminiEnvSectionProps> = ({
|
|||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
placeholder={`GOOGLE_GEMINI_BASE_URL=https://your-api-endpoint.com/
|
placeholder={`GOOGLE_GEMINI_BASE_URL=https://your-api-endpoint.com/
|
||||||
GEMINI_API_KEY=sk-your-api-key-here
|
GEMINI_API_KEY=sk-your-api-key-here
|
||||||
GEMINI_MODEL=gemini-2.5-pro`}
|
GEMINI_MODEL=gemini-3-pro-preview`}
|
||||||
rows={6}
|
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]"
|
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"
|
autoComplete="off"
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export function GeminiFormFields({
|
|||||||
id="gemini-model"
|
id="gemini-model"
|
||||||
value={model}
|
value={model}
|
||||||
onChange={(e) => onModelChange(e.target.value)}
|
onChange={(e) => onModelChange(e.target.value)}
|
||||||
placeholder="gemini-2.5-pro"
|
placeholder="gemini-3-pro-preview"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const GEMINI_DEFAULT_CONFIG = JSON.stringify(
|
|||||||
env: {
|
env: {
|
||||||
GOOGLE_GEMINI_BASE_URL: "",
|
GOOGLE_GEMINI_BASE_URL: "",
|
||||||
GEMINI_API_KEY: "",
|
GEMINI_API_KEY: "",
|
||||||
GEMINI_MODEL: "gemini-2.5-pro",
|
GEMINI_MODEL: "gemini-3-pro-preview",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -33,14 +33,11 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
|
|||||||
websiteUrl: "https://ai.google.dev/",
|
websiteUrl: "https://ai.google.dev/",
|
||||||
apiKeyUrl: "https://aistudio.google.com/apikey",
|
apiKeyUrl: "https://aistudio.google.com/apikey",
|
||||||
settingsConfig: {
|
settingsConfig: {
|
||||||
env: {
|
env: {},
|
||||||
GEMINI_MODEL: "gemini-2.5-pro",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
description: "Google 官方 Gemini API (OAuth)",
|
description: "Google 官方 Gemini API (OAuth)",
|
||||||
category: "official",
|
category: "official",
|
||||||
partnerPromotionKey: "google-official",
|
partnerPromotionKey: "google-official",
|
||||||
model: "gemini-2.5-pro",
|
|
||||||
theme: {
|
theme: {
|
||||||
icon: "gemini",
|
icon: "gemini",
|
||||||
backgroundColor: "#4285F4",
|
backgroundColor: "#4285F4",
|
||||||
@@ -54,11 +51,11 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
|
|||||||
settingsConfig: {
|
settingsConfig: {
|
||||||
env: {
|
env: {
|
||||||
GOOGLE_GEMINI_BASE_URL: "https://www.packyapi.com",
|
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",
|
baseURL: "https://www.packyapi.com",
|
||||||
model: "gemini-2.5-pro",
|
model: "gemini-3-pro-preview",
|
||||||
description: "PackyCode",
|
description: "PackyCode",
|
||||||
category: "third_party",
|
category: "third_party",
|
||||||
isPartner: true,
|
isPartner: true,
|
||||||
@@ -74,10 +71,10 @@ export const geminiProviderPresets: GeminiProviderPreset[] = [
|
|||||||
settingsConfig: {
|
settingsConfig: {
|
||||||
env: {
|
env: {
|
||||||
GOOGLE_GEMINI_BASE_URL: "",
|
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 端点",
|
description: "自定义 Gemini API 端点",
|
||||||
category: "custom",
|
category: "custom",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user