GithubHelp home page GithubHelp logo

Comments (3)

aspirant2018 avatar aspirant2018 commented on September 28, 2024 1

and when I used it as aZoneInfo object:

from zoneinfo import ZoneInfo
from datetime import datetime

# Create a ZoneInfo object for a specific timezone, for example, 'America/New_York'
ny_timezone = ZoneInfo("UTC")

# Get the current time in the specified timezone
current_time = datetime.now(ny_timezone)

print("Current time in UTC:", current_time)

answer = agent_events.invoke(
    f"Can you make a 30 minute meeting with a sentient parrot to discuss research collaborations on {current_time}?"
)
print(answer['output'])

I got this output

> Entering new AgentExecutor chain...

Invoking: `events_search` with `{'start_datetime': '2024-06-07T13:00:00+00:00', 'end_datetime': '2024-06-07T14:00:00+00:00'}`


[]
Invoking: `send_event` with `{'body': 'Discuss research collaborations with a sentient parrot.', 'attendees': ['[[email protected]](mailto:[email protected])'], 'subject': 'Research Collaborations Meeting', 'start_datetime': '2024-06-07T13:21:17.628675+00:00', 'end_datetime': '2024-06-07T13:51:17.628675+00:00'}`


---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

[<ipython-input-272-4eafbd13a3f4>](https://localhost:8080/#) in <cell line: 12>()
     10 print("Current time in UTC:", current_time)
     11 
---> 12 answer = agent_events.invoke(
     13     f"Can you make a 30 minute meeting with a sentient parrot to discuss research collaborations on {current_time}?"
     14 )

11 frames

[/usr/lib/python3.10/_strptime.py](https://localhost:8080/#) in _strptime(data_string, format)
    347     found = format_regex.match(data_string)
    348     if not found:
--> 349         raise ValueError("time data %r does not match format %r" %
    350                          (data_string, format))
    351     if len(data_string) != found.end():

ValueError: time data '2024-06-07T13:21:17.628675+00:00' does not match format '%Y-%m-%dT%H:%M:%S%z'

ValueError: time data '2024-06-07T13:21:17.628675+00:00' does not match format '%Y-%m-%dT%H:%M:%S%z

from python-o365.

alejcas avatar alejcas commented on September 28, 2024

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?

from python-o365.

aspirant2018 avatar aspirant2018 commented on September 28, 2024

Hello , thank you for replying to me .

so when i excute this code:


answer = agent_events.invoke(
    f"add an event at 2024-06-07 at 12:00:00 PM to recall John  ?"
)
print(answer['output'])

I got this error

/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: should_run_async will not call transform_cell automatically in the future. Please pass the result to transformed_cell argument and any exception that happen during thetransform in preprocessing_exc_tuple in IPython 7.17 and above.
def _forward_input(self, allow_stdin=False):

Entering new AgentExecutor chain...

Invoking: send_event with {'body': 'Reminder to recall John', 'attendees': ['John'], 'subject': 'Recall John', 'start_datetime': '2024-06-07T12:00:00+00:00', 'end_datetime': '2024-06-07T13:00:00+00:00'}


ValueError Traceback (most recent call last)

in <cell line: 1>()
----> 1 answer = agent_events.invoke(
2 f"add an event at 2024-06-07 at 12:00:00 PM to recall John ?"
3 )
4 print(answer['output'])

10 frames

/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py in invoke(self, input, config, **kwargs)
164 except BaseException as e:
165 run_manager.on_chain_error(e)
--> 166 raise e
167 run_manager.on_chain_end(outputs)
168

/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py in invoke(self, input, config, **kwargs)
154 self._validate_inputs(inputs)
155 outputs = (
--> 156 self._call(inputs, run_manager=run_manager)
157 if new_arg_supported
158 else self._call(inputs)

/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in _call(self, inputs, run_manager)
1431 # We now enter the agent loop (until it returns something).
1432 while self._should_continue(iterations, time_elapsed):
-> 1433 next_step_output = self._take_next_step(
1434 name_to_tool_map,
1435 color_mapping,

/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)
1137 ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:
1138 return self._consume_next_step(
-> 1139 [
1140 a
1141 for a in self._iter_next_step(

/usr/local/lib/python3.10/dist-packages/langchain/agents/agent.py in (.0)
1137 ) -> Union[AgentFinish, List[Tuple[AgentAction, str]]]:
1138 return self._consume_next_step(
-> 1139 [
1140 a
1141 for a in self._iter_next_step(

/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)
1222 yield agent_action
1223 for agent_action in actions:
-> 1224 yield self._perform_agent_action(
1225 name_to_tool_map, color_mapping, agent_action, run_manager
1226 )

/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)
1244 tool_run_kwargs["llm_prefix"] = ""
1245 # We then call the tool on the tool input to get an observation
-> 1246 observation = tool.run(
1247 agent_action.tool_input,
1248 verbose=self.verbose,

/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)
450 except (Exception, KeyboardInterrupt) as e:
451 run_manager.on_tool_error(e)
--> 452 raise e
453 else:
454 run_manager.on_tool_end(observation, color=color, name=self.name, **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)
407 tool_args, tool_kwargs = self._to_args_and_kwargs(parsed_input)
408 observation = (
--> 409 context.run(
410 self._run, *tool_args, run_manager=run_manager, **tool_kwargs
411 )

/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)
74 event.body = body
75 event.subject = subject
---> 76 event.start = dt.strptime(start_datetime, UTC_FORMAT)
77 event.end = dt.strptime(end_datetime, UTC_FORMAT)
78 for attendee in attendees:

/usr/local/lib/python3.10/dist-packages/O365/calendar.py in start(self, value)
1070 else:
1071 if not isinstance(value.tzinfo, ZoneInfo):
-> 1072 raise ValueError('TimeZone data must be set using ZoneInfo objects')
1073 self.__start = value
1074 if not self.end:

ValueError: TimeZone data must be set using ZoneInfo objects

from python-o365.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.