a
    bg	                     @   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rJd dlZn zd dlZW n eyh   Y n0 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   ~/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain_community/tools/multion/update_session.pyr	      s   
r	   c                   @   sf   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eeee ee ed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
    Z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   N)r   r   r   run_managerreturnc              
   C   s   ztz.t |||d}||d d}|| _|W W S  typ } z(t| d | ddW  Y d }~W S d }~0 0 W n2 ty } ztd| W Y d }~n
d }~0 0 d S )N)inputr   message)r   Responsez, retrying...zretrying...)errorr   zAn error occurred: )multionZ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   Zlangchain_core.callbacksr   Zlangchain_core.toolsr   Zpydanticr   r   r!   ImportErrorr	   r   r   r   r   r   <module>   s   
