GitHub – liaokongVFX/LangChain-Chinese-Getting-Started-Guide: LangChain 的中文入门教程LangChain 的中文入门教程. Contribute to liaokongVFX/LangChain-Chinese-Getting-Started-Guide development by creating an account on GitHub.https://github.com/liaokongVFX/LangChain-Chinese-Getting-Started-Guide
目录
一、安装langchain
一、安装
pip install langchain
或者
conda install langchain -c conda-forge
二、langchain依赖LLM模型、数据库、外部的api接口等,以openAI的为例
pip install openai
三、获取OpenAI的key
四、简单示例
import os
from langchain.llms import OpenAI
os.environ["OPENAI_API_KEY"] = '***************'
llm = OpenAI(model_name="text-davinci-003", max_tokens=1024)
result = llm("怎么评价人工智能")
print(result)
文章出处登录后可见!
已经登录?立即刷新