"""LLM Chain specifically for generating examples for question answering.""" from __future__ import annotations from typing import Any from langchain.chains.llm import LLMChain from langchain.evaluation.qa.generate_prompt import PROMPT from langchain.llms.base import BaseLLM class QAGenerateChain(LLMChain): """LLM Chain specifically for generating examples for question answering.""" @classmethod def from_llm(cls, llm: BaseLLM, **kwargs: Any) -> QAGenerateChain: """Load QA Generate Chain from LLM.""" return cls(llm=llm, prompt=PROMPT, **kwargs)