mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 12:01:54 +00:00
feat(core): allow overriding ls_model_name
from kwargs (#32541)
This commit is contained in:
@@ -720,7 +720,9 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
ls_params["ls_stop"] = stop
|
||||
|
||||
# model
|
||||
if hasattr(self, "model") and isinstance(self.model, str):
|
||||
if "model" in kwargs and isinstance(kwargs["model"], str):
|
||||
ls_params["ls_model_name"] = kwargs["model"]
|
||||
elif hasattr(self, "model") and isinstance(self.model, str):
|
||||
ls_params["ls_model_name"] = self.model
|
||||
elif hasattr(self, "model_name") and isinstance(self.model_name, str):
|
||||
ls_params["ls_model_name"] = self.model_name
|
||||
|
@@ -357,7 +357,9 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
ls_params["ls_stop"] = stop
|
||||
|
||||
# model
|
||||
if hasattr(self, "model") and isinstance(self.model, str):
|
||||
if "model" in kwargs and isinstance(kwargs["model"], str):
|
||||
ls_params["ls_model_name"] = kwargs["model"]
|
||||
elif hasattr(self, "model") and isinstance(self.model, str):
|
||||
ls_params["ls_model_name"] = self.model
|
||||
elif hasattr(self, "model_name") and isinstance(self.model_name, str):
|
||||
ls_params["ls_model_name"] = self.model_name
|
||||
|
Reference in New Issue
Block a user