-
Notifications
You must be signed in to change notification settings - Fork 435
How can I insert an event in my calender using 365 toolkits ? #1085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
and when I used it as aZoneInfo object:
I got this output
ValueError: time data '2024-06-07T13:21:17.628675+00:00' does not match format '%Y-%m-%dT%H:%M:%S%z |
I don't see in your traceback what O365 call is giving this error. If you just create the event using the same params by code... works? |
Hello , thank you for replying to me . so when i excute this code:
I got this error /usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning:
Invoking: ValueError Traceback (most recent call last) in <cell line: 1>() 10 frames /usr/local/lib/python3.10/dist-packages/langchain/chains/base.py in invoke(self, input, config, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain/chains/base.py in invoke(self, input, config, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in _call(self, inputs, run_manager) /usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in _take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager) /usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in (.0) /usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in _iter_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager) /usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in _perform_agent_action(self, name_to_tool_map, color_mapping, agent_action, run_manager) /usr/local/lib/python3.10/dist-packages/langchain_core/tools.py in run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, run_name, run_id, config, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain_core/tools.py in run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, run_name, run_id, config, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain_community/tools/office365/send_event.py in _run(self, body, attendees, subject, start_datetime, end_datetime, run_manager) /usr/local/lib/python3.10/dist-packages/O365/calendar.py in start(self, value) ValueError: TimeZone data must be set using ZoneInfo objects |
I certainly have no issue creating events, that said I suspect the issue should be raised here - https://github.com/langchain-ai/langchain/issues
O365 expects datetime as shown below: @start.setter
def start(self, value):
if not isinstance(value, dt.date):
raise ValueError("'start' must be a valid datetime object")
if not isinstance(value, dt.datetime):
# force datetime
value = dt.datetime(value.year, value.month, value.day)
if value.tzinfo is None:
# localize datetime
value = value.replace(tzinfo=self.protocol.timezone)
else:
if not isinstance(value.tzinfo, ZoneInfo):
raise ValueError('TimeZone data must be set using ZoneInfo objects')
self.__start = value
if not self.end:
self.end = self.__start + dt.timedelta(minutes=30)
self._track_changes.add(self._cc('start')) |
Tested through that code. The tzinfo that is created by strptime in |
Hey guys,

I have created an agent using 365 toolkits to interact with my calender. the authentification and extracting events works fine. example:
the result:
I found an upcoming event in your calendar for June 2024:
If you need more information or assistance with this event, feel free to let me know!
The problem occurs when I want to insert a new event that's when I got this error:
ValueError: TimeZone data must be set using ZoneInfo objects
The text was updated successfully, but these errors were encountered: