Skip to main content
Open In ColabOpen on GitHub

Dappier AI

Dappier:通过动态、实时数据模型赋能人工智能

Dappier 提供了一个前沿的平台,使开发者能够立即访问广泛的数据模型,涵盖新闻、娱乐、金融、市场数据、天气等众多领域。借助我们预先训练好的数据模型,您可以加速您的AI应用程序的发展,确保它们提供精确且及时的回答,并最大限度地减少不准确性。

Dappier数据模型帮助您使用来自全球领先品牌的可信、最新内容构建下一代LLM应用程序。通过简单的API解锁您的创造力并增强任何GPT应用或AI工作流,利用可操作的专有数据。从受信任来源添加专有数据是确保无论问题是什么都能获得准确、最新的响应以及减少幻觉的最佳方式。

For Developers, By Developers Designed with developers in mind, Dappier 拯救了开发者从数据集成到变现的旅程,提供清晰、直接的道路来部署和赚取收益。在 https://dappier.com/ 体验新互联网的收益基础设施。

这只是一个例子,说明了如何使用LangChain与Dappier AI模型进行交互


要使用我们的Dappier AI数据模型,您将需要一个API密钥。请访问Dappier平台(https://platform.dappier.com/)进行登录并在个人资料中创建API密钥。

您可以在API参考中找到更多详细信息: https://docs.dappier.com/introduction

要与我们的Dappier聊天模型进行交互,您可以在初始化类时通过名为dappier_api_key的参数直接传递密钥, 或者将其设置为环境变量。

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! 🏈')