ó
    ³ü¡jÛ  ã                  ód   • S r SSKJr  SSKJr  SSKJrJrJr  \" SS9 " S S5      5       r	SS	 jr
g
)a�  The document an answer is about, stated to the model.

A chunk carries its page heading and its table's caption, and a table's header
rows usually carry the period. A chart on a slide carries none of that: the
deck's date is on its cover, not on the slide. Handed a chart alone, the
answer model refuses to date it, which is the right reading of its own rules.
The period is a property of the document, and the documents table already
holds it, so the route states it ahead of the context on every request.

The header is data the route knows, not prompt text: it is built from the
document row and prepended to the user message, and the system prompt does not
change.
é    )Úannotations)Ú	dataclass)ÚAnyÚMappingÚOptionalT)Úfrozenc                  óz   • \ rS rSr% SrS\S'   SrS\S'   SrS\S'   SrS\S'   Sr	S\S	'   \
SS
 j5       rSS jrSrg)ÚDocumentIdentityé   NzOptional[str]ÚtitleÚissuerÚformÚperiodzOptional[int]Úyearc           	     ó¬   • U " UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      S9$ )z@From a documents-table row as the routes carry it (`_doc_dict`).r   ÚfolderÚfiling_typer   r   )r   r   r   r   r   )Úget)ÚclsÚrows     Ú?/home/mande/repo/quber/src/quber/playground/answers/document.pyÚfrom_rowÚDocumentIdentity.from_row   sL   € ñ Ø—'‘'˜'Ó"Ø—7‘7˜8Ó$Ø—‘˜Ó'Ø—7‘7˜8Ó$Ø—‘˜“ñ
ð 	
ó    c           	     ól  • SR                  S U R                  U R                  4 5       5      nSU R                  4SU R                  4SU R
                  4SU=(       d    S4/nS/U VVs/ s H  u  p4U(       d  M  S	U S
U 3PM     snn-   nUR                  S5        SR                  U5      $ s  snnf )zIThe block that opens the user message. Fields the row lacks are left out.Ú c              3  óH   #   • U  H  o(       d  M  [        U5      v •  M     g 7f)N)Ústr)Ú.0Úps     r   Ú	<genexpr>Ú*DocumentIdentity.header.<locals>.<genexpr>*   s   é € ÐHÒ*B QÃa›&œ#˜aŸ&˜&Ò*Bùs   ‚
"�"ÚTitleÚIssuerÚFormÚPeriodNÚDocumentz  z:  z]Every figure in the context below is from this document unless a chunk states another period.Ú
)Újoinr   r   r   r   r   Úappend)Úselfr   ÚfieldsÚnameÚvalueÚliness         r   ÚheaderÚDocumentIdentity.header(   s²   € à—‘ÑH¨4¯;©;¸¿	¹	Ñ*BÓHÓHˆà�d—j‘jÐ!Ø�t—{‘{Ð#Ø�T—Y‘YÐØ�v—~ Ð&ð	
ˆð �ÉÔYÊ¹+¸$ÔSXÓ 5 " T F¨#¨e¨WÓ 5ÉÒYÑYˆØ�‰Økô	
ð �y‰y˜ÓÐùó	  Zs   Á+B0Á<B0© )r   zMapping[str, Any]Úreturnz'DocumentIdentity')r3   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Ú__annotations__r   r   r   r   Úclassmethodr   r0   Ú__static_attributes__r2   r   r   r
   r
      sK   ‡ à€Eˆ=ÓØ €FˆMÓ Ø€Dˆ-ÓØ €FˆMÓ Ø€Dˆ-Óàó
ó ð
÷ r   r
   c                ó6   • Uc  U $ UR                  5        SU  3$ )zKThe prompt with the document stated first, or unchanged when none is known.z

)r0   )ÚpromptÚdocuments     r   Úwith_documentr>   8   s&   € àÑØˆØ�o‰oÓÐ   V HÐ-Ð-r   N)r<   r   r=   zOptional[DocumentIdentity]r3   r   )Ú__doc__Ú
__future__r   Údataclassesr   Útypingr   r   r   r
   r>   r2   r   r   Ú<module>rC      s<   ðñõ #å !ß )Ñ )ñ �$Ñ÷ ð  ó ð õD.r   