mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-03 14:09:24 +00:00
Update utils.py
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from itertools 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]
|
||||
|
||||
memoized_func.__dict__.update(func.__dict__)
|
||||
return memoized_func
|
||||
|
||||
Reference in New Issue
Block a user