Skip to content

Commit b08a1da

Browse files
committed
fix(agent)
1 parent 3ea331d commit b08a1da

File tree

1 file changed

+4
-0
lines changed
  • samples/agent/adk/restaurant_finder

1 file changed

+4
-0
lines changed

samples/agent/adk/restaurant_finder/agent.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import logging
1717
import os
1818
import re
19+
import re
1920
from collections.abc import AsyncIterable
2021
from typing import Any
2122

@@ -230,6 +231,9 @@ async def stream(self, query, session_id) -> AsyncIterable[dict[str, Any]]:
230231
# Autofix: Remove trailing commas from arrays and objects
231232
json_string_cleaned = re.sub(r",\s*([\]}])", r"\1", json_string_cleaned)
232233

234+
# Autofix: Remove trailing commas from arrays and objects
235+
json_string_cleaned = re.sub(r",(?=\s*[\]}])", "", json_string_cleaned)
236+
233237
# --- New Validation Steps ---
234238
# 1. Check if it's parsable JSON
235239
parsed_json_data = json.loads(json_string_cleaned)

0 commit comments

Comments
 (0)