04 - Custom Tools (自定义工具)核心概念工具 (Tool) = 给 AI 的函数使用 @tool 装饰器,让 AI 能调用你的 Python 函数。@tool 基本用法from langchain_core.tools import tool @tool def get_weat...
LangChain 文档
标签:LangChain 文档下的所有文章
24 篇文章
0 min 平均阅读
03 - Messages: 消息类型与对话管理核心要点(只讲难点)1. 三种消息类型角色字典格式对象格式用途System{"role": "system", ...}SystemMessage(...)系统提示User{"role": &...
02 - Prompt Templates: 提示词模板学习目标通过本模块,你将学习:为什么需要提示词模板字符串拼接的问题模板的优势PromptTemplate基本用法变量替换格式化方法ChatPromptTemplate聊天消息模板多角色支持对话历史管理高级特性部分变量模板组合可复用模板库LCEL...
01 - Hello LangChain: 第一个 LLM 调用学习目标通过本模块,你将学习:LangChain 1.0 的核心概念LangChain 1.0 构建在 LangGraph 运行时之上统一的模型初始化接口简化的 API 设计init_chat_model 函数如何初始化聊天模型支持的参...