Ë
    º= iæG  ã                   ó  — d Z ddlZddlZddlZddlmZ ddlmZmZmZm	Z	 ddl
Z
ddlmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d«      Zy)z¥
Table Inference with LLM

Uses PydanticAI with various model providers to analyze tables and generate
meaningful titles and descriptions based on document context.
é    N)Údatetime)ÚAnyÚDictÚListÚOptional)Úlogger)Ú	BaseModelÚFieldé   )ÚAgentFactory)ÚModelProvider)ÚEnhancedTableParserÚTableMetadata)Úload_prompt)ÚConfigÚsetup_loggingc                   ó  — e Zd ZU dZ ed¬«      Zeed<    ed¬«      Zeed<    ed¬«      Z	e
e   ed<    ed	d
¬«      Zee   ed<    ed¬«      Zeed<    ed	d¬«      Zee   ed<    ed	d¬«      Zee   ed<    ed¬«      Zeed<   y	)ÚTableContextz!Input context for table analysis.z#3-4 sentence document-level summary©ÚdescriptionÚexecutive_summaryz#Title generated by procedural rulesÚprocedural_titlezIndividual headers foundÚheadersNzText that describes the table)Údefaultr   Údescriptive_textzFirst few rows of the tableÚtable_previewzText before the tableÚpreceding_textz-Extended page-level context including headersÚpage_contextzPage where table appearsÚpage_number)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   ÚstrÚ__annotations__r   r   r   r   r   r   r   r   r   Úint© ó    ú>/home/mande/repo/quber/src/quber/processors/table_inference.pyr   r      sž   … Ù+á"Ð/TÔUÐ�sÓUÙ!Ð.SÔTÐ�cÓTÙÐ+EÔF€GˆT�#‰YÓFÙ&+°DÐFeÔ&fÐ�h˜s‘mÓfÙÐ+HÔI€M�3ÓIÙ$)°$ÐD[Ô$\€N�H˜S‘MÓ\Ù"'°ÐBqÔ"r€L�(˜3‘-ÓrÙÐ)CÔD€K�ÔDr(   r   c                   óJ   — e Zd ZU dZ ed¬«      Zeed<    ed¬«      Zeed<   y)Ú	TableInfoz'LLM-inferred information about a table.z"Clear, concise title for the tabler   ÚtitlezJFunctional description of what the table contains and how it might be usedr   N)	r    r!   r"   r#   r
   r,   r$   r%   r   r'   r(   r)   r+   r+   &   s)   … Ù1áÐ#GÔH€Eˆ3ÓHÙØ`ô€K�ô r(   r+   c                   ó.   — e Zd ZU dZ ed¬«      Zeed<   y)ÚExecutiveSummaryz Executive summary of a document.z.3-4 sentence executive summary of the documentr   ÚsummaryN)r    r!   r"   r#   r
   r/   r$   r%   r'   r(   r)   r.   r.   /   s   … Ù*áÐ%UÔV€GˆSÔVr(   r.   c                   ób  — e Zd ZdZ	 	 	 ddee   dee   dee   fd„Z	 d de	dee   d	ee   d
e
eef   fd„Z	 	 	 ddee	   dee
eef      d	ee   dee   d
ee
eef      f
d„Zded
efd„Zd!dee   ded
efd„Zd"deded
efd„Zd
efd„Zded
e
eef   fd„Zde
eef   defd„Zde
eef   defd„Zy)#ÚTableInferenceProcessorz8Process tables with LLM inference for enhanced metadata.NÚproviderÚmodelÚconfigc                 ó¾  — |xs t        j                  «       | _        || _        || _        t        d| j                  j                  | j                  j                  ¬«       t        dd«      }t        | j                  j                  ¬«      | _
        | j                  j                  t        |||¬«      | _        t        j                  d|xs d› d	|xs d
› �«       y)a?  
        Initialize the processor with specified configuration.

        Args:
            provider: Model provider to use (auto-detected if not specified)
            model: Specific model to use (uses default if not specified)
            config: Configuration object (loads from environment if not provided)
        ztable-inference)Úservice_nameÚenable_logfireÚ	log_levelÚtable_inferenceÚsystem)r7   ©Úoutput_typeÚsystem_promptr2   r3   z3Initialized TableInferenceProcessor with provider: Úautoz	, model: r   N)r   Úloadr4   r2   r3   r   r7   r8   r   r   Úagent_factoryÚcreate_agentr+   Úagentr   Údebug)Úselfr2   r3   r4   r=   s        r)   Ú__init__z TableInferenceProcessor.__init__8   sË   € ð Ò-¤§¡£ˆŒØ ˆŒØˆŒ
ô 	Ø*ØŸ;™;×5Ñ5Ø—k‘k×+Ñ+õ	
ô $Ð$5°xÓ@ˆô *¸¿¹×9SÑ9SÔTˆÔð ×'Ñ'×4Ñ4Ü!Ø'ØØð	 5ó 
ˆŒ
ô 	�‰ØAÀ(ÒBTÈfÐAUÐU^Ð_dÒ_qÐhqÐ^rÐsõ	
r(   Úmetadatar   r   Úreturnc              ƒ   óz  K  — t        |xs d|j                  xs d|j                  xs g |j                  |j                  |j
                  ||j                  ¬«      }	 | j                  |«      }| j                  j                  ret        j                  d|j                  |j                  ¬«      5  | j                  j                  |«      ƒ d{  –—† }|j                  }ddd«       n/| j                  j                  |«      ƒ d{  –—† }|j                  }t!        j"                  d|j                  › �«       |j                  |j                  |j                  |j                  |j                  |j
                  j*                  |j,                  |j                  |j.                  |j0                  |j2                  dœdœ
S 7 Œó# 1 sw Y   Œ¶xY w7 ŒÉ# t$        $ rZ}t!        j&                  d|j                  › d	|› �«       t)        |j                  xs d
|j                  dz   › �d¬«      }Y d}~Œ÷d}~ww xY w­w)aY  
        Analyze a single table with LLM inference.

        Args:
            metadata: Table metadata from enhanced parser
            page_context: Extended context from the page
            executive_summary: Document-level executive summary

        Returns:
            Dictionary with both procedural and LLM-inferred information
        zNo document summary availablezUntitled Table)r   r   r   r   r   r   r   r   Úanalyze_table)Útable_idÚpageNzSuccessfully analyzed table zLLM inference failed for table z: zTable é   zUnable to generate description)r,   r   )ÚrowsÚcolsÚ
first_cell)
rJ   rK   r   r   r   r   Ú	llm_titleÚllm_descriptionÚtable_markdownrF   )r   Úconsolidated_headerr   r   rR   r   r   Ú_format_promptr4   r7   ÚlogfireÚspanÚtable_indexrB   ÚrunÚoutputr   rC   Ú	ExceptionÚerrorr+   r,   r   rM   rN   Úfirst_cell_content)	rD   rF   r   r   ÚcontextÚpromptÚresultÚllm_infoÚes	            r)   rI   z%TableInferenceProcessor.analyze_tablec   sð  è ø€ ô Ø/ÒRÐ3RØ%×9Ñ9ÒMÐ=MØ×$Ñ$Ò*¨Ø%×6Ñ6Ø"×1Ñ1Ø#×2Ñ2Ø%Ø ×,Ñ,ô	
ˆð	Ø×(Ñ(¨Ó1ˆFà�{‰{×)Ò)Ü—\‘\ /¸H×<PÑ<PÐW_×WkÑWkÖlØ#'§:¡:§>¡>°&Ó#9×9�FØ%Ÿ}™}�H÷ mÐlð  $Ÿz™zŸ~™~¨fÓ5×5�Ø!Ÿ=™=�ä�L‰LÐ7¸×8LÑ8LÐ7MÐNÔOð !×,Ñ,Ø×(Ñ(Ø (× <Ñ <Ø×'Ñ'Ø (× 9Ñ 9Ø&×5Ñ5Ø!Ÿ™Ø'×3Ñ3Ø&×5Ñ5à Ÿ™Ø Ÿ™Ø&×9Ñ9ññ
ð 	
ð! :ø÷ mÐlúð 6ùô
 ò 	Ü�L‰LÐ:¸8×;OÑ;OÐ:PÐPRÐSTÐRUÐVÔWÜ Ø×2Ñ2ÒY¸¸x×?SÑ?SÐVWÑ?WÐ>XÐ6YØ<ô�Hûð	üsi   ‚AH;ÁAG Â2GÃGÃGÃ"'G Ä	GÄ
2G Ä<B	H;ÇGÇGÇG Ç	H8ÇAH3È.H;È3H8È8H;Úmetadata_listÚpage_contextsÚmax_concurrentc              ƒ   óx  ‡ ‡‡‡	K  — |xs ‰ j                   j                  }‰xs i Št        j                  |«      Š	dt        fˆˆˆ ˆ	fd„}|D �cg c]
  } ||«      ‘Œ }}t        j                  dt        |«      |¬«      5  t        j                  |Ž ƒ d{  –—† }ddd«       |S c c}w 7 Œ# 1 sw Y   S xY w­w)a³  
        Analyze multiple tables concurrently with rate limiting.

        Args:
            metadata_list: List of table metadata to analyze
            page_contexts: Optional dict mapping table indices to page contexts
            executive_summary: Document-level executive summary
            max_concurrent: Maximum concurrent analyses (uses config default if None)

        Returns:
            List of analysis results
        rF   c              “   óæ   •K  — ‰4 ƒd {  –—†  ‰j                  | j                  «      }‰j                  | |‰«      ƒ d {  –—† cd d d «      ƒd {  –—†  S 7 ŒK7 Œ7 Œ	# 1 ƒd {  –—†7  sw Y   y xY w­w)N)ÚgetrW   rI   )rF   r   r   rc   rD   Ú	semaphores     €€€€r)   Úanalyze_with_limitzHTableInferenceProcessor.analyze_tables_batch.<locals>.analyze_with_limit½   sR   øè ø€ ß ’yØ,×0Ñ0°×1EÑ1EÓF�Ø!×/Ñ/°¸,ÐHYÓZ×Z÷ !—y’yøàZøð !ø—y—y‘yüsV   ƒA1ŠA‹A1Ž2AÁ AÁAÁA1ÁAÁA1ÁAÁA1ÁA.Á"A%Á#A.Á*A1Úanalyze_tables_batch)Útotal_tablesrd   N)	r4   Úmax_concurrent_tablesÚasyncioÚ	Semaphorer   rU   rV   ÚlenÚgather)
rD   rb   rc   r   rd   ri   rF   ÚtasksÚresultsrh   s
   ` ``     @r)   rj   z,TableInferenceProcessor.analyze_tables_batch¤   sº   ûè ø€ ð& (ÒL¨4¯;©;×+LÑ+LˆØ%Ò+¨ˆô ×%Ñ% nÓ5ˆ	ð	[¬}÷ 	[ð 	[ñ ?LÓL¹m°(Ñ# HÕ-¸mˆÐLä�\‰\Ø"´°]Ó1CÐTbö
ô $ŸN™N¨EÐ2×2ˆG÷
ð
 ˆùò Mð
 3ø÷
ð
 ˆüs<   †A	B:ÁB&Á#B:ÂB-ÂB+ÂB-ÂB:Â+B-Â-B7Â2B:r]   c                 ó  — d|j                   › d|j                  › d|j                  xs d› d|j                  › d|j                  rdj                  |j                  «      nd› d	|j                  xs d› d
|j                  › d�S )z-Format the context as a prompt for the agent.z
Analyze this table from page z&:

=== DOCUMENT EXECUTIVE SUMMARY ===
z 

=== EXTENDED PAGE CONTEXT ===
z"No extended page context availablez4

=== IMMEDIATE TABLE CONTEXT ===
Procedural Title: z
Headers Found: ú, ÚNonez=

Preceding Text (chronological order, furthest to closest):
z¹

Note: The LAST element in preceding text may be a footnote from the previous table.
[Table] markers indicate preceding tables.

=== TABLE DATA (may be truncated at page boundary) ===
zÕ

Based on ALL context levels (document summary, page context, procedural headers, and table data),
extract the most appropriate title and provide a functional description for what this COMPLETE table represents.
)r   r   r   r   r   Újoinr   r   )rD   r]   s     r)   rT   z&TableInferenceProcessor._format_promptÌ   s­   € ðØ%×1Ñ1Ð2ð 3ð 	×ÑÐ ð ð 	×ÑÒ=Ð=Ð >ð ?ð ×+Ñ+Ð,ð -Ø.5¯oªo�—	‘	˜'Ÿ/™/Ô*À6ÐJð Kð 	×ÑÒ!˜6Ð "ð #ð 	×ÑÐ ð ð)ð 	r(   ÚmarkdownÚmax_rowsc                 óž   — |sy|j                  «       j                  d«      }|dt        |dz   t        |«      «       }dj	                  |«      S )z$Get preview of table (first N rows).zNo table content availableÚ
Nr   )ÚstripÚsplitÚminro   rv   )rD   rw   rx   ÚlinesÚpreview_liness        r)   Ú_get_table_previewz*TableInferenceProcessor._get_table_previewè   sJ   € áØ/à—‘Ó ×&Ñ& tÓ,ˆØÐ=¤ H¨q¡L´#°e³*Ó =Ð>ˆØ�y‰y˜Ó'Ð'r(   r   Ú
char_limitc                 ó¨  — |dz
  }g }d}g }|j                  «       D ]ª  }t        |d«      sŒ|j                  |k(  sŒ t        |d«      sŒ-|j                  sŒ:|j                  j	                  «       }	|	sŒWt        |d«      r"|j                  d|j                  › d|	› �«       n|j                  |	«       |t        |	«      z  }||k\  sŒª n ||dz  k  rÆ|dkD  rÁg }
|dz
  }|j                  «       D ]g  }t        |d«      sŒ|j                  |k(  sŒ t        |d«      sŒ-|j                  sŒ:|j                  j	                  «       }	|	sŒW|
j                  |	«       Œi |
r>d	j                  |
d
d «      }t        |«      dkD  rd|dd z   }|j                  d|z   «       |r&|j                  dd	j                  |dd «      z   «       |rdj                  |«      S dS )aˆ  
        Extract extended context from the page containing the table.

        Args:
            document: The Docling document object
            page_number: The page number (1-indexed) where the table appears
            char_limit: Maximum characters to extract for context

        Returns:
            String containing page-level context including headers and surrounding text
        rL   r   Ú_pageÚtextÚlevelz	[Header Lz] gffffffæ?rz   éûÿÿÿNiô  ú...iþÿÿz=== Previous Page Context ===
z=== Current Page Content ===
é   z

zNo page context available)	Úiterate_itemsÚhasattrrƒ   r„   r{   Úappendr…   ro   rv   )rD   Údocumentr   r�   Úpage_idxÚcontext_partsÚ
char_countÚcurrent_page_textÚelementr„   Úprev_page_textÚprev_page_idxÚ	prev_texts                r)   Ú_extract_page_contextz-TableInferenceProcessor._extract_page_contextñ   sÏ  € ð  ‘?ˆØˆØˆ
ð ÐØ×-Ñ-Ö/ˆGÜ�w Õ(¨W¯]©]¸hÓ-FÜ˜7 FÕ+°·³Ø"Ÿ<™<×-Ñ-Ó/�DÚä" 7¨GÔ4Ø-×4Ñ4°yÀÇÁÀÈrÐRVÐQWÐ5XÕYà-×4Ñ4°TÔ:Ø"¤c¨$£iÑ/˜
Ø%¨Ó3Ù!ð 0ð ˜
 SÑ(Ò(¨X¸ª\ØˆNØ$ q™LˆMð $×1Ñ1Ö3�Ü˜7 GÕ,°·±À-Ó1OÜ˜w¨Õ/°G·L³LØ&Ÿ|™|×1Ñ1Ó3˜ÚØ*×1Ñ1°$Õ7ð 4ñ Ø ŸI™I n°R°SÐ&9Ó:�	Ü�y“> CÒ'Ø %¨	°$°%Ð(8Ñ 8�IØ×$Ñ$Ð%FÈÑ%RÔSñ Ø× Ñ Ø0°4·9±9Ð=NÈsÐPRÐ=SÓ3TÑTôñ .;ˆv�{‰{˜=Ó)Ð[Ð@[Ð[r(   c              ƒ   óH  K  — |j                  «       }| j                  j                  t        d| j                  | j
                  ¬«      }d|› d�}	 | j                  j                  rNt        j                  d«      5  |j                  |«      ƒ d{  –—† }|j                  j                  cddd«       S |j                  |«      ƒ d{  –—† }|j                  j                  S 7 ŒR# 1 sw Y   yxY w7 Œ(# t        $ r"}t        j                  d|› �«       Y d}~yd}~ww xY w­w)	zË
        Generate a 3-4 sentence executive summary of the entire document.

        Args:
            document: The Docling document object

        Returns:
            Executive summary string
        zCYou are analyzing business documents to create executive summaries.r;   a5  
Analyze this complete document and provide a 3-4 sentence executive summary.

The summary should describe:
1. What this document is (type of document, purpose)
2. Who it is about (company, organization, or subject)
3. What are the major points being made (key metrics, themes, or findings)

=== DOCUMENT ===
zg

Provide a concise executive summary that captures the essential nature and content of this document.
Úgenerate_executive_summaryNz&Failed to generate executive summary: z#Unable to generate document summary)Úexport_to_markdownr@   rA   r.   r2   r3   r4   r7   rU   rV   rX   rY   r/   rZ   r   r[   )rD   rŒ   Údocument_markdownÚsummary_agentr^   r_   ra   s          r)   Ú_generate_executive_summaryz3TableInferenceProcessor._generate_executive_summary-  s  è ø€ ð %×7Ñ7Ó9Ðð ×*Ñ*×7Ñ7Ü(Ø_Ø—]‘]Ø—*‘*ð	 8ó 
ˆð	ð Ð ð ðˆð	9Ø�{‰{×)Ò)Ü—\‘\Ð">Õ?Ø#0×#4Ñ#4°VÓ#<×<�FØ!Ÿ=™=×0Ñ0÷ @Ñ?ð  -×0Ñ0°Ó8×8�Ø—}‘}×,Ñ,Ð,ð	 =ø÷ @Ð?úð 9ùô ò 	9Ü�L‰LÐAÀ!ÀÐEÔFÜ8ûð	9üs~   ‚AD"Á+C4 Á<C&ÂC$ÂC&Â+	C4 Â4D"Â5C4 Ã	C2Ã
C4 Ã#D"Ã$C&Ã&C/Ã+C4 Ã.D"Ã/C4 Ã4	DÃ=DÄD"ÄDÄD"Úpdf_pathc              ƒ   óL  K  — t        j                  dt        j                  j	                  |«      › �«       t        ddd¬«      }t        j                  d|¬«      5  |j                  |«      \  }}ddd«       t        j                  d	t        j                  j	                  |«      › �«       t        j                  d
t        j                  j	                  |«      › �«       | j                  «      ƒ d{  –—† }t        j                  d|dd › d�«       t        «      dkD  r[| j                  xs d}| j                  r| j                  j                  › d|› �}t        j                  dt        |«      › d|› �«       i }|D ]+  }| j                  ||j                   «      ||j"                  <   Œ- | j%                  |||«      ƒ d{  –—† }	t        |	«      dkD  r"t        j                  dt        |	«      › d�«       t        j                  j	                  |«      t'        j(                  «       j+                  «       t        |j,                  «      t        |	«      | j                  r| j                  j                  nd| j                  xs d|	dœS # 1 sw Y   �Œ"xY w7 �Œ§7 Œ×­w)zº
        Process all tables in a document.

        Args:
            pdf_path: Path to PDF document

        Returns:
            Dictionary with document and table information
        zStarting document processing: z ^ TF)Ú	separatorÚenable_consolidationrC   Úparse_document)rŒ   NzDocument parsed successfully: z!Generating executive summary for zExecutive summary: éd   r‡   r   r   Ú:z
Analyzing z tables using zAnalysis complete: z tables processedzauto-detected)rŒ   Úextraction_dateÚtotal_pagesrk   Úmodel_providerr3   Útables)r   ÚinfoÚosÚpathÚbasenamer   rU   rV   r    r›   rC   ro   r3   r2   Úvaluer•   r   rW   rj   r   ÚnowÚ	isoformatÚpages)
rD   rœ   ÚparserrŒ   Útable_metadatar   Ú
model_inforc   rF   r¦   s
             r)   Úprocess_documentz(TableInferenceProcessor.process_document^  s5  è ø€ ô 	�‰Ð4´R·W±W×5EÑ5EÀhÓ5OÐ4PÐQÔRô %¨uÈ4ÐW\Ô]ˆä�\‰\Ð*°XÖ>Ø'-×'<Ñ'<¸XÓ'FÑ$ˆH�n÷ ?ô 	�‰Ð4´R·W±W×5EÑ5EÀhÓ5OÐ4PÐQÔRô 	�‰Ð7¼¿¹×8HÑ8HÈÓ8RÐ7SÐTÔUØ"&×"BÑ"BÀ8Ó"L×LÐÜ�‰Ð*Ð+<¸T¸cÐ+BÐ*CÀ3ÐGÔHô ˆ~Ó Ò"ØŸ™Ò0 yˆJØ�}Š}Ø $§¡× 3Ñ 3Ð4°A°j°\ÐB�
Ü�K‰K˜*¤S¨Ó%8Ð$9¸È
À|ÐTÔUð ˆÛ&ˆHØ26×2LÑ2LÈXÐW_×WkÑWkÓ2lˆM˜(×.Ñ.Ò/ð 'ð ×0Ñ0°ÀÐPaÓb×bˆäˆv‹;˜Š?Ü�K‰KÐ-¬c°&«k¨]Ð:KÐLÔMô Ÿ™×(Ñ(¨Ó2Ü'Ÿ|™|›~×7Ñ7Ó9Ü˜xŸ~™~Ó.Ü ›KØ59·]²]˜dŸm™m×1Ò1ÈØ—Z‘ZÒ, 9Øñ
ð 	
÷= ?Ñ>úð Mùð  cús?   ‚AJ$ÁJÁ2BJ$Ã8JÃ9CJ$Ç
J"ÇCJ$ÊJÊ	J$Ê"J$ÚdataÚoutput_pathc                 ó¬   — t        |dd¬«      5 }t        j                  ||dd¬«       ddd«       t        j                  d|› �«       y# 1 sw Y   Œ"xY w)	zSave results as JSON.Úwúutf-8©Úencodingr   F)ÚindentÚensure_asciiNzJSON results saved to: )ÚopenÚjsonÚdumpr   rC   )rD   r³   r´   Úfs       r)   Ú	save_jsonz!TableInferenceProcessor.save_json–  sD   € ä�+˜s¨WÕ5¸Ü�I‰I�d˜A a°eÕ<÷ 6ä�‰Ð.¨{¨mÐ<Õ=÷ 6Ð5ús   �A
Á
Ac           	      ól  — g }|j                  d«       |j                  d«       |j                  d|d   › �«       |j                  d«       |j                  d|d   › �«       |j                  d«       |j                  d|j                  dd	«      › d
|j                  dd	«      › �«       |j                  d«       |j                  d|d   › �«       |j                  d«       |d   D �]ì  }|j                  d|d   dz   › d|d   › d�«       |j                  d«       |j                  d|d   xs d› �«       |j                  d«      r&|j                  ddj                  |d   «      › �«       |j                  d«      r|j                  d|d   dd › d �«       |j                  d!«       |j                  d"|d#   › �«       |j                  d$|d%   › �«       |j                  d&«       |j                  d'|d(   d)   › d*|d(   d+   › d,�«       |d(   j                  d-«      r|j                  d.|d(   d-   dd/ › d �«       |j                  d0«      rq|j                  d1«       |d0   j                  d2«      dd3 }|D ]  }|j                  |«       Œ t	        |d0   j                  d2«      «      d3kD  r|j                  d4«       |j                  d5«       �Œï t        |d6d7¬8«      5 }|j                  d2j                  |«      «       ddd«       t        j                  d9|› �«       y# 1 sw Y   Œ"xY w):zSave human-readable summary.z# Table Analysis ReportÚ z**Document:** rŒ   z
**Date:** r£   z**Model:** r¥   ÚunknownÚ/r3   z**Total Tables:** rk   r¦   z

## Table rJ   rL   z (Page rK   Ú)z
### Procedural Extraction:z- **Consolidated Headers:** r   ru   r   z- **Individual Headers:** rt   r   z- **Descriptive Text:** NéÈ   r‡   z
### LLM Analysis:z- **Title:** rP   z- **Description:** rQ   z
### Metadata:z- **Size:** rF   rM   u	    rows Ã— rN   z columnsrO   z- **First Cell:** é2   rR   z
### Table Preview:rz   é   z)| ... | ... | (additional rows omitted) |z
---r¶   r·   r¸   zSummary saved to: )	r‹   rg   rv   r|   ro   r¼   Úwriter   rC   )rD   r³   r´   r~   Útabler   Úliner¿   s           r)   Úsave_summaryz$TableInferenceProcessor.save_summaryœ  s4  € àˆØ�‰Ð.Ô/Ø�‰�RÔØ�‰�~ d¨:Ñ&6Ð%7Ð8Ô9Ø�‰�RÔØ�‰�z $Ð'8Ñ"9Ð!:Ð;Ô<Ø�‰�RÔØ�‰�{ 4§8¡8Ð,<¸iÓ#HÐ"IÈÈ4Ï8É8ÐT[Ð]fÓKgÐJhÐiÔjØ�‰�RÔØ�‰Ð)¨$¨~Ñ*>Ð)?Ð@ÔAØ�‰�RÔà˜(•^ˆEØ�L‰L˜; u¨ZÑ'8¸1Ñ'<Ð&=¸WÀUÈ6Á]ÀOÐSTÐUÔVð �L‰LÐ7Ô8Ø�L‰LÐ7¸Ð>PÑ8QÒ8[ÐU[Ð7\Ð]Ô^Ø�y‰y˜Ô#Ø—‘Ð9¸$¿)¹)ÀEÈ)ÑDTÓ:UÐ9VÐWÔXØ�y‰yÐ+Ô,Ø—‘Ð7¸Ð>PÑ8QÐRVÐSVÐ8WÐ7XÐX[Ð\Ô]ð �L‰LÐ.Ô/Ø�L‰L˜=¨¨{Ñ);Ð(<Ð=Ô>Ø�L‰LÐ.¨uÐ5FÑ/GÐ.HÐIÔJð �L‰LÐ*Ô+Ø�L‰LØ˜u ZÑ0°Ñ8Ð9¸À5ÈÑCTÐU[ÑC\ÐB]Ð]eÐfôð �ZÑ ×$Ñ$ \Ô2Ø—‘Ð1°%¸
Ñ2CÀLÑ2QÐRUÐSUÐ2VÐ1WÐWZÐ[Ô\ð �y‰yÐ)Ô*Ø—‘Ð3Ô4Ø %Ð&6Ñ 7× =Ñ =¸dÓ CÀBÀQÐ G�Û)�DØ—L‘L Õ&ð *ä�uÐ-Ñ.×4Ñ4°TÓ:Ó;¸aÒ?Ø—L‘LÐ!LÔMà�L‰L˜Ö!ðC $ôF �+˜s¨WÕ5¸Ø�G‰G�D—I‘I˜eÓ$Ô%÷ 6ä�‰Ð)¨+¨Ð7Õ8÷ 6Ð5ús   Ë(!L*Ì*L3)NNN)NN)é
   )iÐ  )r    r!   r"   r#   r   r   r$   r   rE   r   r   r   rI   r   r&   rj   r   rT   r€   r•   r›   r²   rÀ   rÌ   r'   r(   r)   r1   r1   5   s˜  „ ÙBð -1Ø#Ø#'ñ	)
à˜=Ñ)ð)
ð ˜‰}ð)
ð ˜Ñ ó	)
ðX osñ?
Ø%ð?
Ø5=¸c±]ð?
Ø^fÐgjÑ^kð?
à	ˆc�3ˆh‰ó?
ðH 37Ø+/Ø(,ñ&à˜MÑ*ð&ð    S¨# X¡Ñ/ð&ð $ C™=ð	&ð
 ! ™ð&ð 
ˆd�3˜�8‰nÑ	ó&ðP lð °só ñ8(¨8°C©=ð (ÀCð (ÐQTó (ñ:\¸3ð :\ÈCð :\Ð[^ó :\ðx/9¸Só /9ðb6
¨sð 6
°t¸CÀ¸H±~ó 6
ðp>˜d 3¨ 8™nð >¸3ó >ð39  c¨3 h¡ð 39¸cô 39r(   r1   ) r#   rm   r½   r¨   r   Útypingr   r   r   r   rU   Úlogurur   Úpydanticr	   r
   Úagentsr   Úagents.factoryr   Úcorer   r   Úpromptsr   Úutilsr   r   r   r+   r.   r1   r'   r(   r)   Ú<module>rÖ      sj   ðñó Û Û 	Ý ß ,Ó ,ã Ý ß %å !Ý *ß 5Ý !ß )ô
E�9ô 
Eô�	ô ôW�yô W÷Z9ò Z9r(   