o
    ȳg	                     @   s   d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	m
Z
 er%d dlZnzd dlZW n	 ey4   Y nw G dd de	ZG dd	 d	eZdS )
    )TYPE_CHECKINGOptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelFieldNc                   @   sN   e Zd ZU dZedddZeed< edddZeed< edd	dZ	eed
< dS )UpdateSessionSchemazInput for UpdateSessionTool..zJThe sessionID, 
        received from one of the createSessions run before)description	sessionIdz"The query to run in multion agent.queryhttps://www.google.com/zTThe Url to run the agent at.         Note: accepts only secure links having https://urlN)
__name__
__module____qualname____doc__r   r   str__annotations__r   r    r   r   l/var/www/html/chatdoc2/venv/lib/python3.10/site-packages/langchain_community/tools/multion/update_session.pyr	      s   
 r	   c                   @   sr   e Zd ZU dZdZeed< dZeed< eZ	e
e ed< dZeed< 			
ddededee dee def
ddZd
S )MultionUpdateSessiona/  Tool that updates an existing Multion Browser Window with provided fields.

    Attributes:
        name: The name of the tool. Default: "update_multion_session"
        description: The description of the tool.
        args_schema: The schema for the tool's arguments. Default: UpdateSessionSchema
    update_multion_sessionnamezUse this tool to update an existing corresponding Multion Browser Window with provided fields. Note: sessionId must be received from previous Browser window creation.r
   args_schema r   r   Nr   r   run_managerreturnc              
   C   s   z8zt |||d}||d d}|| _|W W S  ty8 } zt| d | ddW  Y d }~W S d }~ww  tyK } ztd| d }~ww )N)inputr   message)r   Responsez, retrying...zretrying...)errorr    zAn error occurred: )multionupdate_sessionr   	Exceptionprint)selfr   r   r   r   responsecontenter   r   r   _run7   s"   
zMultionUpdateSession._run)r   N)r   r   r   r   r   r   r   r
   r	   r   r   r   r   r   dictr*   r   r   r   r   r   '   s&   
 r   )typingr   r   r   langchain_core.callbacksr   langchain_core.toolsr   pydanticr   r   r"   ImportErrorr	   r   r   r   r   r   <module>   s    
