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                   @   s:   e Zd ZU dZedddZeed< edddZeed< d	S )
CreateSessionSchemazInput for CreateSessionTool..z"The query to run in multion agent.)descriptionqueryhttps://www.google.com/zXThe 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   l/var/www/html/chatdoc2/venv/lib/python3.10/site-packages/langchain_community/tools/multion/create_session.pyr	      s   
 r	   c                	   @   sb   e Zd ZU dZdZeed< dZeed< eZ	e
e ed< 		dd	ed
ee dee defddZdS )MultionCreateSessiona  Tool that creates a new Multion Browser Window with provided fields.

    Attributes:
        name: The name of the tool. Default: "create_multion_session"
        description: The description of the tool.
        args_schema: The schema for the tool's arguments.
    create_multion_sessionnamea  
        Create a new web browsing session based on a user's command or request.         The command should include the full info required for the session.         Also include an url (defaults to google.com if no better option)         to start the session.         Use this tool to create a new Browser Window with provided fields.         Always the first step to run any activities that can be done using browser.
        r
   args_schemar   Nr   r   run_managerreturnc              
   C   sL   zt ||d}|d |d dW S  ty% } ztd| d }~ww )N)inputr   
session_idmessage)	sessionIdResponsezAn error occurred: )multionnew_session	Exception)selfr   r   r   responseer   r   r   _run6   s   zMultionCreateSession._run)r   N)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    
