Fix XML function calling args parsing.

This commit is contained in:
Michael Struwig
2024-03-22 15:05:29 +02:00
parent 93a1a865f0
commit 3adfb70fc9
+6 -2
View File
@@ -727,10 +727,14 @@ def parse_xml_params(xml_content):
root = ET.fromstring(xml_content)
params = {}
for child in root.findall(".//parameters/*"):
params[child.tag] = child.text
try:
# Attempt to decode the element's text as JSON
params[child.tag] = json.loads(child.text)
except json.JSONDecodeError:
# If JSON decoding fails, use the original text
params[child.tag] = child.text
return params
###