mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-04 11:25:11 +00:00
it fixes two issues: ### YGPTs are broken #25575 ``` File ....conda/lib/python3.11/site-packages/langchain_community/embeddings/yandex.py:211, in _make_request(self, texts, **kwargs) .. --> 211 res = stub.TextEmbedding(request, metadata=self._grpc_metadata) # type: ignore[attr-defined] AttributeError: 'YandexGPTEmbeddings' object has no attribute '_grpc_metadata' ``` My gut feeling that #23841 is the cause. I have to drop leading underscore from `_grpc_metadata` for quickfix, but I just don't know how to do it _pydantic_ enough. ### minor issue: if we use `api_key`, which is not the best practice the code fails with ``` File ~/git/...../python3.11/site-packages/langchain_community/embeddings/yandex.py:119, in YandexGPTEmbeddings.validate_environment(cls, values) ... AttributeError: 'tuple' object has no attribute 'append' ``` - Added new integration test. But it requires YGPT env available and active account. I don't know how int tests dis\enabled in CI. - added small unit tests with mocks. Should be fine. --------- Co-authored-by: mikhail-khludnev <mikhail_khludnev@rntgroup.com>