langchain
langchain copied to clipboard
Fix Python Agent running on GPT-4
I went absolutely insane trying to write an Agent with multiple tools because of the exception below. I finally managed to track down the problem and reproduce it and fix it on the Python Agent example.
When running the vanilla example on gpt-4
this is what you would get:
I had to tweak the mrkl
prompts to get things to work both on gpt-3.5
and gpt-4
.
Also note that I got a different answer on the fib number question depending on the gpt
version. I guess it depends on where you start counting the Fibonacci numbers, if you include the initial 0
, then the 10th fib is 34
.
I have a working version that's excellent if u want it then it's ok my fork
This is how I fixed the LLM output issue: https://github.com/hwchase17/langchain/pull/3480 I also have this PR that better handles max iterations causing an early stop: https://github.com/hwchase17/langchain/pull/3690
There's been lots of work to make the output parser more robust so possibly these suggestions don't make sense anymore. Closing this for now.