Skip to content

TimeEventConfig

Base classes

Name Children Inherits
EventSourceConfig
evented_config.configs
Base configuration for event sources.

⋔ Inheritance diagram

graph TD
  1028807661["configs.TimeEventConfig"]
  711273161["configs.EventSourceConfig"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  711273161 --> 1028807661
  330168112 --> 711273161
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: EventSourceConfig

Time-based event source configuration.

Source code in src/evented_config/configs.py
class TimeEventConfig(EventSourceConfig):
    """Time-based event source configuration."""

    type: Literal["time"] = Field("time", init=False)
    """Time event."""

    schedule: str = Field(
        examples=["0 9 * * 1-5", "*/30 * * * *", "0 0 * * 0"],
        title="Cron schedule",
    )
    """Cron expression for scheduling (e.g. '0 9 * * 1-5' for weekdays at 9am)"""

    prompt: str = Field(
        examples=["Daily status check", "Generate weekly report", "Check system health"],
        title="Trigger prompt",
    )
    """Prompt to send to the agent when the schedule triggers."""

    timezone: str | None = Field(
        default=None,
        examples=["UTC", "America/New_York", "Europe/London"],
        title="Schedule timezone",
    )
    """Timezone for schedule (defaults to system timezone)"""

    skip_missed: bool = Field(default=False, title="Skip missed executions")
    """Whether to skip executions missed while agent was inactive"""

    model_config = ConfigDict(json_schema_extra={"x-doc-title": "Time event"})

    def get_event_source(self) -> TimeEventSource:
        """Create timed event source instance."""
        from evented.timed_watcher import TimeEventSource

        return TimeEventSource(config=self)

prompt class-attribute instance-attribute

prompt: str = Field(
    examples=["Daily status check", "Generate weekly report", "Check system health"],
    title="Trigger prompt",
)

Prompt to send to the agent when the schedule triggers.

schedule class-attribute instance-attribute

schedule: str = Field(examples=['0 9 * * 1-5', '*/30 * * * *', '0 0 * * 0'], title='Cron schedule')

Cron expression for scheduling (e.g. '0 9 * * 1-5' for weekdays at 9am)

skip_missed class-attribute instance-attribute

skip_missed: bool = Field(default=False, title='Skip missed executions')

Whether to skip executions missed while agent was inactive

timezone class-attribute instance-attribute

timezone: str | None = Field(
    default=None, examples=["UTC", "America/New_York", "Europe/London"], title="Schedule timezone"
)

Timezone for schedule (defaults to system timezone)

type class-attribute instance-attribute

type: Literal['time'] = Field('time', init=False)

Time event.

get_event_source

get_event_source() -> TimeEventSource

Create timed event source instance.

Source code in src/evented_config/configs.py
def get_event_source(self) -> TimeEventSource:
    """Create timed event source instance."""
    from evented.timed_watcher import TimeEventSource

    return TimeEventSource(config=self)

:fa-brands-github: Show source on GitHub