def delayed_health_check(event: KubernetesAnyChangeEvent, action_params: DelayedHealthCheckParams):
    """
    runs a holmes workload health action with a delay
    """
    metadata = event.obj and event.obj.metadata

    if not action_params.ask:
        action_params.ask = f"help me diagnose an issue with a workload {metadata.namespace}/{event.obj.kind}/{metadata.name} running in my Kubernetes cluster. Can you assist with identifying potential issues and pinpoint the root cause."

    action_params.resource = ResourceInfo(name=metadata.name, namespace=metadata.namespace, kind=event.obj.kind)

    logging.info(f"Scheduling health check. {metadata.name} delays: {action_params.delay_seconds}")
    event.get_scheduler().schedule_action(
        action_func=holmes_workload_health,
        task_id=f"health_check_{metadata.name}_{metadata.namespace}",
        scheduling_params=FixedDelayRepeat(repeat=1, seconds_delay=action_params.delay_seconds),
        named_sinks=event.named_sinks,
        action_params=action_params,
        replace_existing=True,
        standalone_task=True,
    )

    runs a holmes workload health action with a delay
    
src/robusta/core/playbooks/internal/ai_integration.py