langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Add human message as input variable to chat agent prompt creation

Open richardyc opened this issue 1 year ago β€’ 2 comments

Add human message as input variable to chat agent prompt creation

This PR adds human message and system message input to CHAT_ZERO_SHOT_REACT_DESCRIPTION agent, similar to conversational chat agent.

I met this issue trying to use create_prompt function when using the BabyAGI agent with tools notebook, since BabyAGI uses β€œtask” instead of β€œinput” input variable. For normal zero shot react agent this is fine because I can manually change the suffix to β€œ{input}/n/n{agent_scratchpad}” just like the notebook, but I cannot do this with conversational chat agent, therefore blocking me to use BabyAGI with chat zero shot agent.

I tested this in my own project Chrome-GPT and this fix worked.

Request for review

Agents / Tools / Toolkits

  • @vowelparrot

richardyc avatar May 12 '23 01:05 richardyc

@vowelparrot Thanks!

richardyc avatar May 12 '23 01:05 richardyc

lgtm, thanks @richardyc!

dev2049 avatar May 17 '23 01:05 dev2049