refactor(langflow): set advanced flag to True for TemplateFieldCreator class

refactor(langflow): set advanced flag to False for LLMFrontendNode class' api key field
feat(langflow): add show flag to LLMFrontendNode class' model_kwargs field
refactor(langflow): set advanced flag to False and show flag to True for LLMFrontendNode class' model_name and temperature fields
This commit is contained in:
Gabriel Almeida 2023-04-28 19:17:38 -03:00
commit 0fd8f73c08
2 changed files with 7 additions and 2 deletions

View file

@ -23,7 +23,7 @@ class TemplateFieldCreator(BaseModel, ABC):
options: list[str] = [] options: list[str] = []
name: str = "" name: str = ""
display_name: Optional[str] = None display_name: Optional[str] = None
advanced: bool = False advanced: bool = True
def to_dict(self): def to_dict(self):
result = self.dict() result = self.dict()

View file

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