Skip to main content
Open In Colab在 GitHub 上打开

更聪明的 AI

Dappier:使用动态、实时的数据模型为 AI 提供支持

Dappier 提供了一个尖端平台,使开发人员能够立即访问各种实时数据模型,涵盖新闻、娱乐、金融、市场数据、天气等。借助我们预先训练的数据模型,您可以增强 AI 应用程序,确保它们提供精确、最新的响应并最大限度地减少不准确之处。

更简洁的数据模型可帮助您使用来自世界领先品牌的可信最新内容构建下一代 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 聊天模型,您可以在启动类时直接通过名为 dappier_api_key 的参数传递密钥 或设置为 Environment Variable。

export DAPPIER_API_KEY="..."
from langchain_community.chat_models.dappier import ChatDappierAI
from langchain_core.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! 🏈')