Commit Graph

5 Commits

Author SHA1 Message Date
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 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
阳虎 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 54cdb146d0
feat: add footer statistics tracking with LangChain callbacks
- Add StatsCallbackHandler for tracking LLM calls, tool calls, and tokens
- Integrate callbacks into TradingAgentsGraph and all LLM clients
- Dynamic agent/report counts based on selected analysts
- Fix report completion counting (tied to agent completion)
2026-02-03 22:27:20 +00:00
Yijia Xiao 79051580b8
feat: add multi-provider LLM support with factory pattern
- Add tradingagents/llm_clients/ with unified factory pattern
- Support OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama, vLLM
- Replace direct LLM imports in trading_graph.py with create_llm_client()
- Handle provider-specific params (reasoning_effort, thinking_config)
2026-02-03 22:27:20 +00:00