
    3fi                     J    d Z ddlZddlmZ ddlmZ ddlmZ  G d de      Zy)z7Get information about the calendars in Google Calendar.    N)Optional)CallbackManagerForToolRun)CalendarBaseToolc                   F    e Zd ZU dZdZeed<   dZeed<   d
dee	   defd	Z
y)GetCalendarsInfozATool that get information about the calendars in Google Calendar.get_calendars_infonamezHUse this tool to get information about the calendars in Google Calendar.descriptionNrun_managerreturnc                 H   	 | j                   j                         j                         j                         }g }|j	                  dg       D ]   }|j                  |d   |d   |d   d       " t        j                  |      S # t        $ r}t        d|       |d}~ww xY w)zGRun the tool to get information about the calendars in Google Calendar.itemsidsummarytimeZone)r   r   r   zAn error occurred: N)	api_resourcecalendarListlistexecutegetappendjsondumps	Exception)selfr   	calendarsdataitemerrors         t/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_google_community/calendar/get_calendars_info.py_runzGetCalendarsInfo._run   s    	F))668==?GGIID!gr2 "4j#'	?$($4 ::d## 	F1%9:E	Fs   BB 	B!BB!)N)__name__
__module____qualname____doc__r	   str__annotations__r
   r   r   r!        r    r   r      s:    K$D#$R  F)B C Fs Fr)   r   )	r%   r   typingr   langchain_core.callbacksr   (langchain_google_community.calendar.baser   r   r(   r)   r    <module>r-      s#    =   > EF' Fr)   