mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-05-06 11:39:38 +00:00
4776082c34
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
14 lines
325 B
Python
14 lines
325 B
Python
"""Workflow plugin: parse JSON string."""
|
|
import json
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Parse JSON string to object."""
|
|
text = inputs.get("text", "")
|
|
|
|
try:
|
|
result = json.loads(text)
|
|
return {"result": result}
|
|
except json.JSONDecodeError as e:
|
|
return {"result": None, "error": str(e)}
|