Langchain agent finishes too early

205 Views Asked by At

I am using python langchain agent with some custom tools.

The chain finishes with the information that a tool will be used, but instead of calling the tool, it provides the details of the tool call and finishes the chain. It usually happens after some other tools in the chain was called before. It seems that the chain closes one step before it should as the tool that is left uncalled is one of the finishing ones.

I am using langchain with streamlit. The langchain version 0.0.352, but I have tried earlier versions too. I use Azure OpenAI GPT-4 as the LLM, The agent type is STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION

I tried to force to not to finish too early with some prompt engineering, but failed.

It may be my perception, but it seems like it worked better before and it stopped last month. Nothing changed on my side. Has the OpenAI GPT-4 changed?

1

There are 1 best solutions below

0
Cekir On

OK, I have found the problem. It is with the data. There is "None" word in returned data (returned from the tool), and my parser sets this as the final answer.