|
Option C Tools
|
Public Member Functions | |
| None | __init__ (self, int limit_per_minute=30) |
| bool | consume (self) |
Protected Member Functions | |
| None | _refill (self) |
Protected Attributes | |
| _limit = max(1, limit_per_minute) | |
| float | _tokens = float(self._limit) |
| float | _last_refill = time.monotonic() |
Simple token-bucket rate limiter (stdlib only). One token is consumed per tool call. Tokens refill at the rate of ``limit_per_minute / 60`` tokens per second. The bucket starts full. Thread safety: not needed for stdio Phase 5A (single-threaded).
| None oct.mcp.server.RateLimiter.__init__ | ( | self, | |
| int | limit_per_minute = 30 ) |
|
protected |
| bool oct.mcp.server.RateLimiter.consume | ( | self | ) |
|
protected |
|
protected |
|
protected |