File size: 904 Bytes
aad7814
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Minimum AI: in-place fact update on the REFERENCE baseline."""

from __future__ import annotations

from backend.core.reference_mapper import map_reference_paragraph
from backend.models.schema import TemplateSchema


def map_minimum_reference(
    reference_paragraph: str,
    observations: list[str],
    schema: TemplateSchema,
    *,
    section_title: str = "",
    section_id: str = "",
) -> str:
    """Keep the whole reference paragraph; apply in-place fact updates only."""
    return map_reference_paragraph(
        reference_paragraph,
        observations,
        schema,
        "minimum",
        section_id=section_id,
        section_title=section_title,
    )


def weave_minimum_ai(observations: list[str], reference_paragraph: str) -> str:
    from backend.models.schema import TemplateSchema

    return map_minimum_reference(reference_paragraph, observations, TemplateSchema())