PocketSkye's picture
Initial deployment
0242ab2
Raw
History Blame Contribute Delete
511 Bytes
import json
def parse_workflow(response: str):
try:
response = response.strip()
if response.startswith("```json"):
response = response.replace(
"```json",
""
)
if response.endswith("```"):
response = response[:-3]
response = response.strip()
return json.loads(response)
except Exception as e:
return {
"error": str(e),
"raw_response": response
}