From b3efa38cc08ef16bfed815b1569705305dc69d8e Mon Sep 17 00:00:00 2001 From: Andrei Panferov Date: Mon, 29 Apr 2024 19:08:26 +0300 Subject: [PATCH] community[patch]: GigaChat model selection fix (#20988) Fixed the error that the model name is never actually put into GigaChat request payload, always defaulting to `GigaChat-Lite`. With this fix, model selection through ```python import os from langchain.chat_models.gigachat import GigaChat chat = GigaChat( name="GigaChat-Pro", # <- HERE!!!!! ... ) ``` should actually work, as intended in [here](https://github.com/langchain-ai/langchain/blob/804390ba4bcc306b90cb6d75b7f01a4231ab6463/libs/community/langchain_community/llms/gigachat.py#L36). --------- Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> --- libs/community/langchain_community/chat_models/gigachat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/community/langchain_community/chat_models/gigachat.py b/libs/community/langchain_community/chat_models/gigachat.py index 7345aa4ad9c..76e22bb2489 100644 --- a/libs/community/langchain_community/chat_models/gigachat.py +++ b/libs/community/langchain_community/chat_models/gigachat.py @@ -133,6 +133,7 @@ class GigaChat(_BaseGigaChat, BaseChatModel): ) payload.functions = kwargs.get("functions", None) + payload.model = self.model if self.profanity_check is not None: payload.profanity_check = self.profanity_check