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](804390ba4b/libs/community/langchain_community/llms/gigachat.py (L36)).

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
Andrei Panferov 2024-04-29 19:08:26 +03:00 committed by GitHub
parent 3331865f6b
commit b3efa38cc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,6 +133,7 @@ class GigaChat(_BaseGigaChat, BaseChatModel):
) )
payload.functions = kwargs.get("functions", None) payload.functions = kwargs.get("functions", None)
payload.model = self.model
if self.profanity_check is not None: if self.profanity_check is not None:
payload.profanity_check = self.profanity_check payload.profanity_check = self.profanity_check