INNER CODE UNIT · Python
from_llm
junruxiong/IncarnaMind · convo_qa_chain.py:324
def from_llm(
cls,
llm: BaseLanguageModel,
retriever: BaseRetriever,
condense_question_prompt: BasePromptTemplate = prompt_templates.get_refine_qa_template(
configs.model_name
),
chain_type: str = "stuff", # only support stuff chain now
verbose: bool = False,
condense_question_llm: Optional[BaseLanguageModel] = None,
combine_docs_chain_kwargs: Optional[Dict] = None,
callbacks: Callbacks = None,
**kwargs: Any,
) -> BaseConversationalRetrievalChain:
"""Convenience method to load chain from LLM and retriever.
This provides some logic to create the `question_generator` chain
as well as the combine_docs_chain.