Langchain
langchain是一个用于开发由语言模型驱动的应用程序的框架,致力于简化AI模型应用的开发。简单来说,langchain就是一个(帮助开发者轻松完成AI模型应用开发的)框架,现在支持python和js两个版本,它集成多种大语言模型及第三方API。
1、安装langchain
#安装langchain环境
pip install langchain==0.3.3 openai -i https://mirrors.aliyun.com/pypi/simple
#灵积模型服务
pip install dashscope -i https://mirrors.aliyun.com/pypi/simple
#安装第三方集成,就是各种大语言模型
pip install langchain-community==0.3.2 -i https://mirrors.aliyun.com/pypi/simple
#加载环境的工具
pip install python-dotenv
2.前期准备工作
第一个准备工作:拿到阿里云灵积模型服务的apikey,目前已经转为大模型服务百炼平台
传送门:阿里云开发者社区-云计算社区-阿里云 (aliyun.com)