{"version":3,"file":"stuff_prompts.cjs","names":["PromptTemplate","ConditionalPromptSelector","isChatModel"],"sources":["../../../src/chains/question_answering/stuff_prompts.ts"],"sourcesContent":["import {\n  ChatPromptTemplate,\n  SystemMessagePromptTemplate,\n  HumanMessagePromptTemplate,\n  PromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n  ConditionalPromptSelector,\n  isChatModel,\n} from \"@langchain/core/example_selectors\";\n\nexport const DEFAULT_QA_PROMPT = /*#__PURE__*/ new PromptTemplate({\n  template:\n    \"Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.\\n\\n{context}\\n\\nQuestion: {question}\\nHelpful Answer:\",\n  inputVariables: [\"context\", \"question\"],\n});\n\nconst system_template = `Use the following pieces of context to answer the users question. \nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\n{context}`;\nconst messages = [\n  /*#__PURE__*/ SystemMessagePromptTemplate.fromTemplate(system_template),\n  /*#__PURE__*/ HumanMessagePromptTemplate.fromTemplate(\"{question}\"),\n];\nconst CHAT_PROMPT = /*#__PURE__*/ ChatPromptTemplate.fromMessages(messages);\n\nexport const QA_PROMPT_SELECTOR = /*#__PURE__*/ new ConditionalPromptSelector(\n  DEFAULT_QA_PROMPT,\n  [[isChatModel, CHAT_PROMPT]]\n);\n"],"mappings":";;;;AAWA,MAAa,oCAAkC,IAAIA,wBAAAA,eAAe;CAChE,UACE;CACF,gBAAgB,CAAC,WAAW,WAAW;CACxC,CAAC;AAMF,MAAM,WAAW,CACD,wCAAA,4BAA4B,aALpB;;;WAKiD,EACzD,wCAAA,2BAA2B,aAAa,aAAa,CACpE;AACD,MAAM,cAA4B,wCAAA,mBAAmB,aAAa,SAAS;AAE3E,MAAa,qCAAmC,IAAIC,kCAAAA,0BAClD,mBACA,CAAC,CAACC,kCAAAA,aAAa,YAAY,CAAC,CAC7B"}