跳到主要内容
Dappier:利用动态实时数据模型为 AI 赋能 Dappier 提供了一个尖端平台,让开发者能够即时访问涵盖新闻、娱乐、金融、市场数据、天气等领域的各种实时数据模型。借助我们预训练的数据模型,您可以增强 AI 应用程序,确保它们提供精确、最新的响应并最大限度地减少不准确性。 Dappier 数据模型可帮助您构建下一代 LLM 应用程序,这些应用程序使用来自世界领先品牌的受信任、最新内容。通过简单的 API,释放您的创造力,并通过可操作的专有数据增强任何 GPT 应用程序或 AI 工作流程。通过来自可信来源的专有数据增强您的 AI 是确保事实准确、最新响应并减少幻觉的最佳方式,无论问题是什么。 为开发者而生,由开发者打造 Dappier 的设计充分考虑了开发者的需求,简化了从数据集成到货币化的过程,提供了清晰、直接的路径来部署 AI 模型并从中获利。请访问 dappier.com/,体验新互联网的未来货币化基础设施。 此示例介绍了如何使用 LangChain 与 Dappier AI 模型进行交互
要使用我们的 Dappier AI 数据模型,您需要一个 API 密钥。请访问 Dappier 平台 (platform.dappier.com/) 登录并在您的个人资料中创建 API 密钥。 您可以在 API 参考中找到更多详细信息:docs.dappier.com/introduction 要使用我们的 Dappier 聊天模型,您可以在初始化类时通过名为 dappier_api_key 的参数直接传递密钥,或将其设置为环境变量。
export DAPPIER_API_KEY="..."
from langchain_community.chat_models.dappier import ChatDappierAI
from langchain.messages import 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! 🏈')

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