| Server IP : 3.147.158.171 / Your IP : 216.73.216.216 Web Server : Apache/2.4.67 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-2-178.us-east-2.compute.internal 6.1.172-216.329.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 20 06:31:34 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.21 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /tsai/repo/api/app/utilities/__pycache__/ |
Upload File : |
o
��Wj� � @ s� d Z ddlmZmZmZmZ dZdZdededefdd �Z dededefd
d�Z
deeef defd
d�Zdeeeeef deeeef fdd�Z
dS )at The fact-check / corrections comment contract.
Fact-check and corrections comments are posted to WordPress as guest comments
whose *author name* encodes which model produced them, e.g.
``Fact-Check (via OpenAI gpt-5.5)``. That name is the only marker identifying
them: corrections look up their parent fact-check by matching the author-name
prefix, and comment scoring excludes them the same way.
The format therefore has to agree in every place that writes or reads it. It
previously lived as separate literals in the article-creation service, the
comment agent, and improve_article.py; this module is the single definition.
� )�Any�Dict�Iterable�Optionalzfact-check (via zcorrections (via �
provider_name�
model_name�returnc C � d| � d|� d�S )z3The author name to post a fact-check comment under.zFact-Check (via � �)� �r r r r �*/tsai/repo/api/app/utilities/fact_check.py�fact_check_author_name � r c C r )z4The author name to post a corrections comment under.zCorrections (via r
r r r
r r r �corrections_author_name r r �commentc C s | � d�pd�� �t�S )z;True when a WordPress comment dict is a fact-check comment.�author_name� )�get�lower�
startswith�FACT_CHECK_AUTHOR_PREFIX)r r r r �is_fact_check_comment s r �commentsc C s"