mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
* Update annotations.py * Update utils.py * Update crew_base.py * Update utils.py * Update crew_base.py --------- Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
14 lines
293 B
Python
14 lines
293 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
|