mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-14 02:22:54 +00:00
Fix XML function calling args parsing.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
###
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user