Dappier AI
Dappier:用动态、实时数据模型赋能 AI
Dappier 提供了一个尖端平台,使开发人员能够立即访问涵盖新闻、娱乐、金融、市场数据、天气等广泛的实时数据模型。借助我们预先训练好的数据模型,您可以为您的 AI 应用程序注入强大的能力,确保它们提供精确、最新的响应,并最大限度地减少不准确性。
Dappier 数据模型可帮助您使用来自世界领先品牌的、可信赖的、最新的内容来构建下一代 LLM 应用程序。通过简单的 API,释放您的创造力,并通过可操作的专有数据增强任何 GPT 应用或 AI 工作流。利用来自可信来源的专有数据来增强您的 AI 是确保事实准确、响应及时且幻觉更少的最有效方法,无论提出什么问题。
为开发者而生,由开发者打造 Dappier 以开发者的需求为核心设计,简化了从数据集成到货币化的流程,提供了清晰直接的途径来部署您的 AI 模型并从中获利。在 https://dappier.com/ 体验新互联网货币化基础设施的未来。
此示例将介绍如何使用 LangChain 与 Dappier AI 模型进行交互
要使用我们的 Dappier AI 数据模型之一,您需要一个 API 密钥。请访问 Dappier Platform (https://platform.dappier.com/) 登录并在您的个人资料中创建一个 API 密钥。
您可以在 API 参考中找到更多详细信息:https://docs.dappier.com/introduction
要使用 Dappier Chat Model,你可以通过初始化类时命名的 dappier_api_key 参数直接传递密钥,或者将其设置为环境变量。
export DAPPIER_API_KEY="..."
from langchain_community.chat_models.dappier import ChatDappierAI
from langchain_core.messages import HumanMessage
API Reference:ChatDappierAI | HumanMessage
chat = ChatDappierAI(
dappier_endpoint="https://api.dappier.com/app/datamodelconversation",
dappier_model="dm_01hpsxyfm2fwdt2zet9cg6fdxt",
dappier_api_key="...",
)
messages = [HumanMessage(content="Who won the super bowl in 2024?")]
chat.invoke(messages)
AIMessage(content='Hey there! The Kansas City Chiefs won Super Bowl LVIII in 2024. They beat the San Francisco 49ers in overtime with a final score of 25-22. It was quite the game! 🏈')
await chat.ainvoke(messages)
AIMessage(content='The Kansas City Chiefs won Super Bowl LVIII in 2024! 🏈')
Related
- Chat model conceptual guide
- Chat model how-to guides