langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Fix Python Agent running on GPT-4

Open durdn opened this issue 1 year ago • 3 comments

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:

outputparserexception

I had to tweak the mrkl prompts to get things to work both on gpt-3.5 and gpt-4.

durdn avatar Apr 21 '23 21:04 durdn

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.

durdn avatar Apr 21 '23 22:04 durdn

I have a working version that's excellent if u want it then it's ok my fork

clockcoinG1 avatar Apr 28 '23 20:04 clockcoinG1

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

Cobryis avatar Apr 28 '23 20:04 Cobryis

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.

durdn avatar May 06 '23 14:05 durdn