Remove base class limitations
This commit is contained in:
parent
bb732f5264
commit
71de618519
2 changed files with 2 additions and 15 deletions
|
|
@ -5,10 +5,7 @@ from typing import ClassVar, Dict, List, Optional, Union
|
|||
from pydantic import BaseModel, Field, field_serializer, model_serializer
|
||||
|
||||
from langflow.template.field.base import TemplateField
|
||||
from langflow.template.frontend_node.constants import (
|
||||
CLASSES_TO_REMOVE,
|
||||
FORCE_SHOW_FIELDS,
|
||||
)
|
||||
from langflow.template.frontend_node.constants import FORCE_SHOW_FIELDS
|
||||
from langflow.template.frontend_node.formatter import field_formatters
|
||||
from langflow.template.template.base import Template
|
||||
from langflow.utils import constants
|
||||
|
|
@ -88,7 +85,7 @@ class FrontendNode(BaseModel):
|
|||
def process_base_classes(self, base_classes: List[str]) -> List[str]:
|
||||
"""Removes unwanted base classes from the list of base classes."""
|
||||
|
||||
return [base_class for base_class in base_classes if base_class not in CLASSES_TO_REMOVE]
|
||||
return list(set(base_classes))
|
||||
|
||||
@field_serializer("display_name")
|
||||
def process_display_name(self, display_name: str) -> str:
|
||||
|
|
|
|||
|
|
@ -63,13 +63,3 @@ You can change this to use other APIs like JinaChat, LocalAI and Prem.
|
|||
|
||||
INPUT_KEY_INFO = """The variable to be used as Chat Input when more than one variable is available."""
|
||||
OUTPUT_KEY_INFO = """The variable to be used as Chat Output (e.g. answer in a ConversationalRetrievalChain)"""
|
||||
|
||||
|
||||
CLASSES_TO_REMOVE = [
|
||||
"RunnableSerializable",
|
||||
"Serializable",
|
||||
"BaseModel",
|
||||
"object",
|
||||
"Runnable",
|
||||
"Generic",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue