🔨 refactor(base.py): add LLMCheckerChain to from_method_nodes dictionary

🔨 refactor(chains.py): comment out unused code block
The `from_method_nodes` dictionary in `base.py` has been updated to include the `LLMCheckerChain` class. This allows the `from_llm` method to be called on the `LLMCheckerChain` class.

The code block in `chains.py` that deals with the `PromptTemplate` field type has been commented out as it is currently unused. This is to prevent confusion and to keep the codebase clean.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-16 08:55:38 -03:00
commit 4faa1e7240
2 changed files with 12 additions and 1 deletions

View file

@ -20,7 +20,10 @@ class ChainCreator(LangChainTypeCreator):
return ChainFrontendNode
#! We need to find a better solution for this
from_method_nodes = {"ConversationalRetrievalChain": "from_llm"}
from_method_nodes = {
"ConversationalRetrievalChain": "from_llm",
"LLMCheckerChain": "from_llm",
}
@property
def type_to_loader_dict(self) -> Dict:

View file

@ -33,6 +33,14 @@ class ChainFrontendNode(FrontendNode):
field.show = True
field.advanced = True
# We should think of a way to deal with this later
# if field.field_type == "PromptTemplate":
# field.field_type = "str"
# field.multiline = True
# field.show = True
# field.advanced = False
# field.value = field.value.template
# Separated for possible future changes
if field.name == "prompt" and field.value is None:
field.required = True