Apply review suggestions: use concise `or` pattern for API key
resolution, consolidate tests into parameterized subTest, move
import to module level per PEP 8.
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).
HIGH: Unknown indicator now returns clear error with supported list instead of
silently falling back to technicals() which has a different response structure
MEDIUM: Use _safe_get consistently in get_sentiment_score (was data.get)
MEDIUM: Validate start_date < end_date (return error instead of large API call)
MEDIUM: get_cashflow returns tabular format when available, matching other vendors
MEDIUM: Remove formatting chars from CSV data (no $ or % in values)
HIGH: Remove cachetools fallback — require it directly (it's in requirements.txt)
HIGH: Fix get_global_news — return empty result instead of unfiltered fallback
HIGH: Fail fast if POLARIS_API_KEY not set (no silent 'demo' fallback)
MEDIUM: Merge get_competitors into get_sector_analysis (remove duplication)
MEDIUM: Extract _extract_briefs() and _format_brief_detail() shared helpers
MEDIUM: Add trailing newline to get_news for consistency
MEDIUM: All .get() calls use _safe_get with proper defaults
Fixes all 9 Gemini issues:
- HIGH: get_news/get_global_news now pass start_date/end_date to API
- HIGH: get_sec_filings (renamed from get_insider_transactions) has caching
- MEDIUM: Replaced _get2 duplicate with shared _safe_get at module level
- MEDIUM: _safe_get returns default instead of None (no more 'None' in strings)
- MEDIUM: balance_sheet/cashflow/income_statement now cache formatted results
- MEDIUM: String concatenation replaced with list join pattern throughout
- MEDIUM: _days_to_range helper eliminates range calculation duplication
- MEDIUM: Fallback for unknown indicator types formats dict keys as CSV
New Polaris-exclusive methods:
- get_technicals: 20 indicators + buy/sell signal in one call
- get_competitors: same-sector peers with live price, RSI, sentiment
Adds Polaris Knowledge API as a third data vendor alongside yfinance and
Alpha Vantage. Polaris provides sentiment-scored intelligence, composite
trading signals, and news impact analysis that raw data feeds don't offer.
Implements all existing vendor methods plus 3 Polaris-exclusive methods
(sentiment_score, sector_analysis, news_impact).
Uses cachetools.TTLCache for thread-safe caching, shared financials fetch
to avoid redundant API calls, and polaris-news SDK for all API access.
Tested with real API calls — all functions return valid data.
Addresses #305, #11, #86.
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.
- 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
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
- 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
- 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)
Add _clean_dataframe() to normalize stock DataFrames before stockstats:
coerce invalid dates/prices, drop rows missing Close, fill price gaps.
Also add on_bad_lines="skip" to all cached CSV reads.
LLMs (especially smaller models) sometimes pass multiple indicator
names as a single comma-separated string instead of making separate
tool calls. Split and process each individually at the tool boundary.