Comments (1)
The issue you're encountering seems to be related to how the Records Output
component handles complex data structures returned by your custom SearXNG
component. Specifically, the error message indicates that the component is trying to render an object directly as a React child, which is not allowed.
Here are a few steps to help diagnose and potentially resolve the issue:
-
Check the Data Structure:
Ensure that the data returned by yourSearXNG
component is in the expected format. TheRecords Output
component expects an array of records. Each record should be a flat object without nested objects or arrays. -
Modify the Custom Component:
If yourSearXNG
component returns nested objects, you might need to flatten the data before returning it. Here's an example of how you can modify yourbuild
method to flatten the data:def flatten_dict(d, parent_key='', sep='_'): items = [] for k, v in d.items(): new_key = f"{parent_key}{sep}{k}" if parent_key else k if isinstance(v, dict): items.extend(flatten_dict(v, new_key, sep=sep).items()) else: items.append((new_key, v)) return dict(items) def build(self, searx_host: str, query: str, num_results: str = 5) -> Record: from langchain_community.utilities import SearxSearchWrapper s = SearxSearchWrapper(searx_host=searx_host) links = s.results(query=query, num_results=num_results) flattened_links = [flatten_dict(link) for link in links] return Record(links=flattened_links)
-
Update the
TableAutoCellRender
:
If you need to handle nested objects or arrays within the cells, ensure that theTableAutoCellRender
function is correctly rendering these types. The function should use components likeObjectRender
andArrayReader
to handle nested data:function getCellType(value) { switch (typeof value) { case "object": if (value === null) { return String(value); } else if (Array.isArray(value)) { return <ArrayReader array={value} />; } else { return <ObjectRender object={value} />; } case "string": return <StringReader string={value} />; case "number": return <NumberReader number={value} />; default: return String(value); } }
-
Error Handling:
Ensure that theTableComponent
has proper error handling for unexpected or malformed data structures. If therowData
is empty or contains invalid data, it should display an appropriate message instead of crashing:if (props.rowData.length === 0) { return ( <div className="flex h-full w-full items-center justify-center rounded-md border"> <Alert variant={"default"} className="w-fit"> <ForwardedIconComponent name="AlertCircle" className="h-5 w-5 text-primary" /> <AlertTitle>{alertTitle}</AlertTitle> <AlertDescription>{alertDescription}</AlertDescription> </Alert> </div> ); }
By ensuring that the data structure is flat and that the rendering functions handle nested objects and arrays correctly, you should be able to prevent the client from crashing when displaying the records output. If the issue persists, you might need to add additional logging or debugging to identify the exact cause of the crash.
To continue talking to Dosu, mention @dosu.
from langflow.
Related Issues (20)
- Faiss search error HOT 2
- The outout of the Chat Input is not been recognized as text by OpenAI model HOT 4
- Error Building Component Error building Component Astra DB: {"errors":[{"message":"Request invalid: field 'command.name' value \"english-test\" not valid. Problem: must match \"[a-zA-Z][a-zA-Z0-9_]*\".","errorCode":"COMMAND_FIELD_INVALID"}]} HOT 1
- ValidationError: 2 validation errors for HumanMessage at v1.0.0a59 HOT 2
- Encountering error in building ASTRA DB Search node in the canvas. Error Building Component Error building Component Astra DB Search: Invalid inputs provided. HOT 4
- API Request ERROR HOT 3
- [Feature Request]: Allow local cassandra connections
- idea
- [Request] Please add openrouter as LLM Model
- Nested chats HOT 1
- Module langflow.inputs not found HOT 1
- CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads HOT 1
- Questions about Run Flow HOT 1
- An error was thrown while using the groq component HOT 1
- Question: Hugging Face API HOT 1
- Issue with Chat Input component HOT 5
- Question: Inquiry on Session Management and Parameter Passing in Langflow API HOT 3
- Langflow Store Suspension HOT 1
- Documentation to use Flow as Tool HOT 3
- Method not Allowed on API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langflow.