Ë
    },jE  ã                  ó„   — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZmZ  ej                  e«      Zd
d„Zdd	„Zy)uK   Extraction pipeline: prefilter â†’ LLM (with regex fallback) â†’ PartQuery.é    )ÚannotationsN)ÚSettings)Úis_part_request)Úextract_with_regex)Ú	PartQueryÚPostc                ó\   — |j                   dk(  rddlm}  || |«      S ddlm}  || |«      S )z(Dispatch to the configured LLM provider.Ú	anthropicr   )Úextract_with_llm)Úextract_with_openai)Úllm_providerÚ*agent_samochodowy.extraction.llm_extractorr   Ú-agent_samochodowy.extraction.openai_extractorr   )ÚpostÚsettingsr   r   s       úL/var/www/html/agent.samochodowy/src/agent_samochodowy/extraction/__init__.pyÚ_extract_with_llmr      s0   € à×Ñ Ò+ÝOá  hÓ/Ð/åQá˜t XÓ.Ð.ó    c                óÊ  — t        | j                  «      s!t        j                  d| j                  «       y	 |j
                  rt        | |«      }n+t        j                  d| j                  «       t        | «      }|j                   s!t        j                  d| j                  «       y|S # t        $ r. t        j                  d| j                  «       t        | «      }Y Œew xY w)z„Run the full extraction pipeline on a post.

    Returns PartQuery if the post is a part request, None if it should be skipped.
    zPost %s skipped by pre-filterNz0No LLM API key, using regex fallback for post %sz8LLM extraction failed for post %s, falling back to regexz.Post %s classified as non-request by extractor)r   ÚtextÚloggerÚdebugÚpost_idÚllm_api_keyr   Úinfor   Ú	ExceptionÚ	exception)r   r   Úquerys      r   Úextractr      s¶   € ô ˜4Ÿ9™9Ô%Ü�‰Ð4°d·l±lÔCØð)Ø×ÒÜ% d¨HÓ5‰Eä�K‰KÐJÈDÏLÉLÔYÜ& tÓ,ˆEð × Ò Ü�‰ÐEÀtÇ|Á|ÔTØà€Løô ò )Ü×ÑÐSÐUY×UaÑUaÔbÜ" 4Ó(Šð)ús   ¸AB+ Â+4C"Ã!C")r   r   r   r   Úreturnr   )r   r   r   r   r    zPartQuery | None)Ú__doc__Ú
__future__r   ÚloggingÚagent_samochodowy.configr   Ú&agent_samochodowy.extraction.prefilterr   Ú,agent_samochodowy.extraction.regex_extractorr   Úagent_samochodowy.modelsr   r   Ú	getLoggerÚ__name__r   r   r   © r   r   ú<module>r+      s6   ðÙ Qå "ã å -Ý BÝ Kß 4à	ˆ×	Ñ	˜8Ó	$€ó	/ôr   