mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 07:38:29 +00:00
* sort imports * update --------- Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com> Co-authored-by: Eduardo Chiarotti <dudumelgaco@hotmail.com>
15 lines
294 B
Python
15 lines
294 B
Python
from functools import wraps
|
|
|
|
|
|
def memoize(func):
|
|
cache = {}
|
|
|
|
@wraps(func)
|
|
def memoized_func(*args, **kwargs):
|
|
key = (args, tuple(kwargs.items()))
|
|
if key not in cache:
|
|
cache[key] = func(*args, **kwargs)
|
|
return cache[key]
|
|
|
|
return memoized_func
|