Return the persisted summary for a claim or policy, viewer-tailored.
Code
One generation pass produces every role variant; this read pathselects the variant for the viewer and returns the flattened shape.When no summary has been persisted, ``state`` is ``never_generated``with an empty payload. When a summary generation job is in flight(or recently finished), ``generation_status`` is included for UIpolling.Parameters----------reference_type : str ``CLAIM`` or ``POLICY``.reference_id : str UUID of the claim or policy whose summary is being requested.variant : str, optional Role variant to read. For POLICY: ``agent``, ``underwriter``, ``adjuster``. For CLAIM: ``adjuster``, ``siu``. Omit / null to let the server resolve the variant from the viewer's session role (POLICY) or the reference-type default.Returns-------dict The flattened ``SummaryResponseSchema`` shape: ``reference_type``, ``reference_id``, ``variant``, ``narrative``, ``data_completeness_warning``, ``generated_at``, ``state`` (``generated`` | ``never_generated``), and optional ``generation_status`` (``RUNNING`` | ``SUCCEEDED`` | ``FAILED``).
Queue async regeneration of a claim or policy summary.
Code
When the per-reference-type generation flag is off, returns``status: SKIPPED``. Honors the per-entity cooldown(``SUMMARY_COOLDOWN_SECONDS``): a request within the window raises anerror whose message mentions ``cooldown``. Otherwise queues anAIAgents background job on the matching copilot and returns queuestatus plus ``generation_status`` for UI polling via ``get_summary``.Also serves the empty-state Generate button.Parameters----------reference_type : str ``CLAIM`` or ``POLICY``.reference_id : str UUID of the claim or policy to regenerate.Returns-------dict ``{"status": "QUEUED"|"SKIPPED", "generation_status": {...}?}``.
Persist a generated summary envelope (MCP api-key contact only).
Code
Called exclusively by the copilot agents (via the ``bc-policies`` /``bc-claims`` MCP save tools); human users do not hit this endpoint.The variant key set must equal exactly the keys allowed for thereference type, and each variant value must satisfy the variantcontract. The server sets the generated timestamp.Parameters----------reference_type : str ``CLAIM`` or ``POLICY``.reference_id : str UUID of the claim or policy to attach the summary to.summary : dict The envelope ``{"variants": {"<role>": <variant>}}``. For POLICY the variant keys must be exactly ``agent``, ``underwriter``, ``adjuster``; for CLAIM exactly ``adjuster``, ``siu``. Each variant carries ``narrative`` and ``data_completeness_warning`` (or null).Returns-------dict ``{"saved": true, "generated_at": "<iso>"}`` -- the server-set generation timestamp in UTC.