diff --git a/src/backend/langflow/components/chains/CombineDocsChain.py b/src/backend/langflow/components/chains/CombineDocsChain.py index d18cec63a..0697d00bb 100644 --- a/src/backend/langflow/components/chains/CombineDocsChain.py +++ b/src/backend/langflow/components/chains/CombineDocsChain.py @@ -2,6 +2,7 @@ from langflow import CustomComponent from langflow.field_typing import BaseLanguageModel, Chain from typing import Union, Callable +from langchain.chains.combine_documents.base import BaseCombineDocumentsChain class CombineDocsChainComponent(CustomComponent): display_name = "CombineDocsChain" @@ -24,14 +25,4 @@ class CombineDocsChainComponent(CustomComponent): if chain_type not in ['stuff', 'map_reduce', 'map_rerank', 'refine']: raise ValueError(f"Invalid chain_type: {chain_type}") - # Implement the logic to create and return the appropriate chain based on the chain_type - # This could be a placeholder for now, as the specific chain loading function is not defined. - # Replace with actual implementation when available. - return load_qa_chain(llm=llm, chain_type=chain_type) - -# Assuming there is a function or class `load_qa_chain` that creates the chain -# based on the `chain_type` and `llm`. This is a placeholder for the actual -# implementation which should be replaced with the correct function/class call. -def load_qa_chain(llm: BaseLanguageModel, chain_type: str) -> Union[Chain, Callable]: - # Implement the logic to create and return the appropriate chain based on the chain_type - pass + return BaseCombineDocumentsChain() \ No newline at end of file