langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Allow custom base Zapier prompt

Open preritdas opened this issue 1 year ago • 2 comments

Currently, all Zapier tools are built using the pre-written base Zapier prompt. These small changes (that retain default behavior) will allow a user to create a Zapier tool using the ZapierNLARunTool while providing their own base prompt.

Their prompt must contain input fields for zapier_description and params, checked and enforced in the tool's root validator.

An example of when this may be useful: user has several, say 10, Zapier tools enabled. Currently, the long generic default Zapier base prompt is attached to every single tool, using an extreme number of tokens for no real added benefit (repeated). User prompts LLM on how to use Zapier tools once, then overrides the base prompt.

Or: user has a few specific Zapier tools and wants to maximize their success rate. So, user writes prompts/descriptions for those tools specific to their use case, and provides those to the ZapierNLARunTool.

A consideration - this is the simplest way to implement this I could think of... though ideally custom prompting would be possible at the Toolkit level as well. For now, this should be sufficient in solving the concerns outlined above.

preritdas avatar May 06 '23 03:05 preritdas

can we add a unit test?

1 unit test coming right up.

preritdas avatar May 06 '23 17:05 preritdas

Hey @vowelparrot, would you mind taking a look at this please? Would like to hear your thoughts too re. implementation considerations... Thanks :)

A consideration - this is the simplest way to implement this I could think of... though ideally custom prompting would be possible at the Toolkit level as well. For now, this should be sufficient in solving the concerns outlined above.

preritdas avatar May 09 '23 21:05 preritdas