diff --git a/src/google/adk_community/sessions/utils.py b/src/google/adk_community/sessions/utils.py index bc53d2b2..5fb50626 100644 --- a/src/google/adk_community/sessions/utils.py +++ b/src/google/adk_community/sessions/utils.py @@ -35,3 +35,13 @@ def _json_serializer(obj): if isinstance(obj, Decimal): return float(obj) return str(obj) + + +def parse_kv_pairs(data: str) -> dict: + """Parses comma-separated key-value pairs into a dictionary.""" + result = {} + parts = data.split(",") + for part in parts: + key, value = part.split(":") + result[key.strip()] = value.strip() + return result