mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-05-01 14:33:10 +03:00
fix: pass base_url to Google and Anthropic clients for proxy support (#427)
This commit is contained in:
@@ -7,13 +7,9 @@
|
|||||||
|
|
||||||
### 2. ~~Inconsistent parameter handling~~ (Fixed)
|
### 2. ~~Inconsistent parameter handling~~ (Fixed)
|
||||||
- GoogleClient now accepts unified `api_key` and maps it to `google_api_key`
|
- GoogleClient now accepts unified `api_key` and maps it to `google_api_key`
|
||||||
- Legacy `google_api_key` still works for backward compatibility
|
|
||||||
|
|
||||||
### 3. `base_url` accepted but ignored
|
### 3. ~~`base_url` accepted but ignored~~ (Fixed)
|
||||||
- `AnthropicClient`: accepts `base_url` but never uses it
|
- All clients now pass `base_url` to their respective LLM constructors
|
||||||
- `GoogleClient`: accepts `base_url` but never uses it (correct - Google doesn't support it)
|
|
||||||
|
|
||||||
**Fix:** Remove unused `base_url` from clients that don't support it
|
### 4. ~~Update validators.py with models from CLI~~ (Fixed)
|
||||||
|
- Synced in v0.2.2
|
||||||
### 4. Update validators.py with models from CLI
|
|
||||||
- Sync `VALID_MODELS` dict with CLI model options after Feature 2 is complete
|
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ class AnthropicClient(BaseLLMClient):
|
|||||||
"""Return configured ChatAnthropic instance."""
|
"""Return configured ChatAnthropic instance."""
|
||||||
llm_kwargs = {"model": self.model}
|
llm_kwargs = {"model": self.model}
|
||||||
|
|
||||||
|
if self.base_url:
|
||||||
|
llm_kwargs["base_url"] = self.base_url
|
||||||
|
|
||||||
for key in _PASSTHROUGH_KWARGS:
|
for key in _PASSTHROUGH_KWARGS:
|
||||||
if key in self.kwargs:
|
if key in self.kwargs:
|
||||||
llm_kwargs[key] = self.kwargs[key]
|
llm_kwargs[key] = self.kwargs[key]
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ class GoogleClient(BaseLLMClient):
|
|||||||
"""Return configured ChatGoogleGenerativeAI instance."""
|
"""Return configured ChatGoogleGenerativeAI instance."""
|
||||||
llm_kwargs = {"model": self.model}
|
llm_kwargs = {"model": self.model}
|
||||||
|
|
||||||
|
if self.base_url:
|
||||||
|
llm_kwargs["base_url"] = self.base_url
|
||||||
|
|
||||||
for key in ("timeout", "max_retries", "callbacks", "http_client", "http_async_client"):
|
for key in ("timeout", "max_retries", "callbacks", "http_client", "http_async_client"):
|
||||||
if key in self.kwargs:
|
if key in self.kwargs:
|
||||||
llm_kwargs[key] = self.kwargs[key]
|
llm_kwargs[key] = self.kwargs[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user