From 978db49f5d176199587229b302a593cb45dd59b9 Mon Sep 17 00:00:00 2001 From: Yudi Hertanto Date: Wed, 25 Mar 2026 14:44:30 +0700 Subject: [PATCH] Update tradingagents/llm_clients/zai_client.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- tradingagents/llm_clients/zai_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tradingagents/llm_clients/zai_client.py b/tradingagents/llm_clients/zai_client.py index 40355bfd..c7877fda 100644 --- a/tradingagents/llm_clients/zai_client.py +++ b/tradingagents/llm_clients/zai_client.py @@ -22,14 +22,16 @@ class ZAIClient(BaseLLMClient): "base_url": self.base_url or self.DEFAULT_BASE_URL, } - api_key = os.environ.get("ZAI_API_KEY") + api_key = self.kwargs.get("api_key") + if api_key is None: + api_key = os.environ.get("ZAI_API_KEY") + if api_key: llm_kwargs["api_key"] = api_key for key in ( "timeout", "max_retries", - "api_key", "callbacks", "http_client", "http_async_client",