摘要: 在工具中使用 interrupt() 暂停执行。 使用 Command(resume=...) 根据人工输入继续。 原始方法: 使用agentinbox做成工具直接每次调用时可以直接暂停 from typing import Callablefrom langchain_core.tools imp 阅读全文
posted @ 2026-08-09 20:47 jokercheems 阅读(10) 评论(0) 推荐(0)
摘要: memory = MemorySaver()graph = graph_builder.compile(checkpointer=memory) # 编译时装入,不是运行时 在编译时加上参数可以没记录一次状态时村一次快照, 使用场景:长期记忆,对话延续,每次快照都有追溯记录,而且可以方便人工介入审查 阅读全文
posted @ 2026-08-09 14:21 jokercheems 阅读(3) 评论(0) 推荐(0)
摘要: State(状态)= 共享记事本/黑板 整个任务运行期间,所有数据都存在这本记事本里。 TypedDict 负责规定记事本的格式(有哪些字段)。 messages: Annotated[list, add_messages]:给字段贴“更新规则”标签,add_messages 表示新消息追加到旧消息 阅读全文
posted @ 2026-08-09 14:04 jokercheems 阅读(4) 评论(0) 推荐(0)