From 08638ccc88cc4c8dfd2f2ca88a79e15928fe764a Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 11 Jul 2024 12:24:26 -0400 Subject: [PATCH] community[patch]: QianfanLLMEndpoint fix type information for the keys (#24128) Fix for issue: https://github.com/langchain-ai/langchain/issues/24126 --- .../langchain_community/llms/baidu_qianfan_endpoint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/community/langchain_community/llms/baidu_qianfan_endpoint.py b/libs/community/langchain_community/llms/baidu_qianfan_endpoint.py index 4d091f0614c..34b5e00ea79 100644 --- a/libs/community/langchain_community/llms/baidu_qianfan_endpoint.py +++ b/libs/community/langchain_community/llms/baidu_qianfan_endpoint.py @@ -16,7 +16,7 @@ from langchain_core.callbacks import ( ) from langchain_core.language_models.llms import LLM from langchain_core.outputs import GenerationChunk -from langchain_core.pydantic_v1 import Field +from langchain_core.pydantic_v1 import Field, SecretStr from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env, pre_init logger = logging.getLogger(__name__) @@ -49,8 +49,8 @@ class QianfanLLMEndpoint(LLM): client: Any - qianfan_ak: Optional[str] = None - qianfan_sk: Optional[str] = None + qianfan_ak: Optional[SecretStr] = None + qianfan_sk: Optional[SecretStr] = None streaming: Optional[bool] = False """Whether to stream the results or not."""