Commit Graph

148 Commits

Author SHA1 Message Date
Michael Liu afdd7abaff
Merge branch 'main' into copilot_oauth 2026-03-31 13:23:37 +01:00
Yijia-Xiao 4641c03340
TradingAgents v0.2.3 2026-03-29 19:50:46 +00:00
Yijia-Xiao e75d17bc51
chore: update model lists and defaults to GPT-5.4 family 2026-03-29 19:45:36 +00:00
Yijia-Xiao 6cddd26d6e
feat: multi-language output support for analyst reports and final decision (#472) 2026-03-29 19:19:01 +00:00
Yijia Xiao c61242a28c
Merge pull request #464 from CadeYu/sync-validator-models
sync model validation with cli catalog
2026-03-29 11:07:51 -07:00
Yijia-Xiao 58e99421bd
fix: pass base_url to Google and Anthropic clients for proxy support (#427) 2026-03-29 17:59:52 +00:00
Yijia Xiao 46e1b600b8
Merge pull request #453 from javierdejesusda/fix/standardize-google-api-key
fix(llm_clients): standardize Google API key to unified api_key param
2026-03-29 10:54:28 -07:00
Yijia-Xiao ae8c8aebe8
fix: gracefully handle invalid indicator names in tool calls (#429) 2026-03-29 17:50:30 +00:00
Yijia-Xiao f3f58bdbdc
fix: add yf_retry to yfinance news fetchers (#445) 2026-03-29 17:42:24 +00:00
Yijia-Xiao e1113880a1
fix: prevent look-ahead bias in backtesting data fetchers (#475) 2026-03-29 17:34:35 +00:00
CadeYu bd6a5b75b5 fix model catalog typing and known-model helper 2026-03-25 21:46:56 +08:00
CadeYu 8793336dad sync model validation with cli catalog 2026-03-25 21:23:02 +08:00
javierdejesusda 047b38971c refactor: simplify api_key mapping and consolidate tests
Apply review suggestions: use concise `or` pattern for API key
resolution, consolidate tests into parameterized subTest, move
import to module level per PEP 8.
2026-03-24 14:52:51 +01:00
javierdejesusda f5026009f9 fix(llm_clients): standardize Google API key to unified api_key param
GoogleClient now accepts the unified `api_key` parameter used by
OpenAI and Anthropic clients, mapping it to the provider-specific
`google_api_key` that ChatGoogleGenerativeAI expects. Legacy
`google_api_key` still works for backward compatibility.

Resolves TODO.md item #2 (inconsistent parameter handling).
2026-03-24 14:35:02 +01:00
Jiaxu Liu 57a2ae5438 patched the Copilot client to sanitize malformed usage metadata before langchain_openai processes it 2026-03-23 15:46:04 +00:00
Michael Liu 1cb6d4e882
Update tradingagents/llm_clients/copilot_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 15:38:28 +00:00
Michael Liu 6d3b19d705
Update cli/utils.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 15:38:10 +00:00
Michael Liu b0754b3e39
Update tradingagents/llm_clients/copilot_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 15:37:36 +00:00
Jiaxu Liu 7064884b4f removed the duplicate _resolve_model_options definition from utils.py (line 137), leaving the original helper in place and keeping all callers unchanged 2026-03-23 15:20:15 +00:00
Michael Liu d38d5e2ecb
Update tradingagents/llm_clients/copilot_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 15:19:04 +00:00
Jiaxu Liu ab1b2883ad update 2026-03-23 14:58:53 +00:00
Michael Liu e76a6742be
Update tradingagents/llm_clients/copilot_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 14:52:49 +00:00
Michael Liu ee1c3a69ee
Update tradingagents/llm_clients/copilot_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 14:52:40 +00:00
Michael Liu e0b7fed7f4
Update cli/utils.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 14:52:33 +00:00
Michael Liu 706e6bf3a9
Update cli/utils.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 14:52:09 +00:00
Jiaxu Liu 902ad8b932 refactor: extract _resolve_model_options() to remove duplicated logic
Both select_shallow_thinking_agent and select_deep_thinking_agent had
identical Copilot/static model resolution blocks. Extract into a single
helper to improve maintainability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 14:47:20 +00:00
Jiaxu Liu d6ef3c5d4d fix: raise explicit error when gh token is missing in CopilotClient
Replace the 'copilot' fallback string with a RuntimeError so users get
a clear message instead of a cryptic auth failure from the API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 14:46:25 +00:00
Jiaxu Liu 6d53f33df0 fix: verify Copilot subscription access after gh auth login
After a successful gh auth login, call check_copilot_auth() to confirm
the new token actually has Copilot access — not just that a token exists.
Prevents proceeding with an account that has no Copilot subscription.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 14:45:33 +00:00
Jiaxu Liu fcca3236e9 update 2026-03-23 14:12:01 +00:00
Jiaxu Liu a84c69e42f update 2026-03-23 14:03:27 +00:00
Jiaxu Liu 894b7bcba0 update 2026-03-23 14:01:30 +00:00
Jiaxu Liu 888fdfbfb9 refactor: move Copilot logic into standalone copilot_client.py
- Add tradingagents/llm_clients/copilot_client.py with all Copilot auth
  (gh CLI token, GraphQL URL resolution, required headers) and CopilotClient
  class inline — no separate auth module needed
- Simplify openai_client.py: remove Copilot code, inline codex OAuth token
  logic directly (was tradingagents/auth/codex_token.py)
- Remove tradingagents/auth/ folder entirely
- Update factory.py to route 'copilot' -> CopilotClient
- Simplify cli/utils.py to delegate to copilot_client helpers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 13:59:09 +00:00
Jiaxu Liu 24e97fb703 fix: use Responses API for Copilot models that don't support chat/completions
gpt-5.4, gpt-5.4-mini, and codex variants only support /responses,
not /chat/completions on the Copilot endpoint. Auto-detect and set
use_responses_api=True for these models.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 13:50:55 +00:00
Jiaxu Liu d8ac212253 feat: add GitHub Copilot provider with OAuth auth via gh CLI
Replace GitHub Models (models.github.ai) with GitHub Copilot inference API
(api.individual.githubcopilot.com). Auth uses gh CLI token with required
Copilot headers (Copilot-Integration-Id, X-GitHub-Api-Version).

- Add tradingagents/auth/ module: gh token retrieval, Copilot URL resolution
  via GraphQL, Codex OAuth token with auto-refresh
- Add "copilot" provider to OpenAIClient with dynamic base URL and headers
- Add live model listing from Copilot /models endpoint (27 models)
- Add perform_copilot_oauth() with Copilot access verification
- Remove all GitHub Models (models.github.ai) references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 13:18:55 +00:00
Yijia-Xiao 589b351f2a
TradingAgents v0.2.2 2026-03-22 23:47:56 +00:00
Yijia-Xiao 6c9c9ce1fd
fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
Yijia-Xiao b8b2825783 refactor: standardize portfolio manager, five-tier rating scale, fix analyst status tracking 2026-03-22 23:30:29 +00:00
Yijia-Xiao 318adda0c6 refactor: five-tier rating scale and streamlined agent prompts 2026-03-22 23:07:20 +00:00
Yijia Xiao c3ba3bf428
Merge pull request #413 from CadeYu/codex/exchange-qualified-tickers
fix: preserve exchange-qualified tickers across agent prompts
2026-03-22 15:36:14 -07:00
Yijia-Xiao 7cca9c924e fix: add exponential backoff retry for yfinance rate limits (#426) 2026-03-22 22:11:08 +00:00
Yijia-Xiao bd9b1e5efa feat: add Anthropic effort level support for Claude models
Add effort parameter (high/medium/low) for Claude 4.5+ and 4.6 models,
consistent with OpenAI reasoning_effort and Google thinking_level.
Also add content normalization for Anthropic responses.
2026-03-22 21:57:05 +00:00
Yijia-Xiao 77755f0431 chore: consolidate install, fix CLI portability, normalize LLM responses
- Point requirements.txt to pyproject.toml as single source of truth
- Resolve welcome.txt path relative to module for CLI portability
- Include cli/static files in package build
- Extract shared normalize_content for OpenAI Responses API and
  Gemini 3 list-format responses into base_client.py
- Update README install and CLI usage instructions
2026-03-22 21:38:01 +00:00
Yijia-Xiao 0b13145dc0 fix: handle list content when writing report sections
Closes #400
2026-03-22 20:40:18 +00:00
Yijia-Xiao 3ff28f3559 fix: use OpenAI Responses API for native models
Enable use_responses_api for native OpenAI provider, which supports
reasoning_effort with function tools across all model families.
Removes the UnifiedChatOpenAI subclass workaround.

Closes #403
2026-03-22 20:34:03 +00:00
CadeYu 7d200d834a style: inline single-use instrument context vars 2026-03-21 21:31:38 +08:00
CadeYu 08bfe70a69 fix: preserve exchange-qualified tickers across agent prompts 2026-03-21 21:10:13 +08:00
Yijia Xiao f362a160c3
Merge pull request #379 from yang1002378395-cmyk/fix-ssl-http-client-support
fix: add http_client support for SSL certificate customization
2026-03-15 16:53:04 -07:00
阳虎 64f07671b9 fix: add http_client support for SSL certificate customization
- Add http_client and http_async_client parameters to all LLM clients
- OpenAIClient, GoogleClient, AnthropicClient now support custom httpx clients
- Fixes SSL certificate verification errors on Windows Conda environments
- Users can now pass custom httpx.Client with verify=False or custom certs

Fixes #369
2026-03-16 07:41:20 +08:00
Yijia-Xiao b19c5c18fb docs: add v0.2.1 release note to README 2026-03-15 23:39:05 +00:00
Yijia-Xiao 551fd7f074 chore: update model lists, bump to v0.2.1, fix package build
- OpenAI: add GPT-5.4, GPT-5.4 Pro; remove o-series and legacy GPT-4o
- Anthropic: add Claude Opus 4.6, Sonnet 4.6; remove legacy 4.1/4.0/3.x
- Google: add Gemini 3.1 Pro, 3.1 Flash Lite; remove deprecated
  gemini-3-pro-preview and Gemini 2.0 series
- xAI: clean up model list to match current API
- Simplify UnifiedChatOpenAI GPT-5 temperature handling
- Add missing tradingagents/__init__.py (fixes pip install building)
2026-03-15 23:34:50 +00:00