
    dh                        S SK Jr  S SKJrJr  S SKJrJr  S SKJ	r	  S SK
Jr  S SKJrJr   " S S\	5      r " S	 S
\5      rg)    )annotations)OptionalType)AsyncCallbackManagerForToolRunCallbackManagerForToolRun)	BaseModel)BaseBrowserTool)aget_current_pageget_current_pagec                      \ rS rSrSrSrg)CurrentWebPageToolInput   z.Explicit no-args input for CurrentWebPageTool. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       i/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/tools/playwright/current_page.pyr   r      s    8r   r   c                  p    \ rS rSr% SrSrS\S'   SrS\S'   \r	S\S	'    S   SS jjr
 S   SS jjrSrg
)CurrentWebPageTool   z0Tool for getting the URL of the current webpage.current_webpagestrnamez#Returns the URL of the current pagedescriptionzType[BaseModel]args_schemaNc                    U R                   c  [        SU R                   35      e[        U R                   5      n[	        UR
                  5      $ )Use the tool.z$Synchronous browser not provided to )sync_browser
ValueErrorr   r   r   urlselfrun_managerpages      r   _runCurrentWebPageTool._run   sE    
 $CDII;OPP 1 12488}r   c                   #    U R                   c  [        SU R                   35      e[        U R                   5      I Sh  vN n[	        UR
                  5      $  N7f)r!   Nz%Asynchronous browser not provided to )async_browserr#   r   r
   r   r$   r%   s      r   _arunCurrentWebPageTool._arun'   sP     
 %DTYYKPQQ&t'9'9::488} ;s   >A AAr   )N)r'   z#Optional[CallbackManagerForToolRun]returnr   )r'   z(Optional[AsyncCallbackManagerForToolRun]r/   r   )r   r   r   r   r   r   __annotations__r   r   r   r)   r-   r   r   r   r   r   r      sc    :!D#!<K<#:K: <@8 
 AE= 
 r   r   N)
__future__r   typingr   r   langchain_core.callbacksr   r   pydanticr   )langchain_community.tools.playwright.baser	   *langchain_community.tools.playwright.utilsr
   r   r   r   r   r   r   <module>r7      s5    " !  E9i 9 r   