+
    if                        R t ^ RIHtHtHt ^ RIHtHtHtH	t	 ^ RI
H
t
Ht ] ! R R4      4       t] ! R R4      4       t] ! R R	4      4       t] ! R
 R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       tRR R lltR# ) z"Data schemas for last30days skill.)	dataclassfieldasdict)AnyDictListOptional)datetimetimezonec                   n   a  ] tR t^t o RtRtRtRtRtRt	Rt
RtRtRtRtRtV 3R lR ltV 3R ltRtV tR# )
EngagementzEngagement metrics.Nc                6   < V ^8  d   QhRS[ S[S[3,          /#    returnr   strr   )format__classdict__s   "R/Users/bowang/.openclaw/workspace/skills/last30days-official/scripts/lib/schema.py__annotate__Engagement.__annotate__    s        c3h      c                   / pV P                   e   V P                   VR&   V P                  e   V P                  VR&   V P                  e   V P                  VR&   V P                  e   V P                  VR&   V P                  e   V P                  VR&   V P
                  e   V P
                  VR&   V P                  e   V P                  VR&   V P                  e   V P                  VR&   V P                  e   V P                  VR	&   V P                  e   V P                  VR
&   V P                  e   V P                  VR&   V'       d   V# R # )Nscorenum_commentsupvote_ratiolikesrepostsrepliesquotesviewssharesvolume	liquidity)r   r   r   r   r   r   r    r!   r"   r#   r$   selfds   & r   to_dictEngagement.to_dict    s   ::!AgJ( $ 1 1An( $ 1 1An::!AgJ<<#<<AiL<<#<<AiL;;"++AhK::!AgJ;;"++AhK;;"++AhK>>%!^^AkNq4r   c                N  < V ^8  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R	&   S[ S[,          ;R
&   S[ S[,          ;R&   # )r   r   r   r   r   r   r   r    r!   r"   r#   r$   )r   intfloat)r   r   s   "r   r   r      s      C=	 
 3-&  5/(  C=  c]!  c]!  SM   C= $ SM % * UO"+ , %- r    )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r    r!   r"   r#   r$   r(   __annotate_func____static_attributes____classdictcell__r   s   @r   r   r      sX     E"&L$(L  E!G!G F  E !F #F!%I   1  r   r   c                   B   a  ] tR t^;t o RtV 3R lR ltV 3R ltRtV tR# )CommentzReddit comment.c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   Comment.__annotate__D   s     
 
c3h 
r   c           
     ~    R V P                   RV P                  RV P                  RV P                  RV P                  /# r   dateauthorexcerpturlr<   r&   s   &r   r(   Comment.to_dictD   s9    TZZDIIdkkt||488
 	
r   c                f   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[;R&   S[;R&   S[;R&   # )r   r   r=   r>   r?   r@   )r+   r   r   )r   r   s   "r   r   r:   ;   sF      J  3-	 
 K  L  
H r   r-   N)	r.   r/   r0   r1   r2   r(   r3   r4   r5   r6   s   @r   r8   r8   ;   s     
 
  r   r8   c                   N   a  ] tR t^Nt o Rt^ t^ t^ tV 3R lR ltV 3R lt	Rt
V tR# )	SubScoreszComponent scores.c                6   < V ^8  d   QhRS[ S[S[3,          /# r   )r   r   r+   )r   r   s   "r   r   SubScores.__annotate__U   s     
 
c3h 
r   c                N    R V P                   RV P                  RV P                  /# 	relevancerecency
engagementrI   rA   s   &r   r(   SubScores.to_dictU   s'    t||$//
 	
r   c                >   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   # )r   rJ   rK   rL   )r+   )r   r   s   "r   r   rG   N   s,        	 
  r   r-   N)r.   r/   r0   r1   r2   rJ   rK   rL   r(   r3   r4   r5   r6   s   @r   rE   rE   N   s(     IGJ
 
  r   rE   c                      a  ] tR t^]t o RtRtRtRt]! ]	R7      t
]! ]	R7      tRtRt]! ]R7      t^ t]! ]	R7      tV 3R lR ltV 3R	 ltR
tV tR# )
RedditItemzNormalized Reddit item.Nlowdefault_factory      ? c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   RedditItem.__annotate__o         c3h r   c                (   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  '       d   V P                  P                  4       MRRV P                   Uu. uF  qP                  4       NK  	  upR	V P                  R
V P                  RV P                  RV P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# u upi )idtitler@   	subredditr=   date_confidencerL   Ntop_commentscomment_insightsrJ   why_relevantsubsr   
cross_refs)rZ   r[   r@   r\   r=   r]   rL   r(   r^   r_   rJ   r`   ra   r   rb   r&   cr'   s   &  r   r(   RedditItem.to_dicto   s    $''TZZ488DIIt33t$//113D$2C2CD2CQYY[2CD 5 5D--DII%%'TZZ
 ???"ooAlO Es   D"c                  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[ ,          ;R	&   S[;R
&   S[ ;R&   S[;R&   S[;R&   S[S[ ,          ;R&   # )r   rZ   r[   r@   r\   r=   r]   rL   r^   r_   rJ   r`   ra   r   rb   r   r   r   r   r8   r,   rE   r+   )r   r   s   "r   r   rW   ]   s      	G  J	 
 
H  N  3-     $+  w-=  3i=      6  N   S	7! r   r-   r.   r/   r0   r1   r2   r=   r]   rL   r   listr^   r_   rJ   r`   rE   ra   r   rb   r(   r3   r4   r5   r6   s   @r   rP   rP   ]   sb     !
 D O'+J"'"=L"'"=ILI6DE!$7J %  r   rP   c                   ~   a  ] tR t^t o RtRtRtRtRtRt	]
! ]R7      t^ t]
! ]R7      tV 3R lR ltV 3R	 ltR
tV tR# )XItemzNormalized X item.NrQ   rT   rU   rR   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   XItem.__annotate__         c3h r   c                   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  '       d   V P                  P                  4       MRRV P                  R	V P                  R
V P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# )rZ   textr@   author_handler=   r]   rL   NrJ   r`   ra   r   rb   )rZ   rp   r@   rq   r=   r]   rL   r(   rJ   r`   ra   r   rb   r%   s   & r   r(   XItem.to_dict   s    $''DII488T//DIIt33t$//113DD--DII%%'TZZ
 ???"ooAlOr   c                   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[;R&   S[ ;R	&   S[;R
&   S[;R&   S[S[ ,          ;R&   # )r   rZ   rp   r@   rq   r=   r]   rL   rJ   r`   ra   r   rb   r   r   r   r,   rE   r+   r   )r   r   s   "r   r   rm      s      	G  I	 
 
H    3-     $+      6  N  S	7 r   r-   )r.   r/   r0   r1   r2   r=   r]   rL   rJ   r`   r   rE   ra   r   ri   rb   r(   r3   r4   r5   r6   s   @r   rk   rk      sM     
 D O'+JILI6DE!$7J !  r   rk   c                   z   a  ] tR t^t o RtRtRtRtRt]	! ]
R7      t^ t]	! ]R7      tV 3R lR ltV 3R	 ltR
tV tR# )WebSearchItemz3Normalized web search item (no engagement metrics).NrQ   rT   rU   rR   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   WebSearchItem.__annotate__   rn   r   c                p   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  RV P                  R	V P                  P                  4       R
V P                  /pV P                  '       d   V P                  VR&   V# rZ   r[   r@   source_domainsnippetr=   r]   rJ   r`   ra   r   rb   )rZ   r[   r@   r{   r|   r=   r]   rJ   r`   ra   r(   r   rb   r%   s   & r   r(   WebSearchItem.to_dict   s    $''TZZ488T//t||DIIt33D--DII%%'TZZ
 ???"ooAlOr   c                   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[;R&   S[ ;R	&   S[;R
&   S[;R&   S[S[ ,          ;R&   # )r   rZ   r[   r@   r{   r|   r=   r]   rJ   r`   ra   r   rb   )r   r   r,   rE   r+   r   )r   r   s   "r   r   rx      s      	G  J	 
 
H    L  3-         6  N  S	7 r   r-   )r.   r/   r0   r1   r2   r=   r]   rJ   r`   r   rE   ra   r   ri   rb   r(   r3   r4   r5   r6   s   @r   rv   rv      sH     = D OILI6DE!$7J !  r   rv   c                      a  ] tR t^t o RtRtRtRtRtRt	Rt
]! ]R7      t^ t]! ]R7      tV 3R lR ltV 3R	 ltR
tV tR# )YouTubeItemzNormalized YouTube item.NhighrU   ffffff?rR   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   YouTubeItem.__annotate__   s      c3h r   c                   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  '       d   V P                  P                  4       MRRV P                  R	V P                  R
V P                  RV P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# )rZ   r[   r@   channel_namer=   r]   rL   Ntranscript_snippetrJ   r`   ra   r   rb   )rZ   r[   r@   r   r=   r]   rL   r(   r   rJ   r`   ra   r   rb   r%   s   & r   r(   YouTubeItem.to_dict   s    $''TZZ488D--DIIt33t$//113D $"9"9D--DII%%'TZZ
 ???"ooAlOr   c                   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[ ;R&   S[;R	&   S[ ;R
&   S[;R&   S[;R&   S[S[ ,          ;R&   # )r   rZ   r[   r@   r   r=   r]   rL   r   rJ   r`   ra   r   rb   rt   )r   r   s   "r   r   r      s      	G  J	 
 
H    3-  !  $+         6  N  S	7 r   r-   )r.   r/   r0   r1   r2   r=   r]   rL   r   rJ   r`   r   rE   ra   r   ri   rb   r(   r3   r4   r5   r6   s   @r   r   r      sS     "
 D!O'+J ILI6DE!$7J #  r   r   c                      a  ] tR t^t o RtRtRtRtRt]	! ]
R7      tRtRt]	! ]R7      t^ t]	! ]
R7      tV 3R lR ltV 3R	 ltR
tV tR# )
TikTokItemzNormalized TikTok item.Nr   rU   rR   r   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   TikTokItem.__annotate__  rX   r   c                   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  '       d   V P                  P                  4       MRRV P                  R	V P                  R
V P                  RV P                  RV P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# rZ   rp   r@   author_namer=   r]   rL   Ncaption_snippethashtagsrJ   r`   ra   r   rb   rZ   rp   r@   r   r=   r]   rL   r(   r   r   rJ   r`   ra   r   rb   r%   s   & r   r(   TikTokItem.to_dict      $''DII4884++DIIt33t$//113Dt33D--DII%%'TZZ
 ???"ooAlOr   c                  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[ ;R&   S[S[ ,          ;R	&   S[;R
&   S[ ;R&   S[;R&   S[;R&   S[S[ ,          ;R&   # r   rZ   rp   r@   r   r=   r]   rL   r   r   rJ   r`   ra   r   rb   r   r   r   r   r,   rE   r+   )r   r   s   "r   r   r            	G  I	 
 
H    3-  !  $+    3i5      6  N   S	7! r   r-   r.   r/   r0   r1   r2   r=   r]   rL   r   r   ri   r   rJ   r`   rE   ra   r   rb   r(   r3   r4   r5   r6   s   @r   r   r      s\     !
 D!O'+JO5HILI6DE!$7J %  r   r   c                      a  ] tR tRt o RtRtRtRtRt]	! ]
R7      tRtRt]	! ]R7      t^ t]	! ]
R7      tV 3R lR	 ltV 3R
 ltRtV tR# )InstagramItemi  zNormalized Instagram item.Nr   rU   rR   r   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   InstagramItem.__annotate__(  rX   r   c                   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  '       d   V P                  P                  4       MRRV P                  R	V P                  R
V P                  RV P                  RV P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# r   r   r%   s   & r   r(   InstagramItem.to_dict(  r   r   c                  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[ ;R&   S[S[ ,          ;R	&   S[;R
&   S[ ;R&   S[;R&   S[;R&   S[S[ ,          ;R&   # r   r   )r   r   s   "r   r   r     r   r   r-   r   r6   s   @r   r   r     s\     $
 D!O'+JO5HILI6DE!$7J %  r   r   c                      a  ] tR tRt o RtRtRtRt]! ]	R7      t
]! ]	R7      tRtRt]! ]R7      t^ t]! ]	R7      tV 3R lR	 ltV 3R
 ltRtV tR# )HackerNewsItemi=  zNormalized Hacker News item.Nr   rR   rT   rU   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   HackerNewsItem.__annotate__P  s      c3h r   c                @   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  '       d   V P                  P                  4       MRR	V P                   Uu. uF  qP                  4       NK  	  upR
V P                  RV P                  RV P                  RV P                  P                  4       RV P                  /pV P                  '       d   V P                  VR&   V# u upi )rZ   r[   r@   hn_urlr>   r=   r]   rL   Nr^   r_   rJ   r`   ra   r   rb   )rZ   r[   r@   r   r>   r=   r]   rL   r(   r^   r_   rJ   r`   ra   r   rb   rc   s   &  r   r(   HackerNewsItem.to_dictP  s    $''TZZ488dkkdkkDIIt33t$//113D$2C2CD2CQYY[2CD 5 5D--DII%%'TZZ
  ???"ooAlO Es   D&c                  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[,          ;R&   S[S[,          ;R	&   S[S[ ,          ;R
&   S[;R&   S[ ;R&   S[;R&   S[;R&   S[S[ ,          ;R&   # )r   rZ   r[   r@   r   r>   r=   r]   rL   r^   r_   rJ   r`   ra   r   rb   rg   )r   r   s   "r   r   r   =  s      	G  J	 
 
H  K  K  3-  !  $+  w-=  3i=      6   N! " S	7# r   r-   rh   r6   s   @r   r   r   =  sb     & D!O'+J"'"=L"'"=ILI6DE!$7J '  r   r   c                      a  ] tR tRt o Rt]! ]R7      t^ tRt	Rt
RtRtRtRtRt]! ]R7      t^ t]! ]R7      tV 3R lR	 ltV 3R
 ltRtV tR# )PolymarketItemif  z-Normalized Polymarket prediction market item.rR   Nr   rT   rU   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   PolymarketItem.__annotate__z  s      c3h r   c                   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  RV P                  R	V P                  '       d   V P                  P                  4       MR
RV P                  RV P                  RV P                  RV P                  P                  4       RV P                  /pV P                   '       d   V P                   VR&   V# )rZ   r[   questionr@   outcome_pricesoutcomes_remainingprice_movementr=   r]   rL   Nend_daterJ   r`   ra   r   rb   )rZ   r[   r   r@   r   r   r   r=   r]   rL   r(   r   rJ   r`   ra   r   rb   r%   s   & r   r(   PolymarketItem.to_dictz  s    $''TZZ488d11 $"9"9d11DIIt33t$//113DD--DII%%'TZZ
" ???"ooAlOr   c                :  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[,          ;R&   S[;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[ ;R	&   S[S[,          ;R
&   S[S[ ,          ;R&   S[;R&   S[ ;R&   S[;R&   S[;R&   S[S[ ,          ;R&   # )r   rZ   r[   r   r@   r   r   r   r=   r]   rL   r   rJ   r`   ra   r   rb   )r   r   tupler+   r   r   r,   rE   )r   r   s   "r   r   r   f  s      	G  J	 
 M  
H  K=    SM(  3-  !  $+  sm"       6! " N# $ S	7% r   r-   )r.   r/   r0   r1   r2   r   ri   r   r   r   r=   r]   rL   r   rJ   r`   rE   ra   r   rb   r(   r3   r4   r5   r6   s   @r   r   r   f  sg     7
 #("=N$(ND!O'+J"HILI6DE!$7J )  r   r   c                   J  a  ] tR tRt o RtRtRt]! ]R7      t	]! ]R7      t
]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      tRtRtRtRtRtRtRtRtRtRtRtRtV 3R lR lt] V 3R	 lR
 l4       t!V 3R lt"Rt#V t$R# )Reporti  zFull research report.NrR   rU   Fc                6   < V ^8  d   QhRS[ S[S[3,          /# r   r   )r   r   s   "r   r   Report.__annotate__  s     - -c3h -r   c                   / R V P                   bRRV P                  RV P                  /bRV P                  bRV P                  bRV P
                  bRV P                  bRV P                   Uu. uF  qP                  4       NK  	  upbR	V P                   Uu. uF  q"P                  4       NK  	  upbR
V P                   Uu. uF  q3P                  4       NK  	  upbRV P                   Uu. uF  qDP                  4       NK  	  upbRV P                   Uu. uF  qUP                  4       NK  	  upbRV P                   Uu. uF  qfP                  4       NK  	  upbRV P                   Uu. uF  qwP                  4       NK  	  upbRV P                   Uu. uF  qP                  4       NK  	  upbRV P                   bRV P"                  bRV P$                  bp	V P&                  '       d   V P&                  V	R&   V P(                  '       d   V P(                  V	R&   V P*                  '       d   V P*                  V	R&   V P,                  '       d   V P,                  V	R&   V P.                  '       d   V P.                  V	R&   V P0                  '       d   V P0                  V	R&   V P2                  '       d   V P2                  V	R&   V P4                  '       d   V P4                  V	R&   V P6                  '       d   V P6                  V	R&   V P8                  '       d   V P8                  V	R&   V P:                  e   V P:                  V	R&   V	# u upi u upi u upi u upi u upi u upi u upi u upi )topicrangefromtogenerated_atmodeopenai_model_usedxai_model_usedredditxwebyoutubetiktok	instagram
hackernews
polymarketbest_practicesprompt_packcontext_snippet_mdresolved_x_handlereddit_errorx_error	web_erroryoutube_errortiktok_errorinstagram_errorhackernews_errorpolymarket_error
from_cachecache_age_hours)r   
range_fromrange_tor   r   r   r   r   r(   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
r&   rr   wytighpr'   s
   &         r   r(   Report.to_dict  s   
TZZ
dmm
 D--
 DII
  !7!7
 d11
 DKK8Kqyy{K8
 tvv.v!))+v.
 2AIIK2
 T\\:\		\:
 DKK8Kqyy{K8
 @2**,@
  @199;@!
" @199;@#
$ d11%
& 4++'
( !$"9"9)
, !!!%)%;%;A!" $ 1 1An<<<<<AiL>>>!^^AkN!%!3!3Ao $ 1 1An#'#7#7A    $($9$9A !   $($9$9A !???"ooAlO+#'#7#7A E 9.2:8@@@s0   -L?MM	+MM?M)MM"c                :   < V ^8  d   QhRS[ S[S[3,          RR/# )r   datar   r   r   )r   r   s   "r   r   r     s'     b
 b
T#s(^ b
 b
r   c                   VP                  R/ 4      pVP                  RVP                  RR4      4      pVP                  RVP                  RR4      4      p. pVP                  R. 4       EFH  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R
. 4       Uu. uF  p\        RL/ VB NK  	  p	pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VR,          VR,          VR,          VP                  R4      VP                  RR4      VV	VP                  R. 4      VP                  RR4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R7      4       EKK  	  . pVP                  R. 4       EF  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VR,          VR,          VR,          VP                  R4      VP                  RR4      VVP                  RR4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R7      4       EK  	  . pVP                  R. 4       F  pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VR,          VR,          VP                  RR4      VP                  R R4      VP                  R4      VP                  RR4      VP                  RR4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R!7      4       K  	  . pVP                  R". 4       EF&  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VR,          VR,          VP                  R#R4      VP                  R4      VP                  RR$4      VVP                  R%R4      VP                  RR&4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R'7      4       EK)  	  . pVP                  R(. 4       EF@  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VP                  RR4      VR,          VP                  R)R4      VP                  R4      VP                  RR$4      VVP                  R*R4      VP                  R+. 4      VP                  RR&4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R,7      4       EKC  	  . pVP                  R-. 4       EF@  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VP                  RR4      VR,          VP                  R)R4      VP                  R4      VP                  RR$4      VVP                  R*R4      VP                  R+. 4      VP                  RR&4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R,7      4       EKC  	  . pVP                  R.. 4       EFk  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R
. 4       Uu. uF  p\        RL/ VB NK  	  p	pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        VR,          VR,          VP                  RR4      VP                  R/R4      VP                  R0R4      VP                  R4      VP                  RR$4      VV	VP                  R. 4      VP                  RR4      VP                  RR4      V
VP                  R^ 4      VP                  R. 4      R17      4       EKn  	  . pVP                  R2. 4       EFu  pRpVP                  R	4      '       d   \        RL/ VR	,          B pVP                  R4      '       d   \        RL/ VP                  R/ 4      B M	\        4       p
VP	                  \        RL/ RVR,          bRVR,          bR3VP                  R3R4      bRVR,          bR4VP                  R4. 4      bR5VP                  R5^ 4      bR6VP                  R64      bRVP                  R4      bRVP                  RR$4      bR	VbR7VP                  R74      bRVP                  RR4      bRVP                  RR4      bRV
bRVP                  R^ 4      bRVP                  R. 4      b 4       EKx  	  V ! RL/ R8VR8,          bRVbRVbR9VR9,          bR:VR:,          bR;VP                  R;4      bR<VP                  R<4      bRVbRVbRVbR"VbR(VbR-VbR.VbR2VbR=VP                  R=. 4      bR>VP                  R>. 4      bR?VP                  R?R4      bR@VP                  R@4      bRAVP                  RA4      bRBVP                  RB4      bRCVP                  RC4      bRDVP                  RD4      bREVP                  RE4      bRFVP                  RF4      bRGVP                  RG4      bRHVP                  RH4      bRIVP                  RIRJ4      bRKVP                  RK4      b # u upi u upi )Mz:Create Report from serialized dict (handles cache format).r   r   r   rU   r   r   r   NrL   r^   ra   rZ   r[   r@   r\   r=   r]   rQ   r_   rJ   rT   r`   r   rb   )rZ   r[   r@   r\   r=   r]   rL   r^   r_   rJ   r`   ra   r   rb   r   rp   rq   )rZ   rp   r@   rq   r=   r]   rL   rJ   r`   ra   r   rb   r   r{   r|   rz   r   r   r   r   r   )rZ   r[   r@   r   r=   r]   rL   r   rJ   r`   ra   r   rb   r   r   r   r   )rZ   rp   r@   r   r=   r]   rL   r   r   rJ   r`   ra   r   rb   r   r   r   r>   )rZ   r[   r@   r   r>   r=   r]   rL   r^   r_   rJ   r`   ra   r   rb   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Fr   r-   )getr   r8   rE   appendrP   rk   rv   r   r   r   r   r   )clsr   
range_datar   r   reddit_itemsr   engrd   commentsra   x_itemsr   	web_itemsr   youtube_itemsr   tiktok_itemsr   ig_itemsr   hn_itemsr   pm_itemsr   s   &&                       r   	from_dictReport.from_dict  sN    XXgr*
^^FDHH\2,FG
>>$R(@A (B'ACuu\"" 31\?3./eeNB.GH.G!.GHH56UU6]]91quuVR01	D
T7jeHK.UU6] !&7 ?%!"'92!>%%S1UU>26eeGQ'55r2!  (0 #r"ACuu\"" 31\?356UU6]]91quuVR01	DNN5T7vYeH0UU6] !&7 ?%%S1UU>26eeGQ'55r2  #* 	%$A56UU6]]91quuVR01	D]T7jeHeeOR8i,UU6] !&7 ?%%S1UU>26eeGQ'55r2  %$ )R(ACuu\"" 31\?356UU6]]91quuVR01	D  T7jeHUU>26UU6] !&7 @#$55)=r#B%%S1UU>26eeGQ'55r2"  ), (B'ACuu\"" 31\?356UU6]]91quuVR01	D
T7UU62&eHEE-4UU6] !&7 @ !&7 <z2.%%S1UU>26eeGQ'55r2!  (. ((;+BCvvl## 42l#3468ffVnn92rvvfb12)+DOOMd8VVFB'uIFF="5VVF^ "'8& A "'8" =
B/&&c2VVNB7ffWa(66,3  ,. ,+ACuu\"" 31\?3./eeNB.GH.G!.GHH56UU6]]91quuVR01	DOONT7jEE%$uuXr*uuXr*UU6] !&7 @%!"'92!>%%S1UU>26eeGQ'55r2  ,2 ,+ACuu\"" 31\?356UU6]]91quuVR01	DOON T7j z2. eH	
  !uu%5r: $%55)=q#A  !uu%56 UU6] !"&7 @  z* %%S1 UU>26  eeGQ'  55r2!  ,0  
w-
!
 
 n-	

 f
 #hh':;
  88$45
  
 
 
 "
  
 
  
  
   88$4b9!
" 3#
$  $xx(<bA%
& .1'
( HHY')
* hh{++
, ((?3-
. .1/
0 !HH%671
2 "XX&893
4 "XX&895
6 #hh':;7
8 xxe49
: !HH%67;
 	
o IR Is   .q6qc                  < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[,          ;R&   S[S[,          ;R	&   S[S[,          ;R
&   S[S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[	,          ;R&   S[S[
,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[ ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   S[;R&   S[S[,          ;R&   # )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   rP   rk   rv   r   r   r   r   r   boolr,   )r   r   s   "r   r   r     s     J  O	 
 M    I   }+  SM(  :  E{0  
m	:  +<  :  M"@   ^$B! " ^$B# $ I;% & c8' (  ) , 3-&- . c]!/ 0 }#1 2 C='3 4 3-&5 6 c])7 8 sm*9 : sm*; >  }+? B C D e_+E r   r-   )%r.   r/   r0   r1   r2   r   r   r   ri   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r(   classmethodr   r3   r4   r5   r6   s   @r   r   r     s      (,$(N$T:F40A$T:C!&t!<G$T:F%*4%@I',T'BJ',T'BJ %d ;N"48K "&L!G#I#'M"&L%)O&*&*'+J'+O- -^ b
 b
i  r   r   Nc                    V ^8  d   QhR\         R\         R\         R\         R\        \         ,          R\        \         ,          R\        /# )r   r   	from_dateto_dater   openai_model	xai_modelr   )r   r   r   )r   s   "r   r   r     sV        	
 3- } r   c           
         \        V VV\        P                  ! \        P                  4      P                  4       VVVR7      # )z"Create a new report with metadata.)r   r   r   r   r   r   r   )r   r	   nowr
   utc	isoformat)r   r   r   r   r   r   s   &&&&&&r   create_reportr    s<     \\(,,/99;&  r   )NN)r2   dataclassesr   r   r   typingr   r   r   r   r	   r
   r   r8   rE   rP   rk   rv   r   r   r   r   r   r   r  r-   r   r   <module>r     sZ   ( 0 0 , , ' /  /  / d 
 
 
$ 
 
 
 # # #L   D   D ! ! !H # # #L # # #L % % %P ' ' 'T u
 u
 u
p	 r   