We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Langchain integration example doesn't work - AttributeError: Config in yandex_cloud_ml_sdk
from yandex_cloud_ml_sdk import YCloudML from langchain_core.messages import AIMessage, HumanMessage sdk = YCloudML(folder_id="...", auth="<APIKey/IAMToken/SomethingElse>") model = sdk.models.completions('yandexgpt').langchain() langchain_result = model.invoke([ HumanMessage(content="hello!"), AIMessage(content="Hi there human!"), HumanMessage(content="Meow!"), ])
AttributeError Traceback (most recent call last) Cell In[6], line 6 2 from langchain_core.messages import AIMessage, HumanMessage 4 sdk = YCloudML(folder_id="xxxxxx", auth="xxxxxxxxxxxxxx") ----> 6 model = sdk.models.completions('yandexgpt').langchain() 8 langchain_result = model.invoke([ 9 HumanMessage(content="hello!"), 10 AIMessage(content="Hi there human!"), 11 HumanMessage(content="Meow!"), 12 ]) File xxxxxxxxxx/.venv/lib/python3.12/site-packages/yandex_cloud_ml_sdk/_models/completions/model.py:39, in BaseGPTModel.langchain(self, model_type, timeout) 38 def langchain(self, model_type: Literal["chat"] = "chat", timeout: int = 60) -> BaseYandexLanguageModel: ---> 39 from .langchain import ChatYandexGPT # pylint: disable=import-outside-toplevel 41 if model_type == "chat": 42 # idk why but pylint thinks this class still abstract 43 return ChatYandexGPT(ycmlsdk_model=self, timeout=timeout) # pylint: disable=abstract-class-instantiated File xxxxxxxxxx/.venv/lib/python3.12/site-packages/yandex_cloud_ml_sdk/_models/completions/langchain.py:12 9 from langchain_core.messages.ai import UsageMetadata 10 from langchain_core.outputs import ChatGeneration, ChatGenerationChunk, ChatResult ---> 12 from yandex_cloud_ml_sdk._types.langchain import BaseYandexLanguageModel 13 from yandex_cloud_ml_sdk._utils.langchain import make_async_run_manager 14 from yandex_cloud_ml_sdk._utils.sync import run_sync_generator_impl, run_sync_impl File xxxxxxxxxx/.venv/lib/python3.12/site-packages/yandex_cloud_ml_sdk/_types/langchain.py:15 10 from yandex_cloud_ml_sdk._types.model import BaseModel 12 ModelTypeT = TypeVar('ModelTypeT', bound=BaseModel) ---> 15 class BaseYandexModel(LangchainModel, Generic[ModelTypeT]): 16 ycmlsdk_model: ModelTypeT 17 timeout: int = 60 File xxxxxxxxxx/.venv/lib/python3.12/site-packages/yandex_cloud_ml_sdk/_types/langchain.py:19, in BaseYandexModel() 16 ycmlsdk_model: ModelTypeT 17 timeout: int = 60 ---> 19 class Config(Serializable.Config): 20 arbitrary_types_allowed = True File xxxxxxxxxx/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py:262, in ModelMetaclass.__getattr__(self, item) 260 if private_attributes and item in private_attributes: 261 return private_attributes[item] --> 262 raise AttributeError(item) AttributeError: Config
The text was updated successfully, but these errors were encountered:
Hey! Langchain just updated its internals and we need to adapt our integration with it. Meanwhile you could downgrade langchain-core>=0.2.29,<=0.2.41
langchain-core>=0.2.29,<=0.2.41
Sorry, something went wrong.
Yes, downgrading to langchain-core>=0.2.29,<=0.2.41 did the trick
I will leave this ticket open until I make the correct fix.
No branches or pull requests
Description:
Langchain integration example doesn't work - AttributeError: Config in yandex_cloud_ml_sdk
Steps to Reproduce:
Error Traceback:
Environment:
The text was updated successfully, but these errors were encountered: