src / templates / document_context.ts
/**
* Template for structuring the final prompt when full document context is injected.
* This function takes all gathered components and formats them into a single, coherent system prompt.
*/
export const DOCUMENT_CONTEXT_TEMPLATE = (
citations: string,
fullContent: string,
userQuery: string
): string => {
return `
[SYSTEM INSTRUCTION]
You are an expert assistant. Your goal is to answer the user's query using only the provided context.
--- CONTEXT START ---
${citations}
${fullContent}
--- CONTEXT END ---
INSTRUCTIONS:
1. Use all relevant information from the context above.
2. If the context does not contain enough information, state that clearly and politely.
3. Do not hallucinate or use external knowledge.
USER QUERY: ${userQuery}
`;
};