Merge branch 'NodeModal' of personal:logspace-ai/langflow into NodeModal

This commit is contained in:
anovazzi1 2023-04-28 19:41:26 -03:00
commit cfe74e6765
6 changed files with 112 additions and 2 deletions

View file

@ -23,7 +23,7 @@ class TemplateFieldCreator(BaseModel, ABC):
options: list[str] = []
name: str = ""
display_name: Optional[str] = None
advanced: bool = False
advanced: bool = True
def to_dict(self):
result = self.dict()
@ -241,4 +241,4 @@ class FrontendNode(BaseModel):
# If the field.name contains api or api and key, then it might be an api key
# other conditions are to make sure that it is not an input or output variable
if "api" in key.lower() and "key" in key.lower():
field.required = False
field.required = False

View file

@ -448,6 +448,7 @@ class LLMFrontendNode(FrontendNode):
# Required should be False to support
# loading the API key from environment variables
field.required = False
field.advanced = False
if field.name == "task":
field.required = True
@ -461,3 +462,7 @@ class LLMFrontendNode(FrontendNode):
if field.name == "model_kwargs":
field.field_type = "code"
field.advanced = True
field.show = True
elif field.name in ["model_name", "temperature"]:
field.advanced = False
field.show = True