Update langchain_example_with_Ollama.py

This commit is contained in:
2025-11-05 16:46:07 +08:00
parent a76f73d1e0
commit ecaca9fee1

View File

@@ -5,10 +5,6 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
import dotenv
# 加载环境变量包含API密钥
dotenv.load_dotenv()
# 创建聊天模型 - 修改为调用 Ollama
llm = ChatOpenAI(