Skip to content

Commit e1e7ff1

Browse files
committed
memoized completer_for
1 parent 6bbf134 commit e1e7ff1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llm_cooperation/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from abc import ABC, abstractmethod
2828
from dataclasses import dataclass
2929
from enum import Enum
30+
from functools import lru_cache
3031
from typing import (
3132
Callable,
3233
Dict,
@@ -143,6 +144,7 @@ def amount_as_str(amount: float) -> str:
143144
return f"${amount:.02f}"
144145

145146

147+
@lru_cache
146148
def completer_for(model_setup: ModelSetup) -> Completer:
147149
if model_setup.dry_run is not None:
148150
dummy_completions: Tuple[Completion] = (assistant_message(model_setup.dry_run),)

0 commit comments

Comments
 (0)