Add logger import and update input_types in add_new_variables_to_template function

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-25 11:43:14 -03:00
commit ad25be1815

View file

@ -1,4 +1,6 @@
from fastapi import APIRouter, HTTPException from fastapi import APIRouter, HTTPException
from loguru import logger
from langflow.api.v1.base import ( from langflow.api.v1.base import (
Code, Code,
CodeValidationResponse, CodeValidationResponse,
@ -8,7 +10,6 @@ from langflow.api.v1.base import (
) )
from langflow.template.field.base import TemplateField from langflow.template.field.base import TemplateField
from langflow.utils.validate import validate_code from langflow.utils.validate import validate_code
from loguru import logger
# build router # build router
router = APIRouter(prefix="/validate", tags=["Validate"]) router = APIRouter(prefix="/validate", tags=["Validate"])
@ -81,7 +82,7 @@ def add_new_variables_to_template(input_variables, prompt_request):
show=True, show=True,
advanced=False, advanced=False,
multiline=True, multiline=True,
input_types=["Document", "BaseOutputParser"], input_types=["Document", "BaseOutputParser", "Text"],
value="", # Set the value to empty string value="", # Set the value to empty string
) )
if variable in prompt_request.frontend_node.template: if variable in prompt_request.frontend_node.template: