mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-03 06:08:18 +00:00
Reopened as a personal repo outside the organization. ## Description - Naver HyperCLOVA X community package - Add chat model & embeddings - Add unit test & integration test - Add chat model & embeddings docs - I changed partner package(https://github.com/langchain-ai/langchain/pull/24252) to community package on this PR - Could this embeddings(https://github.com/langchain-ai/langchain/pull/21890) be deprecated? We are trying to replace it with embedding model(**ClovaXEmbeddings**) in this PR. Twitter handle: None. (if needed, contact with joonha.jeon@navercorp.com) --- you can check our previous discussion below: > one question on namespaces - would it make sense to have these in .clova namespaces instead of .naver? I would like to keep it as is, unless it is essential to unify the package name. (ClovaX is a branding for the model, and I plan to add other models and components. They need to be managed as separate classes.) > also, could you clarify the difference between ClovaEmbeddings and ClovaXEmbeddings? There are 3 models that are being serviced by embedding, and all are supported in the current PR. In addition, all the functionality of CLOVA Studio that serves actual models, such as distinguishing between test apps and service apps, is supported. The existing PR does not support this content because it is hard-coded. --------- Co-authored-by: Erick Friis <erick@langchain.dev> Co-authored-by: Vadym Barda <vadym@langchain.dev>
19 lines
621 B
Python
19 lines
621 B
Python
"""Test embedding model integration."""
|
|
|
|
import os
|
|
from typing import cast
|
|
|
|
from pydantic import SecretStr
|
|
|
|
from langchain_community.embeddings import ClovaXEmbeddings
|
|
|
|
os.environ["NCP_CLOVASTUDIO_API_KEY"] = "test_api_key"
|
|
os.environ["NCP_APIGW_API_KEY"] = "test_gw_key"
|
|
os.environ["NCP_CLOVASTUDIO_APP_ID"] = "test_app_id"
|
|
|
|
|
|
def test_initialization_api_key() -> None:
|
|
llm = ClovaXEmbeddings(api_key="foo", apigw_api_key="bar") # type: ignore[arg-type]
|
|
assert cast(SecretStr, llm.ncp_clovastudio_api_key).get_secret_value() == "foo"
|
|
assert cast(SecretStr, llm.ncp_apigw_api_key).get_secret_value() == "bar"
|