mirror of
https://github.com/farcasclaudiu/TradingAgents.git
synced 2026-06-22 07:01:21 +03:00
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.
This commit is contained in:
@@ -32,10 +32,9 @@ class GoogleClient(BaseLLMClient):
|
||||
llm_kwargs[key] = self.kwargs[key]
|
||||
|
||||
# Unified api_key maps to provider-specific google_api_key
|
||||
if "api_key" in self.kwargs:
|
||||
llm_kwargs["google_api_key"] = self.kwargs["api_key"]
|
||||
elif "google_api_key" in self.kwargs:
|
||||
llm_kwargs["google_api_key"] = self.kwargs["google_api_key"]
|
||||
google_api_key = self.kwargs.get("api_key") or self.kwargs.get("google_api_key")
|
||||
if google_api_key:
|
||||
llm_kwargs["google_api_key"] = google_api_key
|
||||
|
||||
# Map thinking_level to appropriate API param based on model
|
||||
# Gemini 3 Pro: low, high
|
||||
|
||||
Reference in New Issue
Block a user