Open mantrakp04 opened 4 months ago
From the stack trace it seems like it's not from the astream events API, but something in the chat anthropic implementation.
Would you mind checking what happens if you generate a list of BaseMessage that corresponds to the chat history you have and then invoke them with async for chunk in model.astream(messages)
and list(model.stream(messages))
.
I suspect it'll trigger the error as well and help produce a minimal reproducible example
chat anthropoic is weird I suspected that as well it returns a list of json as response and doesn’t run if I convert the json to a str and replace the message.content with that str
On Wed, Jul 10, 2024 at 3:00 AM Eugene Yurtsev @.***> wrote:
From the stack trace it seems like it's not from the astream events API, but something in the chat anthropic implementation.
Would you mind checking what happens if you generate a list of BaseMessage that corresponds to the chat history you have and then invoke them with async for chunk in model.astream(messages) and list(model.stream(messages)).
I suspect it'll trigger the error as well and help produce a minimal reproducible example
— Reply to this email directly, view it on GitHub https://github.com/langchain-ai/langchain/issues/24007#issuecomment-2218764472, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUY3AOKCW4GTA54VGNIJLJDZLRJARAVCNFSM6AAAAABKSGSBKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYG43DINBXGI . You are receiving this because you authored the thread.Message ID: @.***>
I am also facing this similar issue , on my side I am building an agent using langgraph, I am able to solve 90% of the problem , where its able to call the tools perfectly and tools are responding as well but same issue persists that as function message gets added to the state , it began to break. Did you came across any solution ?? @mantrakp04
chat anthropoic is weird I suspected that as well it returns a list of json as response and doesn’t run if I convert the json to a str and replace the message.content with that str … On Wed, Jul 10, 2024 at 3:00 AM Eugene Yurtsev @.> wrote: From the stack trace it seems like it's not from the astream events API, but something in the chat anthropic implementation. Would you mind checking what happens if you generate a list of BaseMessage that corresponds to the chat history you have and then invoke them with async for chunk in model.astream(messages) and list(model.stream(messages)). I suspect it'll trigger the error as well and help produce a minimal reproducible example — Reply to this email directly, view it on GitHub <#24007 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUY3AOKCW4GTA54VGNIJLJDZLRJARAVCNFSM6AAAAABKSGSBKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYG43DINBXGI . You are receiving this because you authored the thread.Message ID: @.>
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
the above error occurs when I add FunctionMessage to chathistory, and run the agent again.
ex:
1st run) input: what is apple stock rn - runs perfectly 2nd run) input: what is google stock rn - gives the above error
System Info