Ë
    µŒjŸ  ã                   ó˜   — d Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
 ddlmZmZmZ ddlmZ ddlmZmZ  G d„ d	e«      Z G d
„ de«      Zy)zŽUtil that Searches calendar events in Office 365.

Free, but setup is required. See link below.
https://learn.microsoft.com/en-us/graph/auth/
é    )Údatetime)ÚAnyÚDictÚListÚOptionalÚType)ÚCallbackManagerForToolRun)Ú	BaseModelÚ
ConfigDictÚField)ÚO365BaseTool)Ú
UTC_FORMATÚ
clean_bodyc                   ó†   — e Zd ZU dZ ed¬«      Zeed<    ed¬«      Zeed<    edd¬	«      Z	e
ed
<    edd¬	«      Zeed<   y)ÚSearchEventsInputzeInput for SearchEmails Tool.

    From https://learn.microsoft.com/en-us/graph/search-query-parameterun   The start datetime for the search query in the following format:  YYYY-MM-DDTHH:MM:SSÂ±hh:mm, where "T" separates the date and time  components, and the time zone offset is specified as Â±hh:mm.  For example: "2023-06-09T10:30:00+03:00" represents June 9th,  2023, at 10:30 AM in a time zone with a positive offset of 3  hours from Coordinated Universal Time (UTC).)ÚdescriptionÚstart_datetimeul   The end datetime for the search query in the following format:  YYYY-MM-DDTHH:MM:SSÂ±hh:mm, where "T" separates the date and time  components, and the time zone offset is specified as Â±hh:mm.  For example: "2023-06-09T10:30:00+03:00" represents June 9th,  2023, at 10:30 AM in a time zone with a positive offset of 3  hours from Coordinated Universal Time (UTC).Úend_datetimeé
   z(The maximum number of results to return.)Údefaultr   Úmax_resultsTz•Whether the event's body is truncated to meet token number limits. Set to False for searches that will retrieve small events, otherwise, set to True.ÚtruncateN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚstrÚ__annotations__r   r   Úintr   Úbool© ó    ú{/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/tools/office365/events_search.pyr   r      sl   … ñKñ  ð<ô	€N�Có 	ñ ð<ô	€L�#ó 	ñ ØØ>ô€K�ó ñ Øðô€Hˆdô r"   r   c                   ó˜   — e Zd ZU dZdZeed<   eZe	e
   ed<   dZeed<    ed¬«      Z	 	 	 	 dd
ededededee   dedeeeef      fd„Zy	)ÚO365SearchEventszKSearch calendar events in Office 365.

    Free, but setup is required
    Úevents_searchÚnameÚargs_schemaa�   Use this tool to search for the user's calendar events. The input must be the start and end datetimes for the search query. The output is a JSON list of all the events in the user's calendar between the start and end times. You can assume that the user can  not schedule any meeting over existing meetings, and that the user is busy during meetings. Any times without events are free for the user. r   Úforbid)ÚextraNr   r   r   r   Úrun_managerÚtruncate_limitÚreturnc                 óª  — | j                   j                  «       }|j                  «       }t        j                  |t
        «      }	t        j                  |t
        «      }
|j                  d«      j                  |	«      }|j                  d«      j                  d«      j                  |
«       |j                  |d|¬«      }g }|D �]	  }i }|j                  |d<   |j                  |d<   |rt        |j                  «      d | |d<   nt        |j                  «      |d<   |	j                   }|j"                  j%                  |«      j'                  t
        «      |d	<   |j(                  j%                  |«      j'                  t
        «      |d
<   |j*                  j%                  |«      j'                  t
        «      |d<   |j-                  |«       �Œ |S )NÚstartÚandÚendT)ÚqueryÚinclude_recurringÚlimitÚ	organizerÚsubjectÚbodyr   r   Úmodified_date)ÚaccountÚscheduleÚget_default_calendarÚdtÚstrptimer   Ú	new_queryÚgreater_equalÚchainÚon_attributeÚ
less_equalÚ
get_eventsr5   r6   r   r7   Útzinfor/   Ú
astimezoneÚstrftimer1   ÚmodifiedÚappend)Úselfr   r   r   r   r+   r,   r:   ÚcalendarÚstart_datetime_queryÚend_datetime_queryÚqÚeventsÚoutput_eventsÚeventÚoutput_eventÚ	time_zones                    r#   Ú_runzO365SearchEvents._runM   s¢  € ð —<‘<×(Ñ(Ó*ˆØ×0Ñ0Ó2ˆô  "Ÿ{™{¨>¼:ÓFÐÜŸ[™[¨´zÓBÐð ×Ñ˜wÓ'×5Ñ5Ð6JÓKˆØ	�‰�‹×#Ñ# EÓ*×5Ñ5Ð6HÔIØ×$Ñ$¨1ÀÈKÐ$ÓXˆð ˆÜˆEØˆLØ(-¯©ˆL˜Ñ%à&+§m¡mˆL˜Ñ#áÜ'1°%·*±*Ó'=¸o¸~Ð'N�˜VÒ$ä'1°%·*±*Ó'=�˜VÑ$ð -×3Ñ3ˆIà-2¯[©[×-CÑ-CÀIÓ-N×-WÑ-WÜó.ˆLÐ)Ñ*ð ,1¯9©9×+?Ñ+?À	Ó+J×+SÑ+SÜó,ˆL˜Ñ(ð -2¯N©N×,EÑ,EØó-ç‰h”zÓ"ð ˜Ñ)ð × Ñ  Ö.ð1 ð4 Ðr"   )r   TNé–   )r   r   r   r   r'   r   r   r   r(   r   r
   r   r   Úmodel_configr   r    r   r	   r   r   r   rS   r!   r"   r#   r%   r%   8   s¬   … ñð
  €Dˆ#ÓØ#4€K��i‘Ó4ð	Tð �ó ñ Øô€Lð ØØ;?Ø!ñ2àð2ð ð2ð ð	2ð
 ð2ð Ð7Ñ8ð2ð ð2ð 
ˆd�3˜�8‰nÑ	ô2r"   r%   N)r   r   r<   Útypingr   r   r   r   r   Úlangchain_core.callbacksr	   Úpydanticr
   r   r   Ú(langchain_community.tools.office365.baser   Ú)langchain_community.tools.office365.utilsr   r   r   r%   r!   r"   r#   Ú<module>r[      s?   ðñõ $ß 2Õ 2å >ß 1Ñ 1å Aß Lô$˜	ô $ôNG�|õ Gr"   