Prompt Composability #1660
Replies: 5 comments 1 reply
-
Great idea, I imagine this to work like this (with some @mention UI): Prompt A
Prompt B
Prompt C
|
Beta Was this translation helpful? Give feedback.
-
Funny, I just wanted to raise the same idea. We have a ReAct agent, which uses multiple tools (tools are dynamically selected), so we have one prompt for the ReAct agent itself and one for each tool. At runtime we put those together (ReAct prompt + multiple tool prompts) and supply that to the LangChain ReAct agent module. This works, but now the generations in Langfuse are not aware which prompt was used - because in fact there were multiple. So at minimum it would be nice to have an option to tell Langfuse that this call is based on multiple prompts (which were used to compose the actual prompt). Ps.: Although this is not exactly the same as above, as we are constructing the final prompt from the tool prompt dynamically at runtime, so the following would not be sufficient: |
Beta Was this translation helpful? Give feedback.
-
We now have a bunch of different prompts share the same |
Beta Was this translation helpful? Give feedback.
-
The current implementation is a simple template, supporting {{variable}} interpolation. Allow a template to be a variable and you are halfway there or just maybe use an existing template library? Composability is required unless everyone is OK with copy/paste and find/replace. |
Beta Was this translation helpful? Give feedback.
-
what makes this a bit more complicated
|
Beta Was this translation helpful? Give feedback.
-
Describe the feature or potential improvement
There are certain things I need to add to all or most of my system's prompts and we compose them just before .invoke right now (using Langchain), but would be great if I could do that in your system and get it all stored there.
For instance, we usually load in a subset of previous user conversation and that template would be helpful to add in as a component in your PromptManagement tool.
Potentially then when I load prompt C (that is composed of A + B for instance) it would automatically load both of those sub-prompts and use the config from prompt C.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions