-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Parse JSON component #3167
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
from langflow.io import Output | ||
from langflow.schema import Data | ||
from langflow.schema.message import Message | ||
import jq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does jq work on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah pip should take care of it
https://pypi.org/project/jq/
Let me add the dependency explictly
if len(to_filter): | ||
try: | ||
to_filter = [json.loads(str(f)) for f in to_filter] | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be except JSONDecodeError
?
aca14d4
to
a1ce413
Compare
15ccde8
to
6909344
Compare
Added ParseJSON component that gets Data or Message and uses jq query to extract fields