NAVER
所有与 Naver 相关的功能,包括HyperCLOVA X模型,特别是那些通过 Naver Cloud CLOVA Studio 可访问的模型。
Naver is a global technology company with cutting-edge technologies and a diverse business portfolio including search, commerce, fintech, content, cloud, and AI.
Naver Cloud is the cloud computing arm of Naver, a leading cloud service provider offering a comprehensive suite of cloud services to businesses through its Naver Cloud Platform (NCP).
有关更详细的说明,请参阅NCP 用户指南(也有韩语版本)。
安装与设置
- 通过生成获取CLOVA Studio API密钥,并将其设置为环境变量(
CLOVASTUDIO_API_KEY)。
Naver集成位于两个包中:
langchain-naver: 一个专为Naver设计的集成包。langchain-naver-community: 一个由社区维护的包,并非由Naver或LangChain官方维护。
pip install -U langchain-naver
# pip install -U langchain-naver-community // Install to use Naver Search tool.
(Note) Naver integration via
langchain-community, a collection of third-party integrations, is outdated.
- Use
langchain-naverinstead as new features should only be implemented via this package.- If you are using
langchain-community(outdated) and got a legacy API Key (that doesn't start withnv-*prefix), you should set it asNCP_CLOVASTUDIO_API_KEY, and might need to get an additional API Gateway API Key by creating your app and set it asNCP_APIGW_API_KEY.
聊天模型
ChatClovaX
查看一个 使用示例。
from langchain_naver import ChatClovaX
嵌入模型
ClovaXEmbeddings
查看一个 使用示例。
from langchain_naver import ClovaXEmbeddings
工具
Naver 搜索
Naver Search 集成允许您的 LangChain 应用程序从 Naver 搜索引擎中检索信息。这在处理韩语查询和获取有关韩国主题的最新信息时特别有用。
要使用Naver搜索工具,你需要:
- 登录到Naver开发者门户
- 创建一个新应用并启用搜索API
- 从“应用列表”部分获取您的NAVER_CLIENT_ID和NAVER_CLIENT_SECRET
- 在您的应用程序中将这些设置为环境变量
from langchain_naver_community.tool import NaverSearchResults
from langchain_naver_community.utils import NaverSearchAPIWrapper
# Set up the search wrapper
search = NaverSearchAPIWrapper()
# Create a tool
tool = NaverSearchResults(api_wrapper=search)
查看更多细节,请参阅使用示例。
专用搜索工具
该软件包还提供了针对不同类型内容的专用搜索工具:
from langchain_naver_community.tool import NaverNewsSearch # For news articles
from langchain_naver_community.tool import NaverBlogSearch # For blog posts
from langchain_naver_community.tool import NaverImageSearch # For images
其中每一项都可以在 LangChain 代理中使用,以提供更有针对性的搜索能力。