langchain/libs/community/tests/unit_tests/embeddings/test_yandex.py
Eugene Yurtsev 25fbe356b4
community[patch]: upgrade to recent version of mypy (#21616)
This PR upgrades community to a recent version of mypy. It inserts type:
ignore on all existing failures.
2024-05-13 14:55:07 -04:00

25 lines
922 B
Python

import os
from langchain_community.embeddings import YandexGPTEmbeddings
def test_init() -> None:
os.environ["YC_API_KEY"] = "foo"
models = [
YandexGPTEmbeddings(folder_id="bar"), # type: ignore[call-arg]
YandexGPTEmbeddings( # type: ignore[call-arg]
query_model_uri="emb://bar/text-search-query/latest",
doc_model_uri="emb://bar/text-search-doc/latest",
),
YandexGPTEmbeddings( # type: ignore[call-arg]
folder_id="bar",
query_model_name="text-search-query",
doc_model_name="text-search-doc",
),
]
for embeddings in models:
assert embeddings.model_uri == "emb://bar/text-search-query/latest"
assert embeddings.doc_model_uri == "emb://bar/text-search-doc/latest"
assert embeddings.model_name == "text-search-query"
assert embeddings.doc_model_name == "text-search-doc"