Skip to content

API Reference parrot.services.heartbeat

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.services.heartbeat

View source

Heartbeat scheduler for periodic agent wake-ups.

APScheduler is an optional dependency — install with: pip install ai-parrot[scheduler]

Alias AgentTask

Re-exported from parrot.services.models.AgentTask.

Alias DeliveryConfig

Re-exported from parrot.services.models.DeliveryConfig.

Alias HeartbeatConfig

Re-exported from parrot.services.models.HeartbeatConfig.

Class HeartbeatScheduler

Schedules periodic agent heartbeats via APScheduler.

On each trigger, creates an AgentTask and submits it via the provided callback (typically AgentService.submit_task).

Requires pip install ai-parrot[scheduler].

Parameter Type Default Description
task_callback Callable[[AgentTask], Coroutine]

Attributes:

Attribute Type Description
registered_count int Number of registered heartbeats.

Method HeartbeatScheduler.register

Register a heartbeat for an agent.

register(config: HeartbeatConfig) -> Optional[str]

Parameter Type Default Description
config HeartbeatConfig Heartbeat configuration with cron or interval.

Returns: Optional[str] — APScheduler job ID, or None if config is disabled.

Method HeartbeatScheduler.start

Start the APScheduler.

start() -> None

Method HeartbeatScheduler.stop

Stop the APScheduler.

stop() -> None

Alias TaskPriority

Re-exported from parrot.services.models.TaskPriority.

Alias lazy_import

Re-exported from parrot._imports.lazy_import.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally