Strip markdown fences in parse_batch_response
This commit is contained in:
1 parent
baa6db5aa2
commit
b792c3cca0
2 files changed
+16
-1
No files matched your search
@@ -34,7 +34,11 @@ class CallerIdentity:
|
||||
|
||||
|
||||
def parse_batch_response(raw: str) -> list[CallerIdentity]:
|
||||
data = json.loads(raw)
|
||||
stripped = raw.strip()
|
||||
if stripped.startswith("```") and stripped.endswith("```"):
|
||||
lines = stripped.splitlines()
|
||||
stripped = "\n".join(lines[1:-1])
|
||||
data = json.loads(stripped)
|
||||
callers = data.get("callers", [])
|
||||
result = []
|
||||
for c in callers:
|
||||
|
||||
Reference in new issue
Block a user