Defines Pydantic settings for polling intervals, timeouts, and message limits. Use when configuring periodic background polling tasks.
# Source: https://github.com/crewaiinc/crewai | License: MIT | Copyright 2025 crewAI, Inc
# Provided via justclaw.it.com; keep this notice with the code.
"""Polling update mechanism configuration."""
from __future__ import annotations
from pydantic import BaseModel, Field
class PollingConfig(BaseModel):
"""Configuration for polling-based task updates.
Attributes:
interval: Seconds between poll attempts.
timeout: Max seconds to poll before raising timeout error.
max_polls: Max number of poll attempts.
history_length: Number of messages to retrieve per poll.
"""
interval: float = Field(
default=2.0, gt=0, description="Seconds between poll attempts"
)
timeout: float | None = Field(default=None, gt=0, description="Max second
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key