23 unmodified lines2425262728293023 unmodified lines data = json.loads(model_output) # Try parsing the model output except json.JSONDecodeError: return model_output # Return raw model output if it's not valid JSON data["amount"] = amount # if amount: # try: