[simple] added test case and improve self class return type annotation (#3773)

a simple follow up of https://github.com/hwchase17/langchain/pull/3748
- added test case
- improve annotation when function return type is class itself.
This commit is contained in:
Mike Wang
2023-04-28 21:54:07 -07:00
committed by GitHub
parent 0c0f14407c
commit ce4fea983b
2 changed files with 11 additions and 1 deletions

View File

@@ -4,6 +4,14 @@ from langchain.retrievers.document_compressors import LLMChainExtractor
from langchain.schema import Document
def test_llm_construction_with_kwargs() -> None:
llm_chain_kwargs = {"verbose": True}
compressor = LLMChainExtractor.from_llm(
ChatOpenAI(), llm_chain_kwargs=llm_chain_kwargs
)
assert compressor.llm_chain.verbose is True
def test_llm_chain_extractor() -> None:
texts = [
"The Roman Empire followed the Roman Republic.",