Replies: 1 comment
-
🤖 Hi @Luisotee, Nice to meet you! I'm Dosu, a bot here to assist with your questions, help solve bugs, and guide you on becoming a contributor while we wait for a human maintainer. I'm here to help make your coding journey smoother. Let's dive into your issue! Based on the code you've provided, it seems like you're trying to modify the prompt for each In the LangChainJS framework, the prompt is defined when you initialize the If you want to change the context or the initial prompt for each Here's an example of how you can use it: const physicsTemplate = `You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.
Here is a question:
{input}
`;
// ...
const multiPromptChain = MultiPromptChain.fromLLMAndPrompts(llm, {
promptNames,
promptDescriptions,
promptTemplates,
});
const testPromise1 = multiPromptChain.call({
input: "What is the speed of light?",
}); In this example, the You can find more information about this in the examples/src/chains/multi_prompt.ts file in the LangChainJS repository. I hope this helps! If you have any other questions, feel free to ask. -Dosu SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, is there a way for me to add context or to completely change the initial prompt upon every
chain.call
?This is my failed attempt at trying to give a new prompt in every
chain.call
:Initializing the model:
Calling the model:
Beta Was this translation helpful? Give feedback.
All reactions