0

I am playing around with the LangChain JavaScript library and wanted to make sure I am doing this correctly.

My goals is to set the tone of the AI (who they are) and then pass in some context and let it ask a question about that context.

So this is what I do:

promptTemplate = new PromptTemplate({
  template: templates.initial,
  inputVariables: ["context"],
});
inputWithContext = await promptTemplate.format({
  context: text,
});
const res = await model.call(inputWithContext);

Where templates.initial is:

CONTEXT: {context}

WHO YOU ARE: You are someone who gives back bad feedback.

QUERY: Given the context and who you are, give the user some feedback and end with a question.

First question:

Is that the correct way of doing this? I noticed there are some SystemMessage objects but not sure if I need those? If not how would you structure this?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
strangeQuirks
  • 4,761
  • 9
  • 40
  • 67

0 Answers0