Add BaseCombineDocumentsChain to CombineDocsChainComponent
This commit is contained in:
parent
9bd1c755c4
commit
921e34e378
1 changed files with 2 additions and 11 deletions
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue