feat: adds new queryInput with separator and dialog (#7458)
* Add Query Input and Mixin on backend * Adds Query on supported types * Adds types for query modal and component * Adds size for new query modal * Adds query modal * Adds query component * Adds query component on parameter render * [autofix.ci] apply automated fixes * ✨ (switch-case-size.ts): Update height value to 'h-fit' for 'small-query' case to improve responsiveness ✨ (queryInputComponent.spec.ts): Add unit test for user interaction with query input component, including updating code and testing functionality * Fixed handle not working on Query Input --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
6f259c6bee
commit
404e04989a
14 changed files with 434 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ from .inputs import (
|
|||
MultiselectInput,
|
||||
NestedDictInput,
|
||||
PromptInput,
|
||||
QueryInput,
|
||||
SecretStrInput,
|
||||
SliderInput,
|
||||
SortableListInput,
|
||||
|
|
@ -54,6 +55,7 @@ __all__ = [
|
|||
"MultiselectInput",
|
||||
"NestedDictInput",
|
||||
"PromptInput",
|
||||
"QueryInput",
|
||||
"SecretStrInput",
|
||||
"SliderInput",
|
||||
"SortableListInput",
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class FieldTypes(str, Enum):
|
|||
LINK = "link"
|
||||
SLIDER = "slider"
|
||||
TAB = "tab"
|
||||
QUERY = "query"
|
||||
|
||||
|
||||
SerializableFieldTypes = Annotated[FieldTypes, PlainSerializer(lambda v: v.value, return_type=str)]
|
||||
|
|
@ -142,6 +143,11 @@ class AuthMixin(BaseModel):
|
|||
auth_tooltip: str | None = Field(default="")
|
||||
|
||||
|
||||
class QueryMixin(BaseModel):
|
||||
separator: str | None = Field(default=None)
|
||||
"""Separator for the query input. Defaults to None."""
|
||||
|
||||
|
||||
# Specific mixin for fields needing file interaction
|
||||
class FileMixin(BaseModel):
|
||||
file_path: list[str] | str | None = Field(default="")
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from .input_mixin import (
|
|||
ListableInputMixin,
|
||||
MetadataTraceMixin,
|
||||
MultilineMixin,
|
||||
QueryMixin,
|
||||
RangeMixin,
|
||||
SerializableFieldTypes,
|
||||
SliderMixin,
|
||||
|
|
@ -492,6 +493,22 @@ class AuthInput(BaseInputMixin, AuthMixin, MetadataTraceMixin):
|
|||
show: bool = False
|
||||
|
||||
|
||||
class QueryInput(MessageTextInput, QueryMixin):
|
||||
"""Represents a query input field.
|
||||
|
||||
This class represents an query input field and provides functionality for handling search values.
|
||||
It inherits from the `BaseInputMixin` and `QueryMixin` classes.
|
||||
|
||||
Attributes:
|
||||
field_type (SerializableFieldTypes): The field type of the input. Defaults to FieldTypes.SEARCH.
|
||||
separator (str | None): The separator for the query input. Defaults to None.
|
||||
value (str): The value for the query input. Defaults to an empty string.
|
||||
"""
|
||||
|
||||
field_type: SerializableFieldTypes = FieldTypes.QUERY
|
||||
separator: str | None = Field(default=None)
|
||||
|
||||
|
||||
class SortableListInput(BaseInputMixin, SortableListMixin, MetadataTraceMixin, ToolModeMixin):
|
||||
"""Represents a list selection input field.
|
||||
|
||||
|
|
@ -606,6 +623,7 @@ class DefaultPromptField(Input):
|
|||
InputTypes: TypeAlias = (
|
||||
Input
|
||||
| AuthInput
|
||||
| QueryInput
|
||||
| DefaultPromptField
|
||||
| BoolInput
|
||||
| DataInput
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from langflow.inputs import (
|
|||
MultiselectInput,
|
||||
NestedDictInput,
|
||||
PromptInput,
|
||||
QueryInput,
|
||||
SecretStrInput,
|
||||
SliderInput,
|
||||
StrInput,
|
||||
|
|
@ -50,6 +51,7 @@ __all__ = [
|
|||
"NestedDictInput",
|
||||
"Output",
|
||||
"PromptInput",
|
||||
"QueryInput",
|
||||
"SecretStrInput",
|
||||
"SliderInput",
|
||||
"StrInput",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue