trading/services/meet_kevin_watcher/config.py
Viktor Barzin ed2195d879 feat(meet-kevin): throttle inter-video LLM calls (30s) to stay under Anthropic RPM
First production run hit Anthropic's per-account rate_limit_error (429) trying
to burn through 16 backfill videos in seconds. The SDK's built-in retry can't
recover because the rate limit window resets slower than the 3 retry attempts.

Added meet_kevin_inter_video_sleep_seconds (default 30s) to PipelineDeps and
main's _process_pending_videos loop. 16 backfill videos now take ~8 min (16 * 30s
sleeps + ~30s per LLM call) instead of bursting into the rate limit.
2026-05-22 20:25:19 +00:00

32 lines
1 KiB
Python

"""Configuration for the Meet Kevin watcher service."""
from shared.config import BaseConfig
class MeetKevinWatcherConfig(BaseConfig):
"""Meet Kevin watcher settings.
Extends :class:`BaseConfig` with YouTube channel monitoring,
caption fetching, and LLM analysis settings. All settings can be
overridden via environment variables prefixed with ``TRADING_``.
"""
# YouTube settings
meet_kevin_channel_id: str = "UCUvvj5lwue7PspotMDjk5UA"
meet_kevin_poll_interval_seconds: int = 10800
meet_kevin_max_caption_retries: int = 5
# LLM analysis settings
meet_kevin_max_llm_retries: int = 3
meet_kevin_llm_model: str = "claude-sonnet-4-5"
meet_kevin_prompt_version: str = "v1"
meet_kevin_daily_cost_cap_usd: float = 5.0
meet_kevin_inter_video_sleep_seconds: int = 30
# API credentials
anthropic_oauth_token: str = ""
# Runtime settings
meet_kevin_workdir: str = "/tmp/meet_kevin_captions"
otel_service_name: str = "meet-kevin-watcher"
otel_metrics_port: int = 9097