-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Description
Checked other resources
- This is a bug, not a usage question.
- I added a clear and descriptive title that summarizes this issue.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain rather than my code.
- The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
- This is not related to the langchain-community package.
- I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.
Example Code
config: RunnableConfig = {"configurable": {"thread_id": "1"}}
state = agent.invoke({"messages": [{"role": "user", "content": "福州天气怎么样?5加5等于多少?"}]},config)
while "interrupt" in state:
interrupts = state["interrupt"]
decisions = []
for interrupt in interrupts:
actions = interrupt.value["action_requests"]
for action in actions:
print(f"需要人工确认的操作: {action['name']} 参数: {action['args']}")
decision = input("是否继续?(approve/edit/reject): ")
if decision == "approve":
decisions.append({"type": "approve"})
elif decision == "edit":
new_query = input("输入修改后的参数: ")
decisions.append({
"type": "edit",
"edited_action": {
"name": action["name"],
"args": {"query": new_query}
}
})
elif decision == "reject":
decisions.append({"type": "reject"})
# 所有 action 决策后恢复执行
state = agent.invoke(
Command(resume={"decisions": decisions}),
config=config
)
state["messages"][-1].pretty_print()
Error Message and Stack Trace (if applicable)
No response
Description
when using human-in-the-loop, i find that the llm recall the same tool with original parameter if i had edited the tool parameter,why
System Info
System Information
OS: Windows
OS Version: 10.0.19045
Python Version: 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]
Package Information
langchain_core: 1.0.1
langchain: 1.0.2
langchain_community: 0.4.1
langsmith: 0.4.31
langchain_chroma: 0.2.6
langchain_classic: 1.0.0
langchain_deepseek: 0.1.4
langchain_mcp: 0.2.1
langchain_mcp_adapters: 0.1.11
langchain_openai: 0.3.33
langchain_text_splitters: 1.0.0
langgraph_api: 0.4.46
langgraph_cli: 0.4.4
langgraph_runtime_inmem: 0.14.1
langgraph_sdk: 0.2.9
langserve: 0.3.2
Other Dependencies
aiohttp: 3.10.5
async-timeout: Installed. No version info available.
blockbuster: 1.5.25
chromadb: 1.1.0
click: 8.3.0
cloudpickle: 3.1.1
cryptography: 44.0.3
dataclasses-json: 0.6.7
fastapi: 0.118.3
grpcio: 1.76.0
grpcio-tools: 1.76.0
httpx: 0.28.1
httpx-sse: 0.4.1
jsonpatch: 1.33
jsonschema-rs: 0.29.1
langchain-anthropic: Installed. No version info available.
langchain-aws: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-genai: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-huggingface: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-ollama: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.1
langgraph-checkpoint: 2.1.2
langsmith-pyo3: Installed. No version info available.
mcp: 1.18.0
numpy: 2.3.3
openai: 1.109.1
openai-agents: Installed. No version info available.
opentelemetry-api: 1.38.0
opentelemetry-exporter-otlp-proto-http: 1.38.0
opentelemetry-sdk: 1.38.0
orjson: 3.11.3
packaging: 24.2
protobuf: 6.32.1
pydantic: 2.12.3
pydantic-settings: 2.11.0
pyjwt: 2.10.1
pytest: Installed. No version info available.
python-dotenv: 1.1.1
pyyaml: 6.0.3
PyYAML: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: 14.1.0
sqlalchemy: 2.0.43
SQLAlchemy: 2.0.43
sse-starlette: 2.1.3
starlette: 0.48.0
structlog: 25.4.0
tenacity: 8.5.0
tiktoken: 0.11.0
truststore: 0.10.4
typing-extensions: 4.15.0
uvicorn: 0.37.0
vcrpy: Installed. No version info available.
watchfiles: 1.1.0
zstandard: 0.25.0