Skip to content

Commit 8b559ed

Browse files
erichareautofix-ci[bot]
authored andcommitted
fix: Accept appropriate types in OpenSearch mm (#12547)
* fix: Accept appropriate types in OpenSearch mm * [autofix.ci] apply automated fixes * Update opensearch_multimodal.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7a43292 commit 8b559ed

6 files changed

Lines changed: 79 additions & 74 deletions

File tree

src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3103,7 +3103,8 @@
31033103
"info": "",
31043104
"input_types": [
31053105
"Data",
3106-
"DataFrame"
3106+
"DataFrame",
3107+
"Table"
31073108
],
31083109
"list": true,
31093110
"list_add_label": "Add More",

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
"id": "FAISS-Ugchq",
107107
"inputTypes": [
108108
"Data",
109-
"DataFrame"
109+
"DataFrame",
110+
"Table"
110111
],
111112
"type": "other"
112113
}
@@ -116,7 +117,7 @@
116117
"source": "RemixDocumentation-aT7Gm",
117118
"sourceHandle": "{œdataTypeœ: œRemixDocumentationœ, œidœ: œRemixDocumentation-aT7Gmœ, œnameœ: œdataframe_outputœ, œoutput_typesœ: [œTableœ]}",
118119
"target": "FAISS-Ugchq",
119-
"targetHandle": "{œfieldNameœ: œingest_dataœ, œidœ: œFAISS-Ugchqœ, œinputTypesœ: [œDataœ, œDataFrameœ], œtypeœ: œotherœ}"
120+
"targetHandle": "{œfieldNameœ: œingest_dataœ, œidœ: œFAISS-Ugchqœ, œinputTypesœ: [œDataœ, œDataFrameœ, œTableœ], œtypeœ: œotherœ}"
120121
},
121122
{
122123
"animated": false,
@@ -2103,7 +2104,8 @@
21032104
"info": "",
21042105
"input_types": [
21052106
"Data",
2106-
"DataFrame"
2107+
"DataFrame",
2108+
"Table"
21072109
],
21082110
"list": true,
21092111
"list_add_label": "Add More",

src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -164,45 +164,18 @@
164164
"id": "AstraDB-mJvb6",
165165
"inputTypes": [
166166
"Data",
167-
"DataFrame"
167+
"DataFrame",
168+
"Table"
168169
],
169170
"type": "other"
170171
}
171172
},
172173
"id": "reactflow__edge-SplitText-NTQIl{œdataTypeœ:œSplitTextœ,œidœ:œSplitText-NTQIlœ,œnameœ:œdataframeœ,œoutput_typesœ:[œDataFrameœ]}-AstraDB-mJvb6{œfieldNameœ:œingest_dataœ,œidœ:œAstraDB-mJvb6œ,œinputTypesœ:[œDataœ,œDataFrameœ],œtypeœ:œotherœ}",
173174
"selected": false,
174-
"source": "SplitText-NTQIl",
175-
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-NTQIlœ, œnameœ: œdataframeœ, œoutput_typesœ: [œDataFrameœ]}",
176-
"target": "AstraDB-mJvb6",
177-
"targetHandle": "{œfieldNameœ: œingest_dataœ, œidœ: œAstraDB-mJvb6œ, œinputTypesœ: [œDataœ, œDataFrameœ], œtypeœ: œotherœ}"
178-
},
179-
{
180-
"animated": false,
181-
"className": "",
182-
"data": {
183-
"sourceHandle": {
184-
"dataType": "ChatInput",
185-
"id": "ChatInput-z5C0I",
186-
"name": "message",
187-
"output_types": [
188-
"Message"
189-
]
190-
},
191-
"targetHandle": {
192-
"fieldName": "search_query",
193-
"id": "AstraDB-ZiGZI",
194-
"inputTypes": [
195-
"Message"
196-
],
197-
"type": "query"
198-
}
199-
},
200-
"id": "reactflow__edge-ChatInput-z5C0I{œdataTypeœ:œChatInputœ,œidœ:œChatInput-z5C0Iœ,œnameœ:œmessageœ,œoutput_typesœ:[œMessageœ]}-AstraDB-ZiGZI{œfieldNameœ:œsearch_queryœ,œidœ:œAstraDB-ZiGZIœ,œinputTypesœ:[œMessageœ],œtypeœ:œqueryœ}",
201-
"selected": false,
202-
"source": "ChatInput-z5C0I",
203-
"sourceHandle": "{œdataTypeœ: œChatInputœ, œidœ: œChatInput-z5C0Iœ, œnameœ: œmessageœ, œoutput_typesœ: [œMessageœ]}",
204-
"target": "AstraDB-ZiGZI",
205-
"targetHandle": "{œfieldNameœ: œsearch_queryœ, œidœ: œAstraDB-ZiGZIœ, œinputTypesœ: [œMessageœ], œtypeœ: œqueryœ}"
175+
"source": "SplitText-dswy4",
176+
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-dswy4œ, œnameœ: œdataframeœ, œoutput_typesœ: [œTableœ]}",
177+
"target": "AstraDB-2kFlp",
178+
"targetHandle": "{œfieldNameœ: œingest_dataœ, œidœ: œAstraDB-2kFlpœ, œinputTypesœ: [œDataœ, œDataFrameœ, œTableœ], œtypeœ: œotherœ}"
206179
},
207180
{
208181
"animated": false,
@@ -3461,7 +3434,8 @@
34613434
"info": "",
34623435
"input_types": [
34633436
"Data",
3464-
"DataFrame"
3437+
"DataFrame",
3438+
"Table"
34653439
],
34663440
"list": true,
34673441
"list_add_label": "Add More",
@@ -4296,7 +4270,8 @@
42964270
"info": "",
42974271
"input_types": [
42984272
"Data",
4299-
"DataFrame"
4273+
"DataFrame",
4274+
"Table"
43004275
],
43014276
"list": true,
43024277
"list_add_label": "Add More",

src/lfx/src/lfx/_assets/component_index.json

Lines changed: 53 additions & 29 deletions
Large diffs are not rendered by default.

src/lfx/src/lfx/base/vectorstores/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init_subclass__(cls, **kwargs):
6060
HandleInput(
6161
name="ingest_data",
6262
display_name="Ingest Data",
63-
input_types=["Data", "DataFrame"],
63+
input_types=["Data", "DataFrame", "Table"],
6464
is_list=True,
6565
),
6666
QueryInput(

src/lfx/src/lfx/components/elastic/opensearch_multimodal.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
)
2626
from lfx.log import logger
2727
from lfx.schema.data import Data
28+
from lfx.schema.dataframe import Table
2829

2930
REQUEST_TIMEOUT = 60
3031
MAX_RETRIES = 5
@@ -154,7 +155,7 @@ class OpenSearchVectorStoreComponentMultimodalMultiEmbedding(LCVectorStoreCompon
154155
},
155156
],
156157
value=[],
157-
input_types=["Data"],
158+
input_types=["Data", "JSON"],
158159
),
159160
StrInput(
160161
name="opensearch_url",
@@ -1981,17 +1982,17 @@ def search(self, query: str | None = None) -> list[dict[str, Any]]:
19811982
for hit in hits
19821983
]
19831984

1984-
def search_documents(self) -> list[Data]:
1985+
def search_documents(self) -> Table:
19851986
"""Search documents and return results as Data objects.
19861987
19871988
This is the main interface method that performs the multi-model search using the
1988-
configured search_query and returns results in Langflow's Data format.
1989+
configured search_query and returns results in Langflow's Table format.
19891990
19901991
Always builds the vector store (triggering ingestion if needed), then performs
19911992
search only if a query is provided.
19921993
19931994
Returns:
1994-
List of Data objects containing search results with text and metadata
1995+
Table: A table containing search results with text and metadata
19951996
19961997
Raises:
19971998
Exception: If search operation fails
@@ -2010,7 +2011,9 @@ def search_documents(self) -> list[Data]:
20102011

20112012
# Perform search with the provided query
20122013
raw = self.search(search_query)
2013-
return [Data(text=hit["page_content"], **hit["metadata"]) for hit in raw]
2014+
raw_list = [Data(text=hit["page_content"], **hit["metadata"]) for hit in raw]
2015+
2016+
return Table(data=raw_list)
20142017
except Exception as e:
20152018
self.log(f"search_documents error: {e}")
20162019
raise

0 commit comments

Comments
 (0)