当前位置:   article > 正文

基于Langchain的国内大模型应用-通义千问_国内有没类似 langchain

国内有没类似 langchain

首先做好环境配置工作

  1. pip install dashscope
  2. pip install langchain
  3. pip install langchain-community

去申请api

https://help.aliyun.com/document_detail/611472.html?spm=a2c4g.2399481.0.0

单论对话代码

  1. from getpass import getpass
  2. DASHSCOPE_API_KEY = getpass()
  3. import os
  4. os.environ["DASHSCOPE_API_KEY"] = "你的APIkey"
  5. from langchain_community.llms import Tongyi
  6. Tongyi().invoke("What NFL team won the Super Bowl in the year Justin Bieber was born?")

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/875194
推荐阅读
相关标签
  

闽ICP备14008679号