Skip to content

A programming framework for agentic AI

Use yaml safe_load instead of load (#6672)

Eric Zhu150ea0192d2c
diff --git a/python/packages/autogen-ext/tests/task_centric_memory/utils.py b/python/packages/autogen-ext/tests/task_centric_memory/utils.py
index 196176915..9c1a870be 100644
--- a/python/packages/autogen-ext/tests/task_centric_memory/utils.py
+++ b/python/packages/autogen-ext/tests/task_centric_memory/utils.py
@@ -28,4 +28,4 @@ def load_yaml_file(file_path: str) -> Any:
Opens a file and returns its contents.
"""
with open(file_path, "r") as file:
- return yaml.load(file, Loader=yaml.FullLoader)
+ return yaml.safe_load(file)
diff --git a/python/samples/task_centric_memory/utils.py b/python/samples/task_centric_memory/utils.py
index 366b16c99..98860a11c 100644
--- a/python/samples/task_centric_memory/utils.py
+++ b/python/samples/task_centric_memory/utils.py
@@ -28,5 +28,5 @@ def load_yaml_file(file_path: str) -> Any:
Opens a file and returns its contents.
"""
with open(file_path, "r") as file:
- return yaml.load(file, Loader=yaml.FullLoader)
+ return yaml.safe_load(file)