-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph stream labels "HumanMessage" but it is a "AiMessage" #574
Comments
Going from a to a
|
are you able to share code to exactly reproduce this? currently trying to replicate but dont know what your nodes are doing, etc |
I have the exact same issue. I was following the example on Agentic RAG from langgraph (https://langchain-ai.github.io/langgraph/tutorials/rag/langgraph_agentic_rag/#graph), and I removed the rewrite node. So, it's either agent->end or agent->retriever->generate->end. The output of generate is appended as HumanMessage to the list of messages in the State. Here is a reproducible example @hwchase17 :
And this is the output: [HumanMessage(content="According to Lilian Weng's blog, Explain what adversarial attacks on LLMs is.", id='b6b6bddc-2f57-46ac-be14-6df767146a45'), |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
Using a graph I read that:
mades output a concatenate list of different steos through graph path.
My path graph is input -> agent -> retriever -> generate and I got something like this :
{'messages': [HumanMessage(content='my_input?', id='3c2e2af5-f38e-4471-aee3-07502e3a5494'),
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'bdR7xmCGm', 'function': {'name': 'my_function', 'arguments': '{"query": "new_query"}'}}]}, response_metadata={'token_usage': {'prompt_tokens': 116, 'total_tokens': 154, 'completion_tokens': 38}, 'model': 'open-mixtral-8x22b', 'finish_reason': 'tool_calls'}, id='run-1e8ddb4a-751b-4f46-9ce3-02ddad099549-0', tool_calls=[{'name': 'my_tools', 'args': {'query': 'my_query}, 'id': 'bdR7xmCGm'}]),
ToolMessage(content='blobloblo', tool_call_id='bdR7xmCGm'),
HumanMessage(content="blablabla", id='739239a9-b3e6-4ef4-a01a-642d4a992d17')]}
The lastest object in my list labeled as "HumanMessage" but is generated by AI. Using Langsmith I do not have this error.
This is very confusing because I cannot just look an the event steps from my graph if I want to store it.
System Info
langchain==0.1.20
langchain-community==0.0.38
langchain-core==0.2.1
langchain-mistralai==0.1.7
langchain-postgres==0.0.6
langchain-text-splitters==0.0.1
langchainhub==0.1.15
langgraph==0.0.53
langsmith==0.1.57
The text was updated successfully, but these errors were encountered: