🔧 fix(validate.py): add "BaseOutputParser" to the list of input_types in the template_field
🔧 fix(settings.py): add "output_parsers" attribute to the Settings class
The "input_types" list in the template_field of the post_validate_prompt function in validate.py was missing the "BaseOutputParser" type. This fix adds it to the list to ensure proper validation.
The Settings class in settings.py was missing the "output_parsers" attribute. This fix adds the attribute to the class to ensure that the list of output parsers can be properly configured and accessed.
This commit is contained in:
parent
e87a475584
commit
3167330cbc
2 changed files with 6 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ def post_validate_prompt(prompt: ValidatePromptRequest):
|
||||||
field_type="str",
|
field_type="str",
|
||||||
show=True,
|
show=True,
|
||||||
advanced=False,
|
advanced=False,
|
||||||
input_types=["BaseLoader"],
|
input_types=["BaseLoader", "BaseOutputParser"],
|
||||||
)
|
)
|
||||||
|
|
||||||
prompt.frontend_node.template[variable] = template_field.to_dict()
|
prompt.frontend_node.template[variable] = template_field.to_dict()
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class Settings(BaseSettings):
|
||||||
toolkits: List[str] = []
|
toolkits: List[str] = []
|
||||||
textsplitters: List[str] = []
|
textsplitters: List[str] = []
|
||||||
utilities: List[str] = []
|
utilities: List[str] = []
|
||||||
|
output_parsers: List[str] = []
|
||||||
dev: bool = False
|
dev: bool = False
|
||||||
database_url: str = "sqlite:///./langflow.db"
|
database_url: str = "sqlite:///./langflow.db"
|
||||||
cache: str = "InMemoryCache"
|
cache: str = "InMemoryCache"
|
||||||
|
|
@ -48,6 +49,10 @@ class Settings(BaseSettings):
|
||||||
self.toolkits = new_settings.toolkits or []
|
self.toolkits = new_settings.toolkits or []
|
||||||
self.textsplitters = new_settings.textsplitters or []
|
self.textsplitters = new_settings.textsplitters or []
|
||||||
self.utilities = new_settings.utilities or []
|
self.utilities = new_settings.utilities or []
|
||||||
|
self.embeddings = new_settings.embeddings or []
|
||||||
|
self.vectorstores = new_settings.vectorstores or []
|
||||||
|
self.documentloaders = new_settings.documentloaders or []
|
||||||
|
self.output_parsers = new_settings.output_parsers or []
|
||||||
self.dev = dev
|
self.dev = dev
|
||||||
|
|
||||||
def update_settings(self, **kwargs):
|
def update_settings(self, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue