From 1fe66f5d394088bcd47a165ab77651e9f77899ba Mon Sep 17 00:00:00 2001 From: Guangdong Liu Date: Tue, 7 May 2024 23:44:30 +0800 Subject: [PATCH] community(patch) fix MoonshotChat moonshot_api_key is invaild for api key (#21361) Description: close https://github.com/langchain-ai/langchain/issues/21237 @baskaryan, @eyurtsev --- libs/community/langchain_community/chat_models/moonshot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/chat_models/moonshot.py b/libs/community/langchain_community/chat_models/moonshot.py index 202a62d8ea1..f16f8ab6d29 100644 --- a/libs/community/langchain_community/chat_models/moonshot.py +++ b/libs/community/langchain_community/chat_models/moonshot.py @@ -42,7 +42,7 @@ class MoonshotChat(MoonshotCommon, ChatOpenAI): # type: ignore[misc] ) client_params = { - "api_key": values["moonshot_api_key"], + "api_key": values["moonshot_api_key"].get_secret_value(), "base_url": values["base_url"] if "base_url" in values else MOONSHOT_SERVICE_URL_BASE,