@roadiehq/rag-ai-backend
Version:
23 lines (18 loc) • 981 B
JavaScript
;
const prefixPrompt = (promptPrefixText) => (embedding) => promptPrefixText ? `${promptPrefixText} ${embedding}` : `You are an agent designed to answer questions from documents, Backstage catalog-info files, OpenAPI specs and Tech Insights Data data provided to you.
If the question does not seem related to the aforementioned items, return I don't know. Do not make up an answer.
Only use information provided by the embedded documentation to construct your response.
The embedded input document you should use to answer this query is the following:
${embedding}
`;
const suffixPrompt = (promptSuffixText) => (input) => promptSuffixText ? `${promptSuffixText} ${input}` : `Begin!"
Question: ${input}
`;
const createPromptTemplates = (prompts) => {
return {
prefixPrompt: prefixPrompt(prompts?.prefix),
suffixPrompt: suffixPrompt(prompts?.suffix)
};
};
exports.createPromptTemplates = createPromptTemplates;
//# sourceMappingURL=prompts.cjs.js.map