diff --git a/agents-api/agents_api/activities/utils.py b/agents-api/agents_api/activities/utils.py index a9d4a11f2..99fc91da5 100644 --- a/agents-api/agents_api/activities/utils.py +++ b/agents-api/agents_api/activities/utils.py @@ -13,6 +13,7 @@ from dataclasses import dataclass from threading import Lock as ThreadLock from typing import Any, ParamSpec, TypeVar +from functools import reduce import re2 from beartype import beartype @@ -140,6 +141,7 @@ def safe_extract_json(string: str): "sum": sum, "tuple": tuple, "zip": zip, + "reduce": reduce, # Safe versions of potentially dangerous functions "range": safe_range, "load_json": safe_json_loads,