community: Add deprecation warning for GigaChat integration in langchain-community (#28022)

- **Description:** We have released the
[langchain-gigachat](https://github.com/ai-forever/langchain-gigachat?tab=readme-ov-file)
with new GigaChat integration that support's function/tool calling. This
PR deprecated legacy GigaChat class in community package.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
Mikelarg
2024-11-21 00:03:47 +03:00
committed by GitHub
parent 567dc1e422
commit 2901fa20cc
5 changed files with 28 additions and 19 deletions

View File

@@ -13,6 +13,7 @@ from typing import (
Type,
)
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
@@ -113,6 +114,11 @@ def _convert_delta_to_message_chunk(
return default_class(content=content) # type: ignore[call-arg]
@deprecated(
since="0.3.5",
removal="1.0",
alternative_import="langchain_gigachat.GigaChat",
)
class GigaChat(_BaseGigaChat, BaseChatModel):
"""`GigaChat` large language models API.

View File

@@ -4,6 +4,7 @@ import logging
from functools import cached_property
from typing import Any, Dict, List, Optional
from langchain_core._api.deprecation import deprecated
from langchain_core.embeddings import Embeddings
from langchain_core.utils import pre_init
from langchain_core.utils.pydantic import get_fields
@@ -15,6 +16,11 @@ MAX_BATCH_SIZE_CHARS = 1000000
MAX_BATCH_SIZE_PARTS = 90
@deprecated(
since="0.3.5",
removal="1.0",
alternative_import="langchain_gigachat.GigaChatEmbeddings",
)
class GigaChatEmbeddings(BaseModel, Embeddings):
"""GigaChat Embeddings models.