2024-04-13 23:23:01 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
from langchain_community.embeddings import YandexGPTEmbeddings
|
|
|
|
|
|
|
|
|
|
|
|
def test_init() -> None:
|
|
|
|
os.environ["YC_API_KEY"] = "foo"
|
|
|
|
models = [
|
2024-05-13 18:55:07 +00:00
|
|
|
YandexGPTEmbeddings(folder_id="bar"), # type: ignore[call-arg]
|
|
|
|
YandexGPTEmbeddings( # type: ignore[call-arg]
|
2024-04-13 23:23:01 +00:00
|
|
|
query_model_uri="emb://bar/text-search-query/latest",
|
|
|
|
doc_model_uri="emb://bar/text-search-doc/latest",
|
|
|
|
),
|
2024-05-13 18:55:07 +00:00
|
|
|
YandexGPTEmbeddings( # type: ignore[call-arg]
|
2024-04-13 23:23:01 +00:00
|
|
|
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"
|