
    h                        d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	 d dl
mZ d dlmZmZ  G d de	      Z G d	 d
e      Zy)    )annotations)OptionalType)AsyncCallbackManagerForToolRunCallbackManagerForToolRun)	BaseModel)BaseBrowserTool)aget_current_pageget_current_pagec                      e Zd ZdZy)CurrentWebPageToolInputz.Explicit no-args input for CurrentWebPageTool.N)__name__
__module____qualname____doc__     o/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/langchain_community/tools/playwright/current_page.pyr   r      s    8r   r   c                  `    e Zd ZU dZdZded<   dZded<   eZded<   	 d	 	 	 dd
Z		 d	 	 	 ddZ
y	)CurrentWebPageToolz0Tool for getting the URL of the current webpage.current_webpagestrnamez#Returns the URL of the current pagedescriptionzType[BaseModel]args_schemaNc                    | j                   t        d| j                         t        | j                         }t	        |j
                        S )Use the tool.z$Synchronous browser not provided to )sync_browser
ValueErrorr   r   r   urlselfrun_managerpages      r   _runzCurrentWebPageTool._run   sE    
 $CDII;OPP 1 12488}r   c                   K   | j                   t        d| j                         t        | j                          d{   }t	        |j
                        S 7 w)r   Nz%Asynchronous browser not provided to )async_browserr   r   r
   r   r    r!   s      r   _arunzCurrentWebPageTool._arun'   sQ     
 %DTYYKPQQ&t'9'9::488} ;s   =AA A)N)r#   z#Optional[CallbackManagerForToolRun]returnr   )r#   z(Optional[AsyncCallbackManagerForToolRun]r)   r   )r   r   r   r   r   __annotations__r   r   r   r%   r(   r   r   r   r   r      s^    :!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>r1      s5    " !  E9i 9 r   