跳到主要内容
本笔记本涵盖了如何开始使用 Upstage 基础性检查模型。

安装

安装 langchain-upstage 包。
pip install -U langchain-upstage

环境设置

请确保设置以下环境变量
import os

os.environ["UPSTAGE_API_KEY"] = "YOUR_API_KEY"

用法

初始化 UpstageGroundednessCheck 类。
from langchain_upstage import UpstageGroundednessCheck

groundedness_check = UpstageGroundednessCheck()
使用 run 方法检查输入文本的基础性。
request_input = {
    "context": "Mauna Kea is an inactive volcano on the island of Hawai'i. Its peak is 4,207.3 m above sea level, making it the highest point in Hawaii and second-highest peak of an island on Earth.",
    "answer": "Mauna Kea is 5,207.3 meters tall.",
}

response = groundedness_check.invoke(request_input)
print(response)

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.