Dataherald
本笔记本介绍了如何使用dataherald组件。
首先,您需要设置您的Dataherald账户并获取您的API KEY:
- 前往 dataherald 并在此处注册 here
- 登录您的管理控制台后,创建一个API密钥
- pip 安装 dataherald
然后我们需要设置一些环境变量:
- 将您的API KEY保存到DATAHERALD_API_KEY环境变量中
pip install dataherald
%pip install --upgrade --quiet langchain-community
import os
os.environ["DATAHERALD_API_KEY"] = ""
from langchain_community.utilities.dataherald import DataheraldAPIWrapper
API Reference:DataheraldAPIWrapper
dataherald = DataheraldAPIWrapper(db_connection_id="65fb766367dd22c99ce1a12d")
dataherald.run("How many employees are in the company?")
'select COUNT(*) from employees'