This commit is contained in:
sheiy 2026-04-19 19:09:34 +08:00 committed by GitHub
commit d592ca8c1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 243 additions and 1545 deletions

View File

@ -136,7 +136,9 @@ docker compose --profile ollama run --rm tradingagents-ollama
TradingAgents supports multiple LLM providers. Set the API key for your chosen provider:
```bash
export OPENAI_API_KEY=... # OpenAI (GPT)
export OPENAI_BASE_URL=... # OpenAI (GPT) or OpenaiCompatible
export OPENAI_API_KEY=... # OpenAI (GPT) or OpenaiCompatible
export NVIDIA_API_KEY=... # Nvidia
export GOOGLE_API_KEY=... # Google (Gemini)
export ANTHROPIC_API_KEY=... # Anthropic (Claude)
export XAI_API_KEY=... # xAI (Grok)

View File

@ -1,4 +1,5 @@
import questionary
import os
from typing import List, Optional, Tuple, Dict
from rich.console import Console
@ -242,6 +243,8 @@ def select_llm_provider() -> tuple[str, str | None]:
("OpenRouter", "openrouter", "https://openrouter.ai/api/v1"),
("Azure OpenAI", "azure", None),
("Ollama", "ollama", "http://localhost:11434/v1"),
("Nvidia", "nvidia", "https://integrate.api.nvidia.com/v1"),
("OpenAICompatible", "openaicompatible", os.environ.get("OPENAI_BASE_URL","https://api.openai.com/v1")),
]
choice = questionary.select(

View File

@ -8,7 +8,7 @@ from .azure_client import AzureOpenAIClient
# Providers that use the OpenAI-compatible chat completions API
_OPENAI_COMPATIBLE = (
"openai", "xai", "deepseek", "qwen", "glm", "ollama", "openrouter",
"openai", "xai", "deepseek", "qwen", "glm", "ollama", "openrouter", "nvidia", "openaicompatible",
)

View File

@ -99,6 +99,22 @@ MODEL_OPTIONS: ProviderModeOptions = {
("Custom model ID", "custom"),
],
},
"nvidia": {
"quick": [
("Custom model ID", "custom"),
],
"deep": [
("Custom model ID", "custom"),
],
},
"openaicompatible": {
"quick": [
("Custom model ID", "custom"),
],
"deep": [
("Custom model ID", "custom"),
],
},
# OpenRouter: fetched dynamically. Azure: any deployed model name.
"ollama": {
"quick": [

View File

@ -32,6 +32,8 @@ _PROVIDER_CONFIG = {
"glm": ("https://api.z.ai/api/paas/v4/", "ZHIPU_API_KEY"),
"openrouter": ("https://openrouter.ai/api/v1", "OPENROUTER_API_KEY"),
"ollama": ("http://localhost:11434/v1", None),
"nvidia": ("https://integrate.api.nvidia.com/v1", "NVIDIA_API_KEY"),
"openaicompatible": (os.environ.get("OPENAI_BASE_URL","https://api.openai.com/v1"), "OPENAI_API_KEY"),
}

1761
uv.lock

File diff suppressed because it is too large Load Diff