ChatClovaX
This notebook provides a quick overview for getting started with Naver’s HyperCLOVA X chat models via CLOVA Studio. For detailed documentation of all ChatClovaX features and configurations head to the API reference.
CLOVA Studio has several chat models. You can find information about latest models and their costs, context windows, and supported input types in the CLOVA Studio API Guide documentation.
Overview
Integration details
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
ChatClovaX | langchain-community | ❌ | ❌ | ❌ |
Model features
Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|---|
❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
Setup
Before using the chat model, you must go through the three steps below.
- Creating NAVER Cloud Platform account
- Apply to use CLOVA Studio
- Find API Keys after creating CLOVA Studio Test App or Service App (See here.)
Credentials
CLOVA Studio requires 2 keys (NCP_CLOVASTUDIO_API_KEY
and NCP_APIGW_API_KEY
).
NCP_CLOVASTUDIO_API_KEY
is issued per Test App or Service AppNCP_APIGW_API_KEY
is issued per account, could be optional depending on the region you are using
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
You can add them to your environment variables as below:
export NCP_CLOVASTUDIO_API_KEY="your-api-key-here"
export NCP_APIGW_API_KEY="your-api-key-here"
import getpass
import os
if not os.getenv("NCP_CLOVASTUDIO_API_KEY"):
os.environ["NCP_CLOVASTUDIO_API_KEY"] = getpass.getpass(
"Enter your NCP CLOVA Studio API Key: "
)
if not os.getenv("NCP_APIGW_API_KEY"):
os.environ["NCP_APIGW_API_KEY"] = getpass.getpass(
"Enter your NCP API Gateway API key: "
)
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
# os.environ["LANGCHAIN_TRACING_V2"] = "true"
# os.environ["LANGCHAIN_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
Installation
The LangChain Naver integration lives in the langchain-community
package:
# install package
!pip install -qU langchain-community