Method
__init__
(
self,
max_size: int = 10,
can_trim_fn: Optional[Any] = None,
trim_fn: Optional[Any] = None,
)
Source from the content-addressed store, hash-verified
| 59 | """ |
| 60 | |
| 61 | def __init__( |
| 62 | self, |
| 63 | max_size: int = 10, |
| 64 | can_trim_fn: Optional[Any] = None, |
| 65 | trim_fn: Optional[Any] = None, |
| 66 | ): |
| 67 | self.max_size = max_size |
| 68 | self._cache = {} |
| 69 | self._lru = deque() |
| 70 | self._lock = threading.Lock() |
| 71 | |
| 72 | # Optional trim functions (for longer prefix reuse) |
| 73 | self._can_trim_fn = can_trim_fn |
| 74 | self._trim_fn = trim_fn |
| 75 | |
| 76 | def _search(self, model, tokens: List[int]) -> SearchResult: |
| 77 | """ |
Callers
nothing calls this directly
Tested by
no test coverage detected