Skip to content

Limit

RateLimitInfo

Bases: BaseModel

limit

limit: int

used

used: int

remaining

remaining: int

reset

reset: int

reset_time

reset_time: int

RateLimitResources

Bases: BaseModel

core

core: RateLimitInfo

search

search: RateLimitInfo

graphql

graphql: RateLimitInfo

integration_manifest

integration_manifest: RateLimitInfo

source_import

source_import: RateLimitInfo

code_scanning_upload

code_scanning_upload: RateLimitInfo

code_scanning_autofix

code_scanning_autofix: RateLimitInfo

actions_runner_registration

actions_runner_registration: RateLimitInfo

scim

scim: RateLimitInfo

dependency_snapshots

dependency_snapshots: RateLimitInfo

dependency_sbom

dependency_sbom: RateLimitInfo

audit_log

audit_log: RateLimitInfo

audit_log_streaming

audit_log_streaming: RateLimitInfo
code_search: RateLimitInfo

RateLimit

Bases: BaseModel

Methods:

Name Description
is_rate_limited

Check if the current rate limit has been exceeded.

resources

resources: RateLimitResources

rate

rate: RateLimitInfo

is_rate_limited

is_rate_limited() -> bool

Check if the current rate limit has been exceeded.

Determines whether the GitHub API rate limit has been reached by checking if there are any remaining API calls available.

Returns:

Name Type Description
bool bool

True if rate limit is exceeded (no remaining calls), False otherwise.

Source code in src/swebenchv2/typings/limit.py
def is_rate_limited(self) -> bool:
    """Check if the current rate limit has been exceeded.

    Determines whether the GitHub API rate limit has been reached
    by checking if there are any remaining API calls available.

    Returns:
        bool: True if rate limit is exceeded (no remaining calls), False otherwise.
    """
    return self.rate.remaining == 0