Answer the first round: one clock read, the limit's message and time zone on stderr, plainer help and comments
This commit is contained in:
@@ -94,6 +94,10 @@ def hit_limit(event: dict) -> bool:
|
||||
return ends_stream(event) and event.get("api_error_status") == 429
|
||||
|
||||
|
||||
def limit_said(event: dict) -> str:
|
||||
return result if isinstance(result := event.get("result"), str) else "claude said nothing more"
|
||||
|
||||
|
||||
# {"type": "rate_limit_event", "rate_limit_info": {"status": "rejected", "resetsAt": 1790790000, ...}}
|
||||
def rejected_until(event: dict) -> int | None:
|
||||
"""When a usage limit that rejected the request resets, in seconds since the epoch."""
|
||||
|
||||
Reference in New Issue
Block a user