ClovaXEmbeddings
This notebook covers how to get started with embedding models provided by CLOVA Studio.
Installationโ
# install package
!pip install -U langchain-community
Environment Setupโ
CLOVA Studio requires 3 keys (NCP_CLOVASTUDIO_API_KEY, NCP_APIGW_API_KEY and NCP_CLOVASTUDIO_APP_ID) for embeddings.
NCP_CLOVASTUDIO_API_KEYcan issued per serviceApp or testAppNCP_APIGW_API_KEYandNCP_CLOVASTUDIO_APP_IDcan issued per account
The two API Keys could be found by clicking App Request Status > Service App, Test App List > โDetailsโ button for each app in CLOVA Studio.
Usageโ
- There are several available for embedding. Please refer here for further details.
from langchain_community.embeddings import ClovaXEmbeddings
embeddings = ClovaXEmbeddings()
API Reference:ClovaXEmbeddings
embeddings.embed_query("My query to look up")
embeddings.embed_documents(
["This is a content of the document", "This is another document"]
)
# async embed query
await embeddings.aembed_query("My query to look up")
# async embed documents
await embeddings.aembed_documents(
["This is a content of the document", "This is another document"]
)
Additional functionalitiesโ
Service Appโ
When going live with production-level application using CLOVA Studio, you should apply for and use Service App. (See here.)
For a Service App, corresponding NCP_CLOVASTUDIO_API_KEY and NCP_CLOVASTUDIO_APP_ID are issued and can only be called with the API Keys.