From 64be7e89872b1ea74cfa180aaf880782eb8cc3e6 Mon Sep 17 00:00:00 2001 From: chenzimin Date: Wed, 13 Nov 2024 21:07:46 +0100 Subject: [PATCH] Remove all other keys and add api_key, since litellm only uses api_key --- libs/community/langchain_community/chat_models/litellm.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libs/community/langchain_community/chat_models/litellm.py b/libs/community/langchain_community/chat_models/litellm.py index d6c95573398573..75be5897410ab3 100644 --- a/libs/community/langchain_community/chat_models/litellm.py +++ b/libs/community/langchain_community/chat_models/litellm.py @@ -219,12 +219,7 @@ class ChatLiteLLM(BaseChatModel): model: str = "gpt-3.5-turbo" model_name: Optional[str] = None """Model name to use.""" - openai_api_key: Optional[str] = None - azure_api_key: Optional[str] = None - anthropic_api_key: Optional[str] = None - replicate_api_key: Optional[str] = None - cohere_api_key: Optional[str] = None - openrouter_api_key: Optional[str] = None + api_key: Optional[str] = None streaming: bool = False api_base: Optional[str] = None organization: Optional[str] = None @@ -271,6 +266,7 @@ def _client_params(self) -> Dict[str, Any]: if self.model_name is not None: set_model_value = self.model_name self.client.api_base = self.api_base + self.client.api_key = self.api_key self.client.organization = self.organization creds: Dict[str, Any] = { "model": set_model_value,