[第三课笔记]基于 InternLM 和 LangChain 搭建你的知识库
llm.predict("你是谁")构建检索问答链,还需要构建一个 Prompt Template,该 Template 其实基于一个带变量的字符串,在检索之后,LangChain 会将检索到的相关文档片段填入到 Template 的变量中,从而实现带知识的 Prompt 构建。from langchain . prompts import PromptTemplate # 我们所构造的 Prompt 模板 template = """使用以下上下文来回答用户的问题。如果你不知道答案,就说你不知道。