更简单的AI
Dappier:通过动态实时数据模型赋能人工智能
Dappier 提供了一个前沿的平台,使开发者能够即时访问涵盖新闻、娱乐、金融、市场数据、天气等领域的众多实时数据模型。通过我们的预训练数据模型,您可以加速您的 AI 应用程序,确保它们提供精确且最新的响应,同时最大限度地减少不准确性。
更灵活的数据模型帮助您使用来自世界领先品牌可信且最新的内容,构建下一代LLM应用程序。通过简单的API,释放您的创造力,并通过可操作的专有数据增强任何GPT应用程序或AI工作流程。利用来自可信来源的专有数据来增强您的AI,是确保无论什么问题都能获得事实准确、最新响应并减少幻觉的最佳方法。
为开发者而生,由开发者打造 Dappier专为开发者设计,简化了从数据集成到变现的全过程,为部署和通过您的AI模型盈利提供了清晰且直接的路径。在https://dappier.com/体验全新互联网变现基础设施的未来。
这个示例介绍了如何使用 LangChain 与 Dappier AI 模型进行交互
要使用我们的Dappier AI数据模型之一,您需要一个API密钥。请访问Dappier平台 (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 参考: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! 🏈')