Skip to content

Commit

Permalink
Expose kwargs in LLMChainExtractor.from_llm (#3748)
Browse files Browse the repository at this point in the history
Re: #3747
  • Loading branch information
ravwojdyla committed Apr 29, 2023
1 parent 512c24f commit 57e0285
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion langchain/retrievers/document_compressors/chain_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ def from_llm(
llm: BaseLanguageModel,
prompt: Optional[PromptTemplate] = None,
get_input: Optional[Callable[[str, Document], str]] = None,
llm_chain_kwargs: Optional[dict] = None,
) -> "LLMChainExtractor":
"""Initialize from LLM."""
_prompt = prompt if prompt is not None else _get_default_chain_prompt()
_get_input = get_input if get_input is not None else default_get_input
llm_chain = LLMChain(llm=llm, prompt=_prompt)
llm_chain = LLMChain(llm=llm, prompt=_prompt, **(llm_chain_kwargs or {}))
return cls(llm_chain=llm_chain, get_input=_get_input)

0 comments on commit 57e0285

Please sign in to comment.