refactor(nodes.py): set 'required' field to False for API key and token fields to support loading from environment variables

This commit is contained in:
Gabriel Almeida 2023-04-17 18:51:31 -03:00 committed by Gabriel Luiz Freitas Almeida
commit c6d2d96da8

View file

@ -445,7 +445,9 @@ class LLMFrontendNode(FrontendNode):
if "api" in field.name and ("key" in field.name or "token" in field.name):
field.password = True
field.show = True
field.required = True
# Required should be False to support
# loading the API key from environment variables
field.required = False
if field.name == "task":
field.required = True