This commit is contained in:
MarkLo 2025-12-07 03:54:52 +08:00
parent 43658df2a0
commit 915ee9915c
4 changed files with 14 additions and 5 deletions

View File

@ -61,7 +61,7 @@ TradingAgentsX 支援業界領先的多家 LLM 提供商,並為每個模型配
| ------------------ | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | ---------------- |
| **OpenAI** | GPT-5.1, GPT-5 Mini/Nano, GPT-4.1 Mini/Nano, o4-mini | `https://api.openai.com/v1` | ✅ 是 |
| **Anthropic** | Claude Haiku 4.5, Claude Sonnet 4.5/4.0, Claude 3.5 Haiku, Claude 3 Haiku | `https://api.anthropic.com` | ✅ 是 |
| **Gemini** | Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash Lite, Gemini 2.0 Flash, Gemini 2.0 Flash Lite | `https://generativelanguage.googleapis.com/v1beta/openai` | ✅ 是 |
| **Gemini** | Gemini 3 Pro Preview, Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash Lite, Gemini 2.0 Flash, Gemini 2.0 Flash Lite | `https://generativelanguage.googleapis.com/v1beta/openai` | ✅ 是 |
| **Grok (xAI)** | Grok-4.1 Fast, Grok-4 Fast, Grok-4, Grok-3, Grok-3 Mini | `https://api.x.ai/v1` | ✅ 是 |
| **DeepSeek** | DeepSeek Reasoner, DeepSeek Chat | `https://api.deepseek.com/v1` | ✅ 是 |
| **Qwen (Alibaba)** | Qwen3-Max, Qwen-Plus, Qwen Flash | `https://dashscope-intl.aliyuncs.com/compatible-mode/v1` | ✅ 是 |

View File

@ -210,6 +210,7 @@ class TradingService:
"claude-3-5-haiku-20241022",
"claude-3-haiku-20240307",
# Google
"gemini-3-pro-preview",
"gemini-2.5-pro",
"gemini-2.5-flash",
"gemini-2.5-flash-lite",

View File

@ -216,7 +216,7 @@ export default function HomePage() {
/>
<LLMProviderCard
name="Google Gemini"
models={["Gemini 2.5 Pro/Flash", "Gemini 2.0 Flash"]}
models={["Gemini 3 Pro Preview", "Gemini 2.5 Pro/Flash", "Gemini 2.0 Flash"]}
icon="🔵"
/>
<LLMProviderCard

View File

@ -108,10 +108,11 @@ export function AnalysisForm({ onSubmit, loading = false }: AnalysisFormProps) {
});
// Load API settings from localStorage and update when models change
const quickThinkLlm = form.watch("quick_think_llm");
const deepThinkLlm = form.watch("deep_think_llm");
useEffect(() => {
const savedSettings = getApiSettings();
const quickThinkLlm = form.getValues("quick_think_llm");
const deepThinkLlm = form.getValues("deep_think_llm");
// Set base URLs based on selected models (custom URL takes precedence)
form.setValue("quick_think_base_url", getBaseUrlForModel(quickThinkLlm, savedSettings.custom_base_url));
@ -123,7 +124,8 @@ export function AnalysisForm({ onSubmit, loading = false }: AnalysisFormProps) {
form.setValue("deep_think_api_key", getApiKeyForModel(deepThinkLlm, savedSettings));
form.setValue("embedding_api_key", savedSettings.custom_api_key || savedSettings.openai_api_key);
form.setValue("alpha_vantage_api_key", savedSettings.alpha_vantage_api_key);
}, [form, form.watch("quick_think_llm"), form.watch("deep_think_llm")]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [quickThinkLlm, deepThinkLlm]);
// 全選/取消全選
const toggleSelectAll = () => {
@ -355,6 +357,9 @@ export function AnalysisForm({ onSubmit, loading = false }: AnalysisFormProps) {
</SelectItem>
{/* Google */}
<SelectItem value="gemini-3-pro-preview">
Google: Gemini 3 Pro Preview
</SelectItem>
<SelectItem value="gemini-2.5-pro">
Google: Gemini 2.5 Pro
</SelectItem>
@ -466,6 +471,9 @@ export function AnalysisForm({ onSubmit, loading = false }: AnalysisFormProps) {
</SelectItem>
{/* Google */}
<SelectItem value="gemini-3-pro-preview">
Google: Gemini 3 Pro Preview
</SelectItem>
<SelectItem value="gemini-2.5-pro">
Google: Gemini 2.5 Pro
</SelectItem>