mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-30 00:34:58 +00:00
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)}
|