+
    i|                        R t ^ RIHt ^ RIHtHtHtHt ^ RIH	t	 ^ RI
Ht ^ RI
Ht ^ RIHt ^ RIHt R R	 ltR
 R ltR R ltR R lt ! R R]P(                  4      t ! R R]P,                  4      tR# )zSheetsInputs.)annotations)AnyCallableMappingSequence)parse)gspread_client)	sheets_id)llmfn_inputs_source)llmfn_outputsc                    V ^8  d   QhRRRR/#    valuestrreturnz!sheets_id.SheetsIdentifier | None )formats   "|/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/generativeai/notebook/sheets_utils.py__annotate__r      s       (I     c                    \         P                  ! V 4      pTP                  '       dR   \        P
                  ! \        P                  ! T 4      R7      p\        P                  ! 4       P                  T4       T# R#   \         d     R# i ; i)z4Try to open a Sheets document with `value` as a URL.N)url)
r   urlparse
ValueErrorschemer	   SheetsIdentifier	SheetsURLr   
get_clientvalidate)r   parse_resultsids   &  r   _try_sheet_id_as_urlr"      ss    ~~e,
  ((Y-@-@-GH!!#,,S1
  s   A= =BBc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   -   s       (I r   c                    \         P                  ! \         P                  ! V 4      R7      p \        P
                  ! 4       P                  T4       T#   \         d     R# i ; i  \        P                   d     R# i ; i)z4Try to open a Sheets document with `value` as a key.)keyN)r	   r   	SheetsKeyr   r   r   r   SpreadsheetNotFoundErrorr   r!   s   & r   _try_sheet_id_as_keyr)   -   sr    ((Y-@-@-GH
!!#,,S1 J   22 s"   +A $A& A#"A#&A?>A?c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   <   s       )J r   c                    \         P                  ! V R7      p \        P                  ! 4       P	                  V4       V#   \        P
                   d     R# i ; i)z5Try to open a Sheets document with `value` as a name.)nameN)r	   r   r   r   r   r'   r(   s   & r   _try_sheet_id_as_namer-   <   sO    

$
$%
0C!!#,,S1 J 22 s   $? AAc                    V ^8  d   QhRRRR/# )r   r   r   r   sheets_id.SheetsIdentifierr   )r   s   "r   r   r   F   s     V V# V*D Vr   c                    \        V 4      ;p'       d   V# \        V 4      ;p'       d   V# \        V 4      ;p'       d   V# \        R P	                  V 4      4      h)z-No Sheets found with "{}" as URL, key or name)r"   r)   r-   RuntimeErrorr   r(   s   & r   get_sheets_id_from_strr2   F   sX    "5))s)
"5))s)
#E**s*

FMMeT
UUr   c                  B   a  ] tR t^PtRtRR V 3R llltR R ltRtV ;t# )SheetsInputsz,Inputs to an LLMFunction from Google Sheets.c                    V ^8  d   QhRRRR/# )r   r!   r/   worksheet_idintr   )r   s   "r   r   SheetsInputs.__annotate__S   s     * *6 *c *r   c                	<   < \         SV `  4        Wn        W n        R # N)super__init___sid_worksheet_id)selfr!   r6   	__class__s   &&&r   r<   SheetsInputs.__init__S   s    	)r   c                   V ^8  d   QhRR/# )r   r   z6tuple[Sequence[Mapping[str, str]], Callable[[], None]]r   )r   s   "r   r   r8   X   s     
 
	?
r   c                	v    \         P                  ! 4       P                  V P                  V P                  R 7      # ))r!   r6   )r   r   get_all_recordsr=   r>   )r?   s   &r   _to_normalized_inputs_impl'SheetsInputs._to_normalized_inputs_implX   s4     ((*::		(:(: ; 
 	
r   )r=   r>   )    )	__name__
__module____qualname____firstlineno____doc__r<   rE   __static_attributes____classcell__)r@   s   @r   r4   r4   P   s    6* *

 
r   r4   c                  2    ] tR t^`tRtR R ltR R ltRtR# )SheetsOutputsz4Writes outputs from an LLMFunction to Google Sheets.c                   V ^8  d   QhRR/# )r   r!   r/   r   )r   s   "r   r   SheetsOutputs.__annotate__c   s      6 r   c                	    Wn         R # r:   r=   )r?   r!   s   &&r   r<   SheetsOutputs.__init__c   s    	r   c                    V ^8  d   QhRRRR/# )r   outputszllmfn_outputs.LLMFnOutputsBaser   Noner   )r   s   "r   r   rR   f   s     	
 	
%C 	
 	
r   c                	B   VP                  4       p\        VP                  4       4      .pTP                  \	        VP                  4       !   Uu. uF  p\        V4      NK  	  up4       \        P                  ! 4       P                  V P                  VR 7       R# u upi ))r!   rowsN)
as_dictlistkeysextendzipvaluesr   r   write_recordsr=   )r?   rW   outputs_dictoutputs_rowsxs   &&   r   write_outputsSheetsOutputs.write_outputsf   s    (-1,2C2C2E-F,Gc<3F3F3H.IJ.IT!W.IJK!!#11		 	2 	
 Ks   BrT   N)rH   rI   rJ   rK   rL   r<   re   rM   r   r   r   rP   rP   `   s    >	
 	
r   rP   N)rL   
__future__r   typingr   r   r   r   urllibr   google.generativeai.notebookr   r	    google.generativeai.notebook.libr
   r   r"   r)   r-   r2   LLMFnInputsSourcer4   LLMFnOutputsSinkrP   r   r   r   <module>rn      s\     " 3 3  7 2 @ :&V
&88 
 
M22 
r   