> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-docs-zh.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upstage 稳固性检查集成

> 集成 Upstage 地基性检查工具，使用 LangChain Python。

本笔记本介绍了如何使用 Upstage 的接地性检查模型进行入门。

## 安装

安装 `langchain-upstage` 包。

```bash theme={null}
pip install -U langchain-upstage
```

## 环境配置

确保设置以下环境变量：

* `UPSTAGE_API_KEY`: 从 [Upstage 开发者文档](https://developers.upstage.ai/docs/getting-started/quick-start) 获取您的 Upstage API 密钥。

```python theme={null}
import os

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

## 使用方法

初始化 `UpstageGroundednessCheck` 类。

```python theme={null}
from langchain_upstage import UpstageGroundednessCheck

groundedness_check = UpstageGroundednessCheck()
```

使用 `run` 方法来检查输入文本的接地性。

```python theme={null}
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)
```

***

> 官方原文：[src/oss/python/integrations/tools/upstage\_groundedness\_check.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/tools/upstage_groundedness_check.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.