mistral_tools.utils

Miscellaneous utility functions and classes

Classes

RateLimiter(rate_limit)

A simple rate limiter that sleeps for a given amount of time between calls

class mistral_tools.utils.RateLimiter(rate_limit)[source]

A simple rate limiter that sleeps for a given amount of time between calls

usage example:

rate_limiter = RateLimiter(1.0)

for _ in range(10):
    with rate_limiter:
        print("doing something, waiting at least 1 second between calls")