parse • AI Agents Framework

parse: Parse schedule expression and return interval in seconds.

parse

Method

</div>

This is a method of the ScheduleParser class in the agent_scheduler module.

Parse schedule expression and return interval in seconds.

Supported formats:

  • “daily” -&gt; 86400 seconds
  • “hourly” -&gt; 3600 seconds
  • “*/30m” -&gt; 1800 seconds (every 30 minutes)
  • “*/1h” -&gt; 3600 seconds (every 1 hour)
  • “60” -&gt; 60 seconds (plain number)

Signature

python
def parse(schedule_expr: str) -> int

Parameters

ParamField str

Schedule expression string

Returns

ResponseField int

Interval in seconds

Exceptions

ValueError

If schedule format is not supported

Uses

  • schedule_expr.isdigit
  • ValueError

Used By

Source

View on GitHub

praisonai/agent_scheduler.py at line 36