"""Answers from pre_process: the package is assembled by app/package.py, so no model is called (F02 ADR 0014).""" import json from typing import Any, Optional from kyndryl_agent_runtime.request_cycle import Reply from app import package def _execution_id() -> str: try: from kyndryl_agent_runtime.context import get_workflow_execution_id run = get_workflow_execution_id() except Exception: # an older runtime, or a request from outside a workflow return "" return "" if run in (None, "unknown") else str(run) def pre_process(payload: dict) -> Optional[Any]: return Reply(json.dumps(package.build(payload, _execution_id()), ensure_ascii=False))