
    Ng	                         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	 d dlZn# e$ r Y nw xY w G d de	          Z G d d	e          ZdS )
    )TYPE_CHECKINGOptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelFieldNc                       e Zd ZU dZ edd          Zeed<    edd          Zeed<    e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        l/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_community/tools/multion/update_session.pyr   r      s         &&U>  Is   
 8  E3    u!;  C     r   r   c                       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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                    	 	 t          j        |||d          }||d         d}|| _        |S # t          $ r"}t	          | d           | ddcY d }~S d }~ww xY w# t          $ r}t          d|           d }~ww xY 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es           r   _runzMultionUpdateSession._run7   s    	7	D"1s;;  )2x	?RSS!* D D D)))***$%]CCCCCCCCD  	7 	7 	75!55666	7s8   +/ 
AAAA AA 
A?(A::A?)r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   dictr/   r   r   r   r   r   '   s           )D#(((KK K K K .AK)*@@@Is 7;?7 77 7 c]	7
 787 
7 7 7 7 7 7r   r   )typingr   r   r   langchain_core.callbacksr   langchain_core.toolsr   pydanticr   r	   r'   ImportErrorr   r   r   r   r   <module>r6      s   0 0 0 0 0 0 0 0 0 0      * ) ) ) ) ) % % % % % % % % NNNN       )   &#7 #7 #7 #7 #78 #7 #7 #7 #7 #7s   , 44