type
Post
status
Published
date
Oct 2, 2025
slug
summary
LLMChain(已弃用写法);SimpleSequentialChain/Sequential(在1.0中已弃用写法);LECL语法
tags
人工智能
prompt
category
技术分享
icon
password
关于LECL语法的使用
使用管道符之前:
使用管道符之后:
1.LLMChain的使用(1.0已废弃)
特点:
在langchain1.0中已经被废弃,直接使用LECL也就是管道符语法代替
用于单次问答,输入一个Prompt,输出 LLM的响应。适合无上下文的简单任务(如翻译、摘要、分类等)。
无记忆:无法自动维护聊天历史
顺序链之SimpleSequentialChain/Sequential(在1.0中已被弃用)
顺序链(sequentialchain) 允许将多个链顺序连接起来,每个Chain的输出作为下一个Chain的输入,形成特定场景的流水线(Pipeline)。
顺序链有两种类型:
- 单个输入/输出:对应着SimplesequentialChain(已弃用)
- 多个输入/输出:对应着:Sequentialchain(已弃用)
SimplesequentialChain 写法(已弃用) 实现顺序链-多步骤流水线
Sequential 使用案例
使用LECL实现以上相同案例
LECL实现
- 管道操作符直接输出
- RunnableParallel 创建不同支链 获取不同支链结果
使用LECL语法 结合 少样本示例 实现顺序链-多步骤流水线
打印结果
- Author:guderain
- URL:https://wangguanxi.space/article/2e02b727-a3a3-80ca-a5f8-d33f3e334377
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts


.webp?table=collection&id=92be88af-5f71-4631-9d3e-ee3bd53dcced&t=92be88af-5f71-4631-9d3e-ee3bd53dcced&width=1080&cache=v2)